How to configure mysql replication in zabbbix

 

 

Note:- Below steps configure in the Salve Server:

 

Step 1:-  Ask customer or unix team to create mysql user name & password with privileges.

Ex:- below are the mysql logins with privileges.

user=zabbix

password='zabbixpassword'

 

CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'zabbixpassword';

GRANT REPLICATION CLIENT, SELECT, PROCESS, SHOW DATABASES ON *.* TO 'zabbix'@'localhost' IDENTIFIED BY 'zabbixpassword';

FLUSH PRIVILEGES;

 

Step 2:-  Once mysql logins are created with privileges then copy that same thing in the /etc/zabbix/.my.cnf path.

 

# vi /etc/zabbix/.my.cnf

[client]

user=zabbix

password='zabbixpassword'

 

CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'zabbixpassword';

GRANT REPLICATION CLIENT, SELECT, PROCESS, SHOW DATABASES ON *.* TO 'zabbix'@'localhost' IDENTIFIED BY 'zabbixpassword';

FLUSH PRIVILEGES;

 

 

Step 3:-  Now Update userparameters in the zabbix agent file.

 

# vi /etc/zabbix/zabbix_agentd.conf.d/mysql-slave.conf

UserParameter=repSBM,echo "show slave status\G;" | HOME=/etc/zabbix mysql | grep 'Seconds_Behind_Master' | awk '{print $2}'

UserParameter=repIOrun,echo "show slave status\G;" | HOME=/etc/zabbix mysql | grep -c 'Slave_IO_Running: Yes'

UserParameter=repSQLrun,echo "show slave status\G;" | HOME=/etc/zabbix mysql | grep -c 'Slave_SQL_Running: Yes'

 

 

Step 4:-  Now apply mysql slave template in the zabbix frontend.

Template Name:  “Template App MySQL Slave”

PLEASE WRITE A FEEDBACK OR SUGGESTIONS TO BELOW EMAIL ID’S.

prashantkumar.chawan@gmail.com

info@mytara.co.in