Chek Slave MySql

26 views
Skip to first unread message

igo...@gmail.com

unread,
Apr 24, 2019, 11:11:01 AM4/24/19
to OpMon
Bom dia

Pessoal preciso de uma ajuda para fazer um Chek do Status de um Slave de um banco de dados MySql

O comando para acessar a base seria este:
/ebackup/mysql57/bin/mysql -uebkpuser -u -h10.138.251.53 -P3630

O comando para efetuar o Check seria este:
Show slave Status

O retorno do comando seria:

Slave_IO_State: Waiting for master to send event
                  Master_Host: master1
                  Master_User: root
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000004
          Read_Master_Log_Pos: 931
               Relay_Log_File: slave1-relay-bin.000056
                Relay_Log_Pos: 950
        Relay_Master_Log_File: mysql-bin.000004
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB:
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 931
              Relay_Log_Space: 1365
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File:
           Master_SSL_CA_Path:
              Master_SSL_Cert:
            Master_SSL_Cipher:
               Master_SSL_Key:
        Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids: 0

Mais não preciso de tudo deste retorno, somente:
Master_Host: master1
Master_Log_File: mysql-bin.000004
Relay_Log_File: slave1-relay-bin.000056
Slave
_IO_Running: Yes
Slave_SQL_Running: Yes

Seconds_Behind_Master: 0

Aguardo

Sandroval

Cristiano Ness

unread,
Apr 24, 2019, 1:20:52 PM4/24/19
to op...@googlegroups.com
Boa tarde,
 Você pode usar o modelo OpMon Health Cluster Node, adicionando através de um dos comandos abaixo, tem esse serviço.
Screenshot_1.png
 Ou pode usar esse comando abaixo, ele monitora a sincronia e gera alerta.
/usr/local/opmon/libexec/opservices/check_mysql_health --username=root --password=senha --port=3306 --mode=slave-lag
CRITICAL - Slave is 118 seconds behind master | slave_lag=118;10;20


Obrigado,
Cristiano Ness


--
You received this message because you are subscribed to the Google Groups "OpMon" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opmon+un...@googlegroups.com.
To post to this group, send email to op...@googlegroups.com.
Visit this group at https://groups.google.com/group/opmon.
To view this discussion on the web visit https://groups.google.com/d/msgid/opmon/a8c184e8-d0b0-4286-bf36-818eac04cdbc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

igo...@gmail.com

unread,
May 3, 2019, 7:15:14 AM5/3/19
to OpMon
Cristiano Ness,

Onde coloco para executar o comando direto?

Sandroval
To unsubscribe from this group and stop receiving emails from it, send an email to op...@googlegroups.com.

Cristiano Ness

unread,
May 3, 2019, 8:06:00 AM5/3/19
to op...@googlegroups.com
Dá uma olhada nesse post, acho que é isso que quer saber.
 
Obrigado,
Cristiano Ness


To unsubscribe from this group and stop receiving emails from it, send an email to opmon+un...@googlegroups.com.

To post to this group, send email to op...@googlegroups.com.
Visit this group at https://groups.google.com/group/opmon.

igo...@gmail.com

unread,
May 3, 2019, 11:19:43 AM5/3/19
to OpMon
Consigo colocar argumentos para o comando?
/usr/local/opmon/libexec/opservices/check_mysql_health --username=root --password=senha --port=3306 --mode=slave-lag
CRITICAL - Slave is 118 seconds behind master | slave_lag=118;10;20
Por exemplo: inserir username, password, port, Slave_lag (os 3 argumentos)

Att
Reply all
Reply to author
Forward
0 new messages