1.主从切换
--现在主节点是:1.12,需要把主节点切换到:1.11;
masterha_master_switch --conf=/etc/masterha/app1.cnf \
--master_state=alive --new_master_host=192.168.1.11 \
--new_master_port=3306 --orig_master_is_new_slave \
--running_updates_limit=10000
[root@mysql1 bin]# masterha_master_switch --conf=/etc/masterha/app1.cnf \
> --master_state=alive --new_master_host=192.168.1.11 \
> --new_master_port=3306 --orig_master_is_new_slave \
> --running_updates_limit=10000
Sat Aug 3 09:24:43 2024 - [info] MHA::MasterRotate version 0.58.
Sat Aug 3 09:24:43 2024 - [info] Starting online master switch..
Sat Aug 3 09:24:43 2024 - [info]
Sat Aug 3 09:24:43 2024 - [info] * Phase 1: Configuration Check Phase..
Sat Aug 3 09:24:43 2024 - [info]
Sat Aug 3 09:24:43 2024 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Sat Aug 3 09:24:43 2024 - [info] Reading application default configuration from /etc/masterha/app1.cnf..
Sat Aug 3 09:24:43 2024 - [info] Reading server configuration from /etc/masterha/app1.cnf..
Sat Aug 3 09:24:44 2024 - [info] GTID failover mode = 1
Sat Aug 3 09:24:44 2024 - [info] Current Alive Master: 192.168.1.12(192.168.1.12:3306)
Sat Aug 3 09:24:44 2024 - [info] Alive Slaves:
Sat Aug 3 09:24:44 2024 - [info] 192.168.1.11(192.168.1.11:3306) Version=5.7.34-log (oldest major version between slaves) log-bin:enabled
Sat Aug 3 09:24:44 2024 - [info] GTID ON
Sat Aug 3 09:24:44 2024 - [info] Replicating from 192.168.1.12(192.168.1.12:3306)
Sat Aug 3 09:24:44 2024 - [info] Primary candidate for the new Master (candidate_master is set)
Sat Aug 3 09:24:44 2024 - [info] 192.168.1.13(192.168.1.13:3306) Version=5.7.34-log (oldest major version between slaves) log-bin:enabled
Sat Aug 3 09:24:44 2024 - [info] GTID ON
Sat Aug 3 09:24:44 2024 - [info] Replicating from 192.168.1.12(192.168.1.12:3306)
Sat Aug 3 09:24:44 2024 - [info] 192.168.1.14(192.168.1.14:3306) Version=5.7.34-log (oldest major version between slaves) log-bin:enabled
Sat Aug 3 09:24:44 2024 - [info] GTID ON
Sat Aug 3 09:24:44 2024 - [info] Replicating from 192.168.1.12(192.168.1.12:3306)
It is better to execute FLUSH NO_WRITE_TO_BINLOG TABLES on the master before switching. Is it ok to execute on 192.168.1.12(192.168.1.12:3306)? (YES/no): yes
Sat Aug 3 09:24:46 2024 - [info] Executing FLUSH NO_WRITE_TO_BINLOG TABLES. This may take long time..
Sat Aug 3 09:24:46 2024 - [info] ok.
Sat Aug 3 09:24:46 2024 - [info] Checking MHA is not monitoring or doing failover..
Sat Aug 3 09:24:46 2024 - [error][/usr/local/share/perl5/MHA/MasterRotate.pm, ln143] Getting advisory lock failed on the current master. MHA Monitor runs on the current master. Stop MHA Manager/Monitor and try again.
Sat Aug 3 09:24:46 2024 - [error][/usr/local/share/perl5/MHA/ManagerUtil.pm, ln177] Got ERROR: at /usr/local/bin/masterha_master_switch line 53.
--从如下这句可以看出,需要先关闭MHA master节点的监控。
Stop MHA Manager/Monitor and try again
2.关闭MHA master;
[root@mysql1 bin]# masterha_stop --conf=/etc/masterha/app1.cnf
Stopped app1 successfully.
3.重新切换
Sat Aug 3 09:29:01 2024 - [info] /usr/local/bin/master_ip_online_change --command=stop --orig_master_host=192.168.1.12 --orig_master_ip=192.168.1.12 --orig_master_port=3306 --orig_master_user='root' --new_master_host=192.168.1.11 --new_master_ip=192.168.1.11 --new_master_port=3306 --new_master_user='root' --orig_master_ssh_user=root --new_master_ssh_user=root --orig_master_is_new_slave --orig_master_password=xxx --new_master_password=xxx
"my" variable $orig_master_password masks earlier declaration in same scope at /usr/local/bin/master_ip_online_change line 42.
Sat Aug 3 09:29:01 2024 - [error][/usr/local/share/perl5/MHA/ManagerUtil.pm, ln177] Got ERROR: at /usr/local/bin/masterha_master_switch line 53.
Sat Aug 3 09:53:45 2024 - [info] /usr/local/bin/master_ip_online_change --command=stop --orig_master_host=192.168.1.12 --orig_master_ip=192.168.1.12 --orig_master_port=3306 --orig_master_user='root' --new_master_host=192.168.1.11 --new_master_ip=192.168.1.11 --new_master_port=3306 --new_master_user='root' --orig_master_ssh_user=root --new_master_ssh_user=root --orig_master_is_new_slave --orig_master_password=xxx --new_master_password=xxx
Sat Aug 3 09:53:45 2024 549132 Set read_only on the new master.. ok.
Sat Aug 3 09:53:45 2024 552749 Drpping app user on the orig master..
Got Error: Undefined subroutine &main::FIXME_xxx_drop_app_user called at /usr/local/bin/master_ip_online_change line 159.
Sat Aug 3 09:52:57 2024 - [info] /usr/local/bin/master_ip_online_change --command=stop --orig_master_host=192.168.1.12 --orig_master_ip=192.168.1.12 --orig_master_port=3306 --orig_master_user='root' --new_master_host=192.168.1.11 --new_master_ip=192.168.1.11 --new_master_port=3306 --new_master_user='root' --orig_master_ssh_user=root --new_master_ssh_user=root --orig_master_is_new_slave --orig_master_password=xxx --new_master_password=xxx
"my" variable $new_master_password masks earlier declaration in same scope at /usr/local/bin/master_ip_online_change line 45.
Sat Aug 3 09:52:58 2024 - [error][/usr/local/share/perl5/MHA/ManagerUtil.pm, ln177] Got ERROR: at /usr/local/bin/masterha_master_switch line 53.
--$orig_master_password 已经定义过了。
--$new_master_password 已经定义过了,删除多余的即可。
--FIXME_xxx_drop_app_user 是未定义的,删除即可。
vim /usr/local/bin/master_ip_online_change
157 $orig_master_handler->disable_log_bin_local();
158 print current_time_us() . " Drpping app user on the orig master..\n";
159 #FIXME_xxx_drop_app_user($orig_master_handler); --注释这行。
4.重新进行主从切换。
[root@mysql1 bin]# masterha_master_switch --conf=/etc/masterha/app1.cnf --master_state=alive --new_master_host=192.168.1.11 --new_master_port=3306 --orig_master_is_new_slave --running_updates_limit=10000
Sat Aug 3 09:54:31 2024 - [info] MHA::MasterRotate version 0.58.
Sat Aug 3 09:54:31 2024 - [info] Starting online master switch..
Sat Aug 3 09:54:31 2024 - [info]
Sat Aug 3 09:54:31 2024 - [info] * Phase 1: Configuration Check Phase..
Sat Aug 3 09:54:31 2024 - [info]
Sat Aug 3 09:54:31 2024 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Sat Aug 3 09:54:31 2024 - [info] Reading application default configuration from /etc/masterha/app1.cnf..
Sat Aug 3 09:54:31 2024 - [info] Reading server configuration from /etc/masterha/app1.cnf..
Sat Aug 3 09:54:32 2024 - [info] GTID failover mode = 1
Sat Aug 3 09:54:32 2024 - [info] Current Alive Master: 192.168.1.12(192.168.1.12:3306)
Sat Aug 3 09:54:32 2024 - [info] Alive Slaves:
Sat Aug 3 09:54:32 2024 - [info] 192.168.1.11(192.168.1.11:3306) Version=5.7.34-log (oldest major version between slaves) log-bin:enabled
Sat Aug 3 09:54:32 2024 - [info] GTID ON
Sat Aug 3 09:54:32 2024 - [info] Replicating from 192.168.1.12(192.168.1.12:3306)
Sat Aug 3 09:54:32 2024 - [info] Primary candidate for the new Master (candidate_master is set)
Sat Aug 3 09:54:32 2024 - [info] 192.168.1.13(192.168.1.13:3306) Version=5.7.34-log (oldest major version between slaves) log-bin:enabled
Sat Aug 3 09:54:32 2024 - [info] GTID ON
Sat Aug 3 09:54:32 2024 - [info] Replicating from 192.168.1.12(192.168.1.12:3306)
Sat Aug 3 09:54:32 2024 - [info] 192.168.1.14(192.168.1.14:3306) Version=5.7.34-log (oldest major version between slaves) log-bin:enabled
Sat Aug 3 09:54:32 2024 - [info] GTID ON
Sat Aug 3 09:54:32 2024 - [info] Replicating from 192.168.1.12(192.168.1.12:3306)
It is better to execute FLUSH NO_WRITE_TO_BINLOG TABLES on the master before switching. Is it ok to execute on 192.168.1.12(192.168.1.12:3306)? (YES/no): yes
Sat Aug 3 09:54:33 2024 - [info] Executing FLUSH NO_WRITE_TO_BINLOG TABLES. This may take long time..
Sat Aug 3 09:54:33 2024 - [info] ok.
Sat Aug 3 09:54:33 2024 - [info] Checking MHA is not monitoring or doing failover..
Sat Aug 3 09:54:33 2024 - [info] Checking replication health on 192.168.1.11..
Sat Aug 3 09:54:33 2024 - [info] ok.
Sat Aug 3 09:54:33 2024 - [info] Checking replication health on 192.168.1.13..
Sat Aug 3 09:54:33 2024 - [info] ok.
Sat Aug 3 09:54:33 2024 - [info] Checking replication health on 192.168.1.14..
Sat Aug 3 09:54:33 2024 - [info] ok.
Sat Aug 3 09:54:33 2024 - [info] 192.168.1.11 can be new master.
Sat Aug 3 09:54:33 2024 - [info]
From:
192.168.1.12(192.168.1.12:3306) (current master)
+--192.168.1.11(192.168.1.11:3306)
+--192.168.1.13(192.168.1.13:3306)
+--192.168.1.14(192.168.1.14:3306)
To:
192.168.1.11(192.168.1.11:3306) (new master)
+--192.168.1.13(192.168.1.13:3306)
+--192.168.1.14(192.168.1.14:3306)
+--192.168.1.12(192.168.1.12:3306)
Starting master switch from 192.168.1.12(192.168.1.12:3306) to 192.168.1.11(192.168.1.11:3306)? (yes/NO): yes
Sat Aug 3 09:54:35 2024 - [info] Checking whether 192.168.1.11(192.168.1.11:3306) is ok for the new master..
Sat Aug 3 09:54:35 2024 - [info] ok.
Sat Aug 3 09:54:35 2024 - [info] 192.168.1.12(192.168.1.12:3306): SHOW SLAVE STATUS returned empty result. To check replication filtering rules, temporarily executing CHANGE MASTER to a dummy host.
Sat Aug 3 09:54:35 2024 - [info] 192.168.1.12(192.168.1.12:3306): Resetting slave pointing to the dummy host.
Sat Aug 3 09:54:35 2024 - [info] ** Phase 1: Configuration Check Phase completed.
Sat Aug 3 09:54:35 2024 - [info]
Sat Aug 3 09:54:35 2024 - [info] * Phase 2: Rejecting updates Phase..
Sat Aug 3 09:54:35 2024 - [info]
Sat Aug 3 09:54:35 2024 - [info] Executing master ip online change script to disable write on the current master:
Sat Aug 3 09:54:35 2024 - [info] /usr/local/bin/master_ip_online_change --command=stop --orig_master_host=192.168.1.12 --orig_master_ip=192.168.1.12 --orig_master_port=3306 --orig_master_user='root' --new_master_host=192.168.1.11 --new_master_ip=192.168.1.11 --new_master_port=3306 --new_master_user='root' --orig_master_ssh_user=root --new_master_ssh_user=root --orig_master_is_new_slave --orig_master_password=xxx --new_master_password=xxx
Sat Aug 3 09:54:35 2024 517988 Set read_only on the new master.. ok.
Sat Aug 3 09:54:35 2024 521343 Drpping app user on the orig master..
Sat Aug 3 09:54:35 2024 521914 Waiting all running 3 threads are disconnected.. (max 1500 milliseconds)
{'Time' => '54556','db' => undef,'Id' => '48','User' => 'repuser','State' => 'Master has sent all binlog to slave; waiting for more updates','Command' => 'Binlog Dump GTID','Info' => undef,'Host' => 'mysql3:49440'}
{'Time' => '54556','db' => undef,'Id' => '49','User' => 'repuser','State' => 'Master has sent all binlog to slave; waiting for more updates','Command' => 'Binlog Dump GTID','Info' => undef,'Host' => 'mysql4:53432'}
{'Time' => '53814','db' => undef,'Id' => '56','User' => 'repuser','State' => 'Master has sent all binlog to slave; waiting for more updates','Command' => 'Binlog Dump GTID','Info' => undef,'Host' => 'mysql1:46200'}
Sat Aug 3 09:54:36 2024 026331 Waiting all running 3 threads are disconnected.. (max 1000 milliseconds)
{'Time' => '54557','db' => undef,'Id' => '48','User' => 'repuser','State' => 'Master has sent all binlog to slave; waiting for more updates','Command' => 'Binlog Dump GTID','Info' => undef,'Host' => 'mysql3:49440'}
{'Time' => '54557','db' => undef,'Id' => '49','User' => 'repuser','State' => 'Master has sent all binlog to slave; waiting for more updates','Command' => 'Binlog Dump GTID','Info' => undef,'Host' => 'mysql4:53432'}
{'Time' => '53815','db' => undef,'Id' => '56','User' => 'repuser','State' => 'Master has sent all binlog to slave; waiting for more updates','Command' => 'Binlog Dump GTID','Info' => undef,'Host' => 'mysql1:46200'}
Sat Aug 3 09:54:36 2024 529379 Waiting all running 3 threads are disconnected.. (max 500 milliseconds)
{'Time' => '54557','db' => undef,'Id' => '48','User' => 'repuser','State' => 'Master has sent all binlog to slave; waiting for more updates','Command' => 'Binlog Dump GTID','Info' => undef,'Host' => 'mysql3:49440'}
{'Time' => '54557','db' => undef,'Id' => '49','User' => 'repuser','State' => 'Master has sent all binlog to slave; waiting for more updates','Command' => 'Binlog Dump GTID','Info' => undef,'Host' => 'mysql4:53432'}
{'Time' => '53815','db' => undef,'Id' => '56','User' => 'repuser','State' => 'Master has sent all binlog to slave; waiting for more updates','Command' => 'Binlog Dump GTID','Info' => undef,'Host' => 'mysql1:46200'}
Sat Aug 3 09:54:37 2024 034310 Set read_only=1 on the orig master.. ok.
Sat Aug 3 09:54:37 2024 036159 Waiting all running 3 queries are disconnected.. (max 500 milliseconds)
{'Time' => '54558','db' => undef,'Id' => '48','User' => 'repuser','State' => 'Master has sent all binlog to slave; waiting for more updates','Command' => 'Binlog Dump GTID','Info' => undef,'Host' => 'mysql3:49440'}
{'Time' => '54558','db' => undef,'Id' => '49','User' => 'repuser','State' => 'Master has sent all binlog to slave; waiting for more updates','Command' => 'Binlog Dump GTID','Info' => undef,'Host' => 'mysql4:53432'}
{'Time' => '53816','db' => undef,'Id' => '56','User' => 'repuser','State' => 'Master has sent all binlog to slave; waiting for more updates','Command' => 'Binlog Dump GTID','Info' => undef,'Host' => 'mysql1:46200'}
Sat Aug 3 09:54:37 2024 539212 Killing all application threads..
Sat Aug 3 09:54:37 2024 542531 done.
Sat Aug 3 09:54:37 2024 - [info] ok.
Sat Aug 3 09:54:37 2024 - [info] Locking all tables on the orig master to reject updates from everybody (including root):
Sat Aug 3 09:54:37 2024 - [info] Executing FLUSH TABLES WITH READ LOCK..
Sat Aug 3 09:54:37 2024 - [info] ok.
Sat Aug 3 09:54:37 2024 - [info] Orig master binlog:pos is mybinlog.000002:936.
Sat Aug 3 09:54:37 2024 - [info] Waiting to execute all relay logs on 192.168.1.11(192.168.1.11:3306)..
Sat Aug 3 09:54:37 2024 - [info] master_pos_wait(mybinlog.000002:936) completed on 192.168.1.11(192.168.1.11:3306). Executed 0 events.
Sat Aug 3 09:54:37 2024 - [info] done.
Sat Aug 3 09:54:37 2024 - [info] Getting new master''s binlog name and position..
Sat Aug 3 09:54:37 2024 - [info] mybinlog.000005:230
Sat Aug 3 09:54:37 2024 - [info] All other slaves should start replication from here. Statement should be: CHANGE MASTER TO MASTER_HOST='192.168.1.11', MASTER_PORT=3306, MASTER_AUTO_POSITION=1, MASTER_USER='repuser', MASTER_PASSWORD='xxx';
Sat Aug 3 09:54:37 2024 - [info] Executing master ip online change script to allow write on the new master:
Sat Aug 3 09:54:37 2024 - [info] /usr/local/bin/master_ip_online_change --command=start --orig_master_host=192.168.1.12 --orig_master_ip=192.168.1.12 --orig_master_port=3306 --orig_master_user='root' --new_master_host=192.168.1.11 --new_master_ip=192.168.1.11 --new_master_port=3306 --new_master_user='root' --orig_master_ssh_user=root --new_master_ssh_user=root --orig_master_is_new_slave --orig_master_password=xxx --new_master_password=xxx
Sat Aug 3 09:54:37 2024 657950 Set read_only=0 on the new master.
Sat Aug 3 09:54:37 2024 658994 Creating app user on the new master..
Got Error: Undefined subroutine &main::FIXME_xxx_create_app_user called at /usr/local/bin/master_ip_online_change line 253.
Sat Aug 3 09:54:37 2024 - [warning] Proceeding.
Sat Aug 3 09:54:37 2024 - [info]
Sat Aug 3 09:54:37 2024 - [info] * Switching slaves in parallel..
Sat Aug 3 09:54:37 2024 - [info]
Sat Aug 3 09:54:37 2024 - [info] -- Slave switch on host 192.168.1.13(192.168.1.13:3306) started, pid: 125757
Sat Aug 3 09:54:37 2024 - [info]
Sat Aug 3 09:54:37 2024 - [info] -- Slave switch on host 192.168.1.14(192.168.1.14:3306) started, pid: 125758
Sat Aug 3 09:54:37 2024 - [info]
Sat Aug 3 09:54:38 2024 - [info] Log messages from 192.168.1.14 ...
Sat Aug 3 09:54:38 2024 - [info]
Sat Aug 3 09:54:37 2024 - [info] Waiting to execute all relay logs on 192.168.1.14(192.168.1.14:3306)..
Sat Aug 3 09:54:37 2024 - [info] master_pos_wait(mybinlog.000002:936) completed on 192.168.1.14(192.168.1.14:3306). Executed 0 events.
Sat Aug 3 09:54:37 2024 - [info] done.
Sat Aug 3 09:54:37 2024 - [info] Resetting slave 192.168.1.14(192.168.1.14:3306) and starting replication from the new master 192.168.1.11(192.168.1.11:3306)..
Sat Aug 3 09:54:37 2024 - [info] Executed CHANGE MASTER.
Sat Aug 3 09:54:37 2024 - [info] Slave started.
Sat Aug 3 09:54:38 2024 - [info] End of log messages from 192.168.1.14 ...
Sat Aug 3 09:54:38 2024 - [info]
Sat Aug 3 09:54:38 2024 - [info] -- Slave switch on host 192.168.1.14(192.168.1.14:3306) succeeded.
Sat Aug 3 09:54:38 2024 - [info] Log messages from 192.168.1.13 ...
Sat Aug 3 09:54:38 2024 - [info]
Sat Aug 3 09:54:37 2024 - [info] Waiting to execute all relay logs on 192.168.1.13(192.168.1.13:3306)..
Sat Aug 3 09:54:37 2024 - [info] master_pos_wait(mybinlog.000002:936) completed on 192.168.1.13(192.168.1.13:3306). Executed 0 events.
Sat Aug 3 09:54:37 2024 - [info] done.
Sat Aug 3 09:54:37 2024 - [info] Resetting slave 192.168.1.13(192.168.1.13:3306) and starting replication from the new master 192.168.1.11(192.168.1.11:3306)..
Sat Aug 3 09:54:37 2024 - [info] Executed CHANGE MASTER.
Sat Aug 3 09:54:37 2024 - [info] Slave started.
Sat Aug 3 09:54:38 2024 - [info] End of log messages from 192.168.1.13 ...
Sat Aug 3 09:54:38 2024 - [info]
Sat Aug 3 09:54:38 2024 - [info] -- Slave switch on host 192.168.1.13(192.168.1.13:3306) succeeded.
Sat Aug 3 09:54:38 2024 - [info] Unlocking all tables on the orig master:
Sat Aug 3 09:54:38 2024 - [info] Executing UNLOCK TABLES..
Sat Aug 3 09:54:38 2024 - [info] ok.
Sat Aug 3 09:54:38 2024 - [info] Starting orig master as a new slave..
Sat Aug 3 09:54:38 2024 - [info] Resetting slave 192.168.1.12(192.168.1.12:3306) and starting replication from the new master 192.168.1.11(192.168.1.11:3306)..
Sat Aug 3 09:54:38 2024 - [info] Executed CHANGE MASTER.
Sat Aug 3 09:54:39 2024 - [info] Slave started.
Sat Aug 3 09:54:39 2024 - [info] All new slave servers switched successfully.
Sat Aug 3 09:54:39 2024 - [info]
Sat Aug 3 09:54:39 2024 - [info] * Phase 5: New master cleanup phase..
Sat Aug 3 09:54:39 2024 - [info]
Sat Aug 3 09:54:39 2024 - [info] 192.168.1.11: Resetting slave info succeeded.
Sat Aug 3 09:54:39 2024 - [info] Switching master to 192.168.1.11(192.168.1.11:3306) completed successfully.
5.检查切换后的主从情况 。
[root@mysql1 bin]# masterha_check_repl --conf=/etc/masterha/app1.cnf
Sat Aug 3 09:57:53 2024 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Sat Aug 3 09:57:53 2024 - [info] Reading application default configuration from /etc/masterha/app1.cnf..
Sat Aug 3 09:57:53 2024 - [info] Reading server configuration from /etc/masterha/app1.cnf..
Sat Aug 3 09:57:53 2024 - [info] MHA::MasterMonitor version 0.58.
Sat Aug 3 09:57:54 2024 - [info] GTID failover mode = 1
Sat Aug 3 09:57:54 2024 - [info] Dead Servers:
Sat Aug 3 09:57:54 2024 - [info] Alive Servers:
Sat Aug 3 09:57:54 2024 - [info] 192.168.1.11(192.168.1.11:3306)
Sat Aug 3 09:57:54 2024 - [info] 192.168.1.12(192.168.1.12:3306)
Sat Aug 3 09:57:54 2024 - [info] 192.168.1.13(192.168.1.13:3306)
Sat Aug 3 09:57:54 2024 - [info] 192.168.1.14(192.168.1.14:3306)
Sat Aug 3 09:57:54 2024 - [info] Alive Slaves:
Sat Aug 3 09:57:54 2024 - [info] 192.168.1.12(192.168.1.12:3306) Version=5.7.34-log (oldest major version between slaves) log-bin:enabled
Sat Aug 3 09:57:54 2024 - [info] GTID ON
Sat Aug 3 09:57:54 2024 - [info] Replicating from 192.168.1.11(192.168.1.11:3306)
Sat Aug 3 09:57:54 2024 - [info] 192.168.1.13(192.168.1.13:3306) Version=5.7.34-log (oldest major version between slaves) log-bin:enabled
Sat Aug 3 09:57:54 2024 - [info] GTID ON
Sat Aug 3 09:57:54 2024 - [info] Replicating from 192.168.1.11(192.168.1.11:3306)
Sat Aug 3 09:57:54 2024 - [info] 192.168.1.14(192.168.1.14:3306) Version=5.7.34-log (oldest major version between slaves) log-bin:enabled
Sat Aug 3 09:57:54 2024 - [info] GTID ON
Sat Aug 3 09:57:54 2024 - [info] Replicating from 192.168.1.11(192.168.1.11:3306)
Sat Aug 3 09:57:54 2024 - [info] Current Alive Master: 192.168.1.11(192.168.1.11:3306)
Sat Aug 3 09:57:54 2024 - [info] Checking slave configurations..
Sat Aug 3 09:57:54 2024 - [info] Checking replication filtering settings..
Sat Aug 3 09:57:54 2024 - [info] binlog_do_db= , binlog_ignore_db=
Sat Aug 3 09:57:54 2024 - [info] Replication filtering check ok.
Sat Aug 3 09:57:54 2024 - [info] GTID (with auto-pos) is supported. Skipping all SSH and Node package checking.
Sat Aug 3 09:57:54 2024 - [info] Checking SSH publickey authentication settings on the current master..
Sat Aug 3 09:57:54 2024 - [info] HealthCheck: SSH to 192.168.1.11 is reachable.
Sat Aug 3 09:57:54 2024 - [info]
192.168.1.11(192.168.1.11:3306) (current master)
+--192.168.1.12(192.168.1.12:3306)
+--192.168.1.13(192.168.1.13:3306)
+--192.168.1.14(192.168.1.14:3306)
Sat Aug 3 09:57:54 2024 - [info] Checking replication health on 192.168.1.12..
Sat Aug 3 09:57:54 2024 - [info] ok.
Sat Aug 3 09:57:54 2024 - [info] Checking replication health on 192.168.1.13..
Sat Aug 3 09:57:54 2024 - [info] ok.
Sat Aug 3 09:57:54 2024 - [info] Checking replication health on 192.168.1.14..
Sat Aug 3 09:57:54 2024 - [info] ok.
Sat Aug 3 09:57:54 2024 - [info] Checking master_ip_failover_script status:
Sat Aug 3 09:57:54 2024 - [info] /usr/local/bin/master_ip_failover --command=status --ssh_user=root --orig_master_host=192.168.1.11 --orig_master_ip=192.168.1.11 --orig_master_port=3306
Sat Aug 3 09:57:54 2024 - [info] OK.
Sat Aug 3 09:57:54 2024 - [warning] shutdown_script is not defined.
Sat Aug 3 09:57:54 2024 - [info] Got exit code 0 (Not master dead).
MySQL Replication Health is OK.
--由此可见1.11,现在是主了,其他三个节点是备库。