MHA 自动切换步骤及过程剖析(4)

Disabling the VIP on old master: vdbsrv1
Mon Apr 20 14:30:22 2015 - [info]  done.
Mon Apr 20 14:30:22 2015 - [warning] shutdown_script is not set. Skipping explicit shutting down of the dead master.
Mon Apr 20 14:30:22 2015 - [info] * Phase 2: Dead Master Shutdown Phase completed.
Mon Apr 20 14:30:22 2015 - [info]
Mon Apr 20 14:30:22 2015 - [info] * Phase 3: Master Recovery Phase..
Mon Apr 20 14:30:22 2015 - [info]
Mon Apr 20 14:30:22 2015 - [info] * Phase 3.1: Getting Latest Slaves Phase..
Mon Apr 20 14:30:22 2015 - [info]
Mon Apr 20 14:30:22 2015 - [info] The latest binary log file/position on all slaves is mysql-bin.000020:315514388
Mon Apr 20 14:30:22 2015 - [info] Latest slaves (Slaves that received relay log files to the latest):
Mon Apr 20 14:30:22 2015 - [info]  vdbsrv2(192.168.1.7:3306)  Version=5.6.22-log (oldest major version between slaves) log-bin:enabled
Mon Apr 20 14:30:22 2015 - [info]    Replicating from 192.168.1.6(192.168.1.6:3306)
Mon Apr 20 14:30:22 2015 - [info] The oldest binary log file/position on all slaves is mysql-bin.000020:313962621
Mon Apr 20 14:30:22 2015 - [info] Oldest slaves:
Mon Apr 20 14:30:22 2015 - [info]  vdbsrv3(192.168.1.8:3306)  Version=5.6.22-log (oldest major version between slaves) log-bin:enabled
Mon Apr 20 14:30:22 2015 - [info]    Replicating from 192.168.1.6(192.168.1.6:3306)
Mon Apr 20 14:30:22 2015 - [info]
Mon Apr 20 14:30:22 2015 - [info] * Phase 3.2: Saving Dead Master's Binlog Phase..
Mon Apr 20 14:30:22 2015 - [info]
Mon Apr 20 14:30:23 2015 - [info] Fetching dead master's binary logs.. ###从dead master提取binlog
Mon Apr 20 14:30:23 2015 - [info] Executing command on the dead master vdbsrv1(192.168.1.6:3306): save_binary_logs --command=save
 --start_file=mysql-bin.000020  --start_pos=315514388 --binlog_dir=/data/mysqldata
 --output_file=/var/tmp/saved_master_binlog_from_vdbsrv1_3306_20150420143022.binlog --handle_raw_binlog=1 --disable_log_bin=0
 --manager_version=0.56
  Creating /var/tmp if not exists..    ok.
 Concat binary/relay logs from mysql-bin.000020 pos 315514388 to mysql-bin.000020 EOF into
  /var/tmp/saved_master_binlog_from_vdbsrv1_3306_20150420143022.binlog ..
 Binlog Checksum enabled
  Dumping binlog format description event, from position 0 to 120.. ok.
  Dumping effective binlog data from /data/mysqldata/mysql-bin.000020 position 315514388 to tail(315514411).. ok.
 Binlog Checksum enabled
 Concat succeeded.
Mon Apr 20 14:30:23 2015 - [info] scp from root@192.168.1.6:/var/tmp/saved_master_binlog_from_vdbsrv1_3306_20150420143022.binlog to
  local:/var/log/masterha/app1/saved_master_binlog_from_vdbsrv1_3306_20150420143022.binlog succeeded. ###复制dump的binlog到监控节点
Mon Apr 20 14:30:23 2015 - [info] HealthCheck: SSH to vdbsrv2 is reachable.
Mon Apr 20 14:30:24 2015 - [info] HealthCheck: SSH to vdbsrv3 is reachable.
Mon Apr 20 14:30:24 2015 - [info]
Mon Apr 20 14:30:24 2015 - [info] * Phase 3.3: Determining New Master Phase..
Mon Apr 20 14:30:24 2015 - [info]
Mon Apr 20 14:30:24 2015 - [info] Finding the latest slave that has all relay logs for recovering other slaves.. ###寻找最近的slave中继日志
Mon Apr 20 14:30:24 2015 - [info] Checking whether vdbsrv2 has relay logs from the oldest position..            ###用于恢复其他slave
Mon Apr 20 14:30:24 2015 - [info] Executing command: apply_diff_relay_logs --command=find --latest_mlf=mysql-bin.000020 --latest_rmlp=315514388
  --target_mlf=mysql-bin.000020 --target_rmlp=313962621 --server_id=1001 --workdir=/var/tmp --timestamp=20150420143022
  --manager_version=0.56 --relay_log_info=/data/mysqldata/relay-log.info  --relay_dir=/data/mysqldata/ 
    Opening /data/mysqldata/relay-log.info ... ok.
    Relay log found at /data/mysqldata, up to vdbsrv2-relay-bin.000003
 Fast relay log position search succeeded.
 Target relay log file/position found. start_file:vdbsrv2-relay-bin.000003, start_pos:6265486.
Target relay log FOUND!
Mon Apr 20 14:30:24 2015 - [info] OK. vdbsrv2 has all relay logs.
Mon Apr 20 14:30:24 2015 - [info] Searching new master from slaves..  ###寻找及决定新的master
Mon Apr 20 14:30:24 2015 - [info]  Candidate masters from the configuration file:
Mon Apr 20 14:30:24 2015 - [info]  Non-candidate masters:
Mon Apr 20 14:30:24 2015 - [info] New master is vdbsrv2(192.168.1.7:3306)
Mon Apr 20 14:30:24 2015 - [info] Starting master failover..          ###执行failover
Mon Apr 20 14:30:24 2015 - [info]
From:
vdbsrv1(192.168.1.6:3306) (current master)
 +--vdbsrv2(192.168.1.7:3306)
 +--vdbsrv3(192.168.1.8:3306)

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/502301d6cd73217d0993c1b5a960d444.html