Replication监控及自动故障切换_ide

首先在相应的机器上增加授权

GRANT REPLICATION SLAVE ON *.* TO 'repl'@'192.168.1.108' IDENTIFIED BY 'repl';
GRANT REPLICATION SLAVE ON *.* TO 'repl'@'192.168.1.109' IDENTIFIED BY 'repl';
GRANT REPLICATION SLAVE ON *.* TO 'repl'@'192.168.1.110' IDENTIFIED BY 'repl';

 

Replication监控及自动故障切换_mysql_02

 

Replication监控及自动故障切换_mysql_03

report-host=192.168.1.110
master-info-repository=TABLE
relay-log-info-repository=TABLE

 

Replication监控及自动故障切换_ide_04

mysqlfailover --master=replm:replm@192.168.1.108 --discover-slaves-login=replm:replm --force

Replication监控及自动故障切换_ide_05