[root@wtj1vpztmysql04 ~] Tue Aug 6 14:23:49 2024 - [info] MHA::MasterRotate version 0.58. Tue Aug 6 14:23:49 2024 - [info] Starting online master switch.. Tue Aug 6 14:23:49 2024 - [info] Tue Aug 6 14:23:49 2024 - [info] * Phase 1: Configuration Check Phase.. Tue Aug 6 14:23:49 2024 - [info] Tue Aug 6 14:23:49 2024 - [info] Reading default configuration from /etc/masterha_default.cnf.. Tue Aug 6 14:23:49 2024 - [info] Reading application default configuration from /etc/masterha/app2.cnf.. Tue Aug 6 14:23:49 2024 - [info] Reading server configuration from /etc/masterha/app2.cnf.. Tue Aug 6 14:23:49 2024 - [debug] Connecting to servers.. Tue Aug 6 14:23:50 2024 - [debug] Connected to: 172.17.44.45(172.17.44.45:3307), user=mha_admin Tue Aug 6 14:23:50 2024 - [debug] Number of slave worker threads on host 172.17.44.45(172.17.44.45:3307): 2 Tue Aug 6 14:23:50 2024 - [debug] Connected to: 172.17.44.143(172.17.44.143:3307), user=mha_admin Tue Aug 6 14:23:50 2024 - [debug] Number of slave worker threads on host 172.17.44.143(172.17.44.143:3307): 4 Tue Aug 6 14:23:50 2024 - [debug] Connected to: 172.17.44.44(172.17.44.44:3307), user=mha_admin Tue Aug 6 14:23:50 2024 - [debug] Number of slave worker threads on host 172.17.44.44(172.17.44.44:3307): 4 Tue Aug 6 14:23:50 2024 - [debug] Comparing MySQL versions.. Tue Aug 6 14:23:50 2024 - [debug] Comparing MySQL versions done. Tue Aug 6 14:23:50 2024 - [debug] Connecting to servers done. Tue Aug 6 14:23:50 2024 - [info] GTID failover mode = 1 Tue Aug 6 14:23:50 2024 - [info] Current Alive Master: 172.17.44.45(172.17.44.45:3307) Tue Aug 6 14:23:50 2024 - [info] Alive Slaves: Tue Aug 6 14:23:50 2024 - [info] 172.17.44.143(172.17.44.143:3307) Version=8.0.28 (oldest major version between slaves) log-bin:enabled Tue Aug 6 14:23:50 2024 - [info] GTID ON Tue Aug 6 14:23:50 2024 - [debug] Relay log info repository: TABLE Tue Aug 6 14:23:50 2024 - [info] Replicating from 172.17.44.45(172.17.44.45:3307) Tue Aug 6 14:23:50 2024 - [info] Primary candidate for the new Master (candidate_master is set) Tue Aug 6 14:23:50 2024 - [info] 172.17.44.44(172.17.44.44:3307) Version=8.0.28 (oldest major version between slaves) log-bin:enabled Tue Aug 6 14:23:50 2024 - [info] GTID ON Tue Aug 6 14:23:50 2024 - [debug] Relay log info repository: TABLE Tue Aug 6 14:23:50 2024 - [info] Replicating from 172.17.44.45(172.17.44.45:3307) Tue Aug 6 14:23:50 2024 - [info] Not candidate for the new Master (no_master is set)
It is better to execute FLUSH NO_WRITE_TO_BINLOG TABLES on the master before switching. Is it ok to execute on 172.17.44.45(172.17.44.45:3307)? (YES/no): Yes Tue Aug 6 14:24:23 2024 - [info] Executing FLUSH NO_WRITE_TO_BINLOG TABLES. This may take long time.. Tue Aug 6 14:24:23 2024 - [info] ok. Tue Aug 6 14:24:23 2024 - [info] Checking MHA is not monitoring or doing failover.. Tue Aug 6 14:24:23 2024 - [info] Checking replication health on 172.17.44.143.. Tue Aug 6 14:24:23 2024 - [info] ok. Tue Aug 6 14:24:23 2024 - [info] Checking replication health on 172.17.44.44.. Tue Aug 6 14:24:23 2024 - [info] ok. Tue Aug 6 14:24:23 2024 - [info] Searching new master from slaves.. Tue Aug 6 14:24:23 2024 - [info] Candidate masters from the configuration file: Tue Aug 6 14:24:23 2024 - [info] 172.17.44.45(172.17.44.45:3307) Version=8.0.28 log-bin:enabled Tue Aug 6 14:24:23 2024 - [info] GTID ON Tue Aug 6 14:24:23 2024 - [info] 172.17.44.143(172.17.44.143:3307) Version=8.0.28 (oldest major version between slaves) log-bin:enabled Tue Aug 6 14:24:23 2024 - [info] GTID ON Tue Aug 6 14:24:23 2024 - [debug] Relay log info repository: TABLE Tue Aug 6 14:24:23 2024 - [info] Replicating from 172.17.44.45(172.17.44.45:3307) Tue Aug 6 14:24:23 2024 - [info] Primary candidate for the new Master (candidate_master is set) Tue Aug 6 14:24:23 2024 - [info] Non-candidate masters: Tue Aug 6 14:24:23 2024 - [info] 172.17.44.44(172.17.44.44:3307) Version=8.0.28 (oldest major version between slaves) log-bin:enabled Tue Aug 6 14:24:23 2024 - [info] GTID ON Tue Aug 6 14:24:23 2024 - [debug] Relay log info repository: TABLE Tue Aug 6 14:24:23 2024 - [info] Replicating from 172.17.44.45(172.17.44.45:3307) Tue Aug 6 14:24:23 2024 - [info] Not candidate for the new Master (no_master is set) Tue Aug 6 14:24:23 2024 - [info] Searching from candidate_master slaves which have received the latest relay log events.. Tue Aug 6 14:24:23 2024 - [info] From: 172.17.44.45(172.17.44.45:3307) (current master) +--172.17.44.143(172.17.44.143:3307) +--172.17.44.44(172.17.44.44:3307)
To: 172.17.44.143(172.17.44.143:3307) (new master) +--172.17.44.44(172.17.44.44:3307)
Starting master switch from 172.17.44.45(172.17.44.45:3307) to 172.17.44.143(172.17.44.143:3307)? (yes/NO): yes Tue Aug 6 14:24:33 2024 - [info] Checking whether 172.17.44.143(172.17.44.143:3307) is ok for the new master.. Tue Aug 6 14:24:33 2024 - [info] ok. Tue Aug 6 14:24:33 2024 - [info] ** Phase 1: Configuration Check Phase completed. Tue Aug 6 14:24:33 2024 - [info] Tue Aug 6 14:24:33 2024 - [debug] Disconnected from 172.17.44.45(172.17.44.45:3307) Tue Aug 6 14:24:33 2024 - [info] * Phase 2: Rejecting updates Phase.. Tue Aug 6 14:24:33 2024 - [info] Tue Aug 6 14:24:33 2024 - [info] Executing master ip online change script to disable write on the current master: Tue Aug 6 14:24:33 2024 - [info] /script/masterha/master_ip_online_change.3307 --command=stop --orig_master_host=172.17.44.45 --orig_master_ip=172.17.44.45 --orig_master_port=3307 --orig_master_user='mha_admin' --new_master_host=172.17.44.143 --new_master_ip=172.17.44.143 --new_master_port=3307 --new_master_user='mha_admin' --orig_master_ssh_user=root --new_master_ssh_user=root --orig_master_password=xxx --new_master_password=xxx Tue Aug 6 14:24:33 2024 787156 Set read_only on the new master.. ok. Tue Aug 6 14:24:33 2024 789413 Drpping app user on the orig master.. Tue Aug 6 14:24:33 2024 789689 Waiting all running 3 threads are disconnected.. (max 1500 milliseconds) {'Time' => '74826','db' => undef,'Id' => '5','User' => 'event_scheduler','State' => 'Waiting on empty queue','Command' => 'Daemon','Info' => undef,'Host' => 'localhost'} {'Time' => '73283','db' => undef,'Id' => '36','User' => 'rpl_slave','State' => 'Source has sent all binlog to replica; waiting for more updates','Command' => 'Binlog Dump GTID','Info' => undef,'Host' => '172.17.44.44:33741'} {'Time' => '73003','db' => undef,'Id' => '39','User' => 'rpl_slave','State' => 'Source has sent all binlog to replica; waiting for more updates','Command' => 'Binlog Dump GTID','Info' => undef,'Host' => '172.17.44.143:14468'} Tue Aug 6 14:24:34 2024 290549 Waiting all running 3 threads are disconnected.. (max 1000 milliseconds) {'Time' => '74826','db' => undef,'Id' => '5','User' => 'event_scheduler','State' => 'Waiting on empty queue','Command' => 'Daemon','Info' => undef,'Host' => 'localhost'} {'Time' => '73283','db' => undef,'Id' => '36','User' => 'rpl_slave','State' => 'Source has sent all binlog to replica; waiting for more updates','Command' => 'Binlog Dump GTID','Info' => undef,'Host' => '172.17.44.44:33741'} {'Time' => '73003','db' => undef,'Id' => '39','User' => 'rpl_slave','State' => 'Source has sent all binlog to replica; waiting for more updates','Command' => 'Binlog Dump GTID','Info' => undef,'Host' => '172.17.44.143:14468'} Tue Aug 6 14:24:34 2024 791097 Waiting all running 3 threads are disconnected.. (max 500 milliseconds) {'Time' => '74827','db' => undef,'Id' => '5','User' => 'event_scheduler','State' => 'Waiting on empty queue','Command' => 'Daemon','Info' => undef,'Host' => 'localhost'} {'Time' => '73284','db' => undef,'Id' => '36','User' => 'rpl_slave','State' => 'Source has sent all binlog to replica; waiting for more updates','Command' => 'Binlog Dump GTID','Info' => undef,'Host' => '172.17.44.44:33741'} {'Time' => '73004','db' => undef,'Id' => '39','User' => 'rpl_slave','State' => 'Source has sent all binlog to replica; waiting for more updates','Command' => 'Binlog Dump GTID','Info' => undef,'Host' => '172.17.44.143:14468'} Tue Aug 6 14:24:35 2024 291437 Set read_only=1 on the orig master.. ok. Tue Aug 6 14:24:35 2024 292411 Waiting all running 3 queries are disconnected.. (max 500 milliseconds) {'Time' => '74827','db' => undef,'Id' => '5','User' => 'event_scheduler','State' => 'Waiting on empty queue','Command' => 'Daemon','Info' => undef,'Host' => 'localhost'} {'Time' => '73284','db' => undef,'Id' => '36','User' => 'rpl_slave','State' => 'Source has sent all binlog to replica; waiting for more updates','Command' => 'Binlog Dump GTID','Info' => undef,'Host' => '172.17.44.44:33741'} {'Time' => '73004','db' => undef,'Id' => '39','User' => 'rpl_slave','State' => 'Source has sent all binlog to replica; waiting for more updates','Command' => 'Binlog Dump GTID','Info' => undef,'Host' => '172.17.44.143:14468'} disable the VIP on old master: 172.17.44.45 SIOCSIFNETMASK: Cannot assign requested address Tue Aug 6 14:24:36 2024 010051 Killing all application threads.. Tue Aug 6 14:24:36 2024 027935 done. Tue Aug 6 14:24:36 2024 - [info] ok. Tue Aug 6 14:24:36 2024 - [info] Locking all tables on the orig master to reject updates from everybody (including root): Tue Aug 6 14:24:36 2024 - [info] Executing FLUSH TABLES WITH READ LOCK.. Tue Aug 6 14:24:36 2024 - [info] ok. Tue Aug 6 14:24:36 2024 - [info] Orig master binlog:pos is mysql-bin-sunac_3307.000002:1261. Tue Aug 6 14:24:36 2024 - [debug] Fetching current slave status.. Tue Aug 6 14:24:36 2024 - [debug] Fetching current slave status done. Tue Aug 6 14:24:36 2024 - [info] Waiting to execute all relay logs on 172.17.44.143(172.17.44.143:3307).. Tue Aug 6 14:24:36 2024 - [info] master_pos_wait(mysql-bin-sunac_3307.000002:1261) completed on 172.17.44.143(172.17.44.143:3307). Executed 0 events. Tue Aug 6 14:24:36 2024 - [info] done. Tue Aug 6 14:24:36 2024 - [debug] Stopping SQL thread on 172.17.44.143(172.17.44.143:3307).. Tue Aug 6 14:24:36 2024 - [debug] done. Tue Aug 6 14:24:36 2024 - [info] Getting new master's binlog name and position.. Tue Aug 6 14:24:36 2024 - [info] mysql-bin-sunac_3307.000005:702 Tue Aug 6 14:24:36 2024 - [info] All other slaves should start replication from here. Statement should be: CHANGE MASTER TO MASTER_HOST='172.17.44.143', MASTER_PORT=3307, MASTER_AUTO_POSITION=1, MASTER_USER='rpl_slave', MASTER_PASSWORD='xxx'; Tue Aug 6 14:24:36 2024 - [info] Executing master ip online change script to allow write on the new master: Tue Aug 6 14:24:36 2024 - [info] /script/masterha/master_ip_online_change.3307 --command=start --orig_master_host=172.17.44.45 --orig_master_ip=172.17.44.45 --orig_master_port=3307 --orig_master_user='mha_admin' --new_master_host=172.17.44.143 --new_master_ip=172.17.44.143 --new_master_port=3307 --new_master_user='mha_admin' --orig_master_ssh_user=root --new_master_ssh_user=root --orig_master_password=xxx --new_master_password=xxx Tue Aug 6 14:24:36 2024 171859 Set read_only=0 on the new master. Tue Aug 6 14:24:36 2024 172383 Creating app user on the new master.. enable the VIP: 172.17.44.145/21 on the new master: 172.17.44.143 Tue Aug 6 14:24:36 2024 - [info] ok. Tue Aug 6 14:24:36 2024 - [info] Tue Aug 6 14:24:36 2024 - [info] * Switching slaves in parallel.. Tue Aug 6 14:24:36 2024 - [info] Tue Aug 6 14:24:36 2024 - [info] -- Slave switch on host 172.17.44.44(172.17.44.44:3307) started, pid: 9165 Tue Aug 6 14:24:36 2024 - [info] Tue Aug 6 14:24:37 2024 - [info] Log messages from 172.17.44.44 ... Tue Aug 6 14:24:37 2024 - [info] Tue Aug 6 14:24:36 2024 - [info] Waiting to execute all relay logs on 172.17.44.44(172.17.44.44:3307).. Tue Aug 6 14:24:36 2024 - [info] master_pos_wait(mysql-bin-sunac_3307.000002:1261) completed on 172.17.44.44(172.17.44.44:3307). Executed 0 events. Tue Aug 6 14:24:36 2024 - [info] done. Tue Aug 6 14:24:36 2024 - [debug] Stopping SQL thread on 172.17.44.44(172.17.44.44:3307).. Tue Aug 6 14:24:36 2024 - [debug] done. Tue Aug 6 14:24:36 2024 - [info] Resetting slave 172.17.44.44(172.17.44.44:3307) and starting replication from the new master 172.17.44.143(172.17.44.143:3307).. Tue Aug 6 14:24:36 2024 - [debug] Stopping slave IO/SQL thread on 172.17.44.44(172.17.44.44:3307).. Tue Aug 6 14:24:36 2024 - [debug] done. Tue Aug 6 14:24:36 2024 - [info] Executed CHANGE MASTER. Tue Aug 6 14:24:36 2024 - [debug] Starting slave IO/SQL thread on 172.17.44.44(172.17.44.44:3307).. Tue Aug 6 14:24:36 2024 - [debug] done. Tue Aug 6 14:24:36 2024 - [info] Slave started. Tue Aug 6 14:24:37 2024 - [info] End of log messages from 172.17.44.44 ... Tue Aug 6 14:24:37 2024 - [info] Tue Aug 6 14:24:37 2024 - [info] -- Slave switch on host 172.17.44.44(172.17.44.44:3307) succeeded. Tue Aug 6 14:24:37 2024 - [info] Unlocking all tables on the orig master: Tue Aug 6 14:24:37 2024 - [info] Executing UNLOCK TABLES.. Tue Aug 6 14:24:37 2024 - [info] ok. Tue Aug 6 14:24:37 2024 - [info] All new slave servers switched successfully. Tue Aug 6 14:24:37 2024 - [info] Tue Aug 6 14:24:37 2024 - [info] * Phase 5: New master cleanup phase.. Tue Aug 6 14:24:37 2024 - [info] Tue Aug 6 14:24:37 2024 - [debug] Clearing slave info.. Tue Aug 6 14:24:37 2024 - [debug] Stopping slave IO/SQL thread on 172.17.44.143(172.17.44.143:3307).. Tue Aug 6 14:24:37 2024 - [debug] done. Tue Aug 6 14:24:37 2024 - [debug] SHOW SLAVE STATUS shows new master does not replicate from anywhere. OK. Tue Aug 6 14:24:37 2024 - [info] 172.17.44.143: Resetting slave info succeeded. Tue Aug 6 14:24:37 2024 - [info] Switching master to 172.17.44.143(172.17.44.143:3307) completed successfully. Tue Aug 6 14:24:37 2024 - [debug] Disconnected from 172.17.44.45(172.17.44.45:3307) Tue Aug 6 14:24:37 2024 - [debug] Disconnected from 172.17.44.143(172.17.44.143:3307) Tue Aug 6 14:24:37 2024 - [debug] Disconnected from 172.17.44.44(172.17.44.44:3307) [root@wtj1vpztmysql04 ~]#
|