cwx 发表于 2018-9-26 13:54:26

Mysql5.5部署MHA-ylw6006

  # tail -f /masterha/app1/manager.log
  Wed Jun6 14:50:48 2012 -
  192.168.123.13 (current master)
  +--192.168.123.14
  Wed Jun6 14:50:48 2012 - master_ip_failover_script is not defined.
  Wed Jun6 14:50:48 2012 - shutdown_script is not defined.
  Wed Jun6 14:50:48 2012 - Set master ping interval 1 seconds.
  Wed Jun6 14:50:48 2012 - secondary_check_script is not defined. It is highly recommended setting it to check master reachability from two or more routes.
  Wed Jun6 14:50:48 2012 - Starting ping health check on 192.168.123.13(192.168.123.13:3306)..
  Wed Jun6 14:50:48 2012 - Ping succeeded, sleeping until it doesn't respond..
  Wed Jun6 14:51:32 2012 - Got error on MySQL ping: 2006 (MySQL server has gone away)
  Wed Jun6 14:51:32 2012 - HealthCheck: SSH to 192.168.123.13 is reachable.
  Wed Jun6 14:51:33 2012 - Got error on MySQL connect: 2013 (Lost connection to MySQL server at 'reading initial communication packet', system error: 111)
  Wed Jun6 14:51:33 2012 - Connection failed 1 time(s)..
  Wed Jun6 14:51:34 2012 - Got error on MySQL connect: 2013 (Lost connection to MySQL server at 'reading initial communication packet', system error: 111)
  Wed Jun6 14:51:34 2012 - Connection failed 2 time(s)..
  Wed Jun6 14:51:35 2012 - Got error on MySQL connect: 2013 (Lost connection to MySQL server at 'reading initial communication packet', system error: 111)
  Wed Jun6 14:51:35 2012 - Connection failed 3 time(s)..
  Wed Jun6 14:51:35 2012 - Master is not reachable from health checker!
  Wed Jun6 14:51:35 2012 - Master 192.168.123.13(192.168.123.13:3306) is not reachable!
  Wed Jun6 14:51:35 2012 - SSH is reachable.
  Wed Jun6 14:51:35 2012 - Connecting to a master server failed. Reading configuration file /etc/masterha_default.cnf and /etc/masterha/app1.cnf again, and trying to connect to all servers to check server status..
  Wed Jun6 14:51:35 2012 - Global configuration file /etc/masterha_default.cnf not found. Skipping.
  Wed Jun6 14:51:35 2012 - Reading application default configurations from /etc/masterha/app1.cnf..
  Wed Jun6 14:51:35 2012 - Reading server configurations from /etc/masterha/app1.cnf..
  Wed Jun6 14:51:35 2012 - Dead Servers:
  Wed Jun6 14:51:35 2012 -    192.168.123.13(192.168.123.13:3306)
  Wed Jun6 14:51:35 2012 - Alive Servers:
  Wed Jun6 14:51:35 2012 -    192.168.123.14(192.168.123.14:3306)
  Wed Jun6 14:51:35 2012 - Alive Slaves:
  Wed Jun6 14:51:35 2012 -    192.168.123.14(192.168.123.14:3306)Version=5.5.25-log (oldest major version between slaves) log-bin:enabled
  Wed Jun6 14:51:35 2012 -    Replicating from 192.168.123.13(192.168.123.13:3306)
  Wed Jun6 14:51:35 2012 -    Primary candidate for the new Master (candidate_master is set)
  Wed Jun6 14:51:35 2012 - Checking slave configurations..
  Wed Jun6 14:51:35 2012 - read_only=1 is not set on slave 192.168.123.14(192.168.123.14:3306).

  Wed Jun6 14:51:35 2012 - >  Wed Jun6 14:51:35 2012 - Checking replication filtering settings..
  Wed Jun6 14:51:35 2012 - Replication filtering check ok.
  Wed Jun6 14:51:35 2012 - Master is down!
  Wed Jun6 14:51:35 2012 - Terminating monitoring script.
  Wed Jun6 14:51:35 2012 - Got exit code 20 (Master dead).
  Wed Jun6 14:51:35 2012 - MHA::MasterFailover version 0.52.
  Wed Jun6 14:51:35 2012 - Starting master failover.
  Wed Jun6 14:51:35 2012 -
  Wed Jun6 14:51:35 2012 - * Phase 1: Configuration Check Phase..
  Wed Jun6 14:51:35 2012 -
  Wed Jun6 14:51:35 2012 - Dead Servers:
  Wed Jun6 14:51:35 2012 -    192.168.123.13(192.168.123.13:3306)
  Wed Jun6 14:51:35 2012 - Checking master reachability via mysql(double check)..
  Wed Jun6 14:51:35 2012 - ok.
  Wed Jun6 14:51:35 2012 - Alive Servers:
  Wed Jun6 14:51:35 2012 -    192.168.123.14(192.168.123.14:3306)
  Wed Jun6 14:51:35 2012 - Alive Slaves:
  Wed Jun6 14:51:35 2012 -    192.168.123.14(192.168.123.14:3306)Version=5.5.25-log (oldest major version between slaves) log-bin:enabled
  Wed Jun6 14:51:35 2012 -    Replicating from 192.168.123.13(192.168.123.13:3306)
  Wed Jun6 14:51:35 2012 -    Primary candidate for the new Master (candidate_master is set)
  Wed Jun6 14:51:35 2012 - ** Phase 1: Configuration Check Phase completed.
  Wed Jun6 14:51:35 2012 -
  Wed Jun6 14:51:35 2012 - * Phase 2: Dead Master Shutdown Phase..
  Wed Jun6 14:51:35 2012 -
  Wed Jun6 14:51:35 2012 - Forcing shutdown so that applications never connect to the current master..
  Wed Jun6 14:51:35 2012 - master_ip_failover_script is not set. Skipping invalidating dead master ip address.
  Wed Jun6 14:51:35 2012 - shutdown_script is not set. Skipping explicit shutting down of the dead master.
  Wed Jun6 14:51:35 2012 - * Phase 2: Dead Master Shutdown Phase completed.
  Wed Jun6 14:51:35 2012 -
  Wed Jun6 14:51:35 2012 - * Phase 3: Master Recovery Phase..
  Wed Jun6 14:51:35 2012 -
  Wed Jun6 14:51:35 2012 - * Phase 3.1: Getting Latest Slaves Phase..
  Wed Jun6 14:51:35 2012 -
  Wed Jun6 14:51:35 2012 - The latest binary log file/position on all slaves is mysql-bin.000021:107

  Wed Jun6 14:51:35 2012 - Latest slaves (Slaves that received>  Wed Jun6 14:51:35 2012 -    192.168.123.14(192.168.123.14:3306)Version=5.5.25-log (oldest major version between slaves) log-bin:enabled
  Wed Jun6 14:51:35 2012 -    Replicating from 192.168.123.13(192.168.123.13:3306)
  Wed Jun6 14:51:35 2012 -    Primary candidate for the new Master (candidate_master is set)
  Wed Jun6 14:51:35 2012 - The oldest binary log file/position on all slaves is mysql-bin.000021:107
  Wed Jun6 14:51:35 2012 - Oldest slaves:
  Wed Jun6 14:51:35 2012 -    192.168.123.14(192.168.123.14:3306)Version=5.5.25-log (oldest major version between slaves) log-bin:enabled
  Wed Jun6 14:51:35 2012 -    Replicating from 192.168.123.13(192.168.123.13:3306)
  Wed Jun6 14:51:35 2012 -    Primary candidate for the new Master (candidate_master is set)
  Wed Jun6 14:51:35 2012 -
  Wed Jun6 14:51:35 2012 - * Phase 3.2: Saving Dead Master's Binlog Phase..
  Wed Jun6 14:51:35 2012 -
  Wed Jun6 14:51:35 2012 - Fetching dead master's binary logs..
  Wed Jun6 14:51:35 2012 - Executing command on the dead master 192.168.123.13(192.168.123.13:3306): save_binary_logs --command=save --start_file=mysql-bin.000021--start_pos=107 --binlog_dir=/mydata --output_file=/var/tmp/saved_master_binlog_from_192.168.123.13_3306_20120606145135.binlog --handle_raw_binlog=1 --disable_log_bin=0 --manager_version=0.52
  Creating /var/tmp if not exists..    ok.
  Concat binary/relay logs from mysql-bin.000021 pos 107 to mysql-bin.000021 EOF into /var/tmp/saved_master_binlog_from_192.168.123.13_3306_20120606145135.binlog ..
  Dumping binlog format description event, from position 0 to 107.. ok.
  Dumping effective binlog data from /mydata/mysql-bin.000021 position 107 to tail(126).. ok.
  Concat succeeded.
  Wed Jun6 14:51:36 2012 - scp from root@192.168.123.13:/var/tmp/saved_master_binlog_from_192.168.123.13_3306_20120606145135.binlog to local:/masterha/app1/saved_master_binlog_from_192.168.123.13_3306_20120606145135.binlog succeeded.
  Wed Jun6 14:51:36 2012 - HealthCheck: SSH to 192.168.123.14 is reachable.
  Wed Jun6 14:51:37 2012 -
  Wed Jun6 14:51:37 2012 - * Phase 3.3: Determining New Master Phase..
  Wed Jun6 14:51:37 2012 -

  Wed Jun6 14:51:37 2012 - Finding the latest slave that has all>
  Wed Jun6 14:51:37 2012 - All slaves received>  Wed Jun6 14:51:37 2012 - Searching new master from slaves..
  Wed Jun6 14:51:37 2012 - Candidate masters from the configuration file:
  Wed Jun6 14:51:37 2012 -    192.168.123.14(192.168.123.14:3306)Version=5.5.25-log (oldest major version between slaves) log-bin:enabled
  Wed Jun6 14:51:37 2012 -    Replicating from 192.168.123.13(192.168.123.13:3306)
  Wed Jun6 14:51:37 2012 -    Primary candidate for the new Master (candidate_master is set)
  Wed Jun6 14:51:37 2012 - Non-candidate masters:

  Wed Jun6 14:51:37 2012 - Searching from candidate_master slaves which have received the latest>  Wed Jun6 14:51:37 2012 - New master is 192.168.123.14(192.168.123.14:3306)
  Wed Jun6 14:51:37 2012 - Starting master failover..
  Wed Jun6 14:51:37 2012 -
  From:
  192.168.123.13 (current master)
  +--192.168.123.14
  To:
  192.168.123.14 (new master)
  Wed Jun6 14:51:37 2012 -
  Wed Jun6 14:51:37 2012 - * Phase 3.3: New Master Diff Log Generation Phase..
  Wed Jun6 14:51:37 2012 -

  Wed Jun6 14:51:37 2012 - This server has all>  Wed Jun6 14:51:37 2012 - Sending binlog..
  Wed Jun6 14:51:37 2012 - scp from local:/masterha/app1/saved_master_binlog_from_192.168.123.13_3306_20120606145135.binlog to root@192.168.123.14:/var/tmp/saved_master_binlog_from_192.168.123.13_3306_20120606145135.binlog succeeded.
  Wed Jun6 14:51:37 2012 -
  Wed Jun6 14:51:37 2012 - * Phase 3.4: Master Log Apply Phase..
  Wed Jun6 14:51:37 2012 -
  Wed Jun6 14:51:37 2012 - *NOTICE: If any error happens from this phase, manual recovery is needed.
  Wed Jun6 14:51:37 2012 - Starting recovery on 192.168.123.14(192.168.123.14:3306)..
  Wed Jun6 14:51:37 2012 - Generating diffs succeeded.

  Wed Jun6 14:51:37 2012 - Waiting until all>  Wed Jun6 14:51:37 2012 - done.
  Wed Jun6 14:51:37 2012 - Getting slave status..
  Wed Jun6 14:51:37 2012 - This slave(192.168.123.14)'s Exec_Master_Log_Pos equals to Read_Master_Log_Pos(mysql-bin.000021:107). No need to recover from Exec_Master_Log_Pos.
  Wed Jun6 14:51:37 2012 - Connecting to the target slave host 192.168.123.14, running recover script..
  Wed Jun6 14:51:37 2012 - Executing command: apply_diff_relay_logs --command=apply --slave_user=root --slave_host=192.168.123.14 --slave_ip=192.168.123.14--slave_port=3306 --apply_files=/var/tmp/saved_master_binlog_from_192.168.123.13_3306_20120606145135.binlog --workdir=/var/tmp --target_version=5.5.25-log --timestamp=20120606145135 --handle_raw_binlog=1 --disable_log_bin=0 --manager_version=0.52 --slave_pass=xxx
  Wed Jun6 14:51:37 2012 -
  Applying differential binary/relay log files /var/tmp/saved_master_binlog_from_192.168.123.13_3306_20120606145135.binlog on 192.168.123.14:3306. This may take long time...
  Applying log files succeeded.

  Wed Jun6 14:51:37 2012 - All>  Wed Jun6 14:51:37 2012 - Getting new master's binlog name and position..
  Wed Jun6 14:51:37 2012 - mysql-bin.000023:107
  Wed Jun6 14:51:37 2012 - All other slaves should start replication from here. Statement should be: CHANGE MASTER TO MASTER_HOST='192.168.123.14', MASTER_PORT=3306, MASTER_LOG_FILE='mysql-bin.000023', MASTER_LOG_POS=107, MASTER_USER='r_test', MASTER_PASSWORD='xxx';
  Wed Jun6 14:51:37 2012 - master_ip_failover_script is not set. Skipping taking over new master ip address.
  Wed Jun6 14:51:37 2012 - ** Finished master recovery successfully.
  Wed Jun6 14:51:37 2012 - * Phase 3: Master Recovery Phase completed.
  Wed Jun6 14:51:37 2012 -
  Wed Jun6 14:51:37 2012 - * Phase 4: Slaves Recovery Phase..
  Wed Jun6 14:51:37 2012 -
  Wed Jun6 14:51:37 2012 - * Phase 4.1: Starting Parallel Slave Diff Log Generation Phase..
  Wed Jun6 14:51:37 2012 -

  Wed Jun6 14:51:37 2012 - Generating>  Wed Jun6 14:51:37 2012 -
  Wed Jun6 14:51:37 2012 - * Phase 4.2: Starting Parallel Slave Log Apply Phase..
  Wed Jun6 14:51:37 2012 -
  Wed Jun6 14:51:37 2012 - All new slave servers recovered successfully.
  Wed Jun6 14:51:37 2012 -
  Wed Jun6 14:51:37 2012 - * Phase 5: New master cleanup phease..
  Wed Jun6 14:51:37 2012 -
  Wed Jun6 14:51:37 2012 - Resetting slave info on the new master..
  Wed Jun6 14:51:37 2012 - Master failover to 192.168.123.14(192.168.123.14:3306) completed successfully.
  Wed Jun6 14:51:37 2012 -
  ----- Failover Report -----
  app1: MySQL Master failover 192.168.123.13 to 192.168.123.14 succeeded
  Master 192.168.123.13 is down!
  Check MHA Manager logs at dg55.yang.com:/masterha/app1/manager.log for details.
  Started automated(non-interactive) failover.

  The latest slave 192.168.123.14(192.168.123.14:3306) has all>  Selected 192.168.123.14 as a new master.
  192.168.123.14: OK: Applying all logs succeeded.

  Generating>  192.168.123.14: Resetting slave info succeeded.
  Master failover to 192.168.123.14(192.168.123.14:3306) completed successfully.

Mu生生 发表于 2018-9-26 14:38:30

5.5的版本,是不是很经典啊
页: [1]
查看完整版本: Mysql5.5部署MHA-ylw6006