➜ ~ mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql Installing MariaDB/MySQL system tables in '/var/lib/mysql' ... OK
To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system
Two all-privilege accounts were created. One is root@localhost, it has no password, but you need to be system 'root' user to connect. Use, for example, sudo mysql The second is mysql@localhost, it has no password either, but you need to be the system 'mysql' user to connect. After connecting you can set the password, if you would need to be able to connect as any of these users with a password and without sudo
See the MariaDB Knowledgebase at https://mariadb.com/kb or the MySQL manual for more instructions.
You can start the MariaDB daemon with: cd '/usr' ; /usr/bin/mysqld_safe --datadir='/var/lib/mysql'
You can test the MariaDB daemon with mysql-test-run.pl cd '/usr/mysql-test' ; perl mysql-test-run.pl
Please report any problems at https://mariadb.org/jira
The latest information about MariaDB is available at https://mariadb.org/. You can find additional information about the MySQL part at: https://dev.mysql.com Consider joining MariaDB's strong and vibrant community: https://mariadb.org/get-involved/
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and haven't set the root password yet, you should just press enter here.
Enter current password for root (enter for none): OK, successfully used password, moving on...
Setting the root password or using the unix_socket ensures that nobody can log into the MariaDB root user without the proper authorisation.
You already have your root account protected, so you can safely answer 'n'.
Switch to unix_socket authentication [Y/n] n ... skipping.
You already have your root account protected, so you can safely answer 'n'.
Change the root password? [Y/n] Y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment.
Remove anonymous users? [Y/n] Y ... Success!
Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] Y ... Success!
By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment.
Remove test database and access to it? [Y/n] Y - Dropping test database... ... Success! - Removing privileges on test database... ... Success!
Reloading the privilege tables will ensure that all changes made so far will take effect immediately.
Reload privilege tables now? [Y/n] Y ... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB installation should now be secure.
## 首先登录到MySQL MHA机器进行配置 # 生成密钥,所有选项回车确认即可。 ssh-keygen -t rsa -b 4096 # 将公钥发送到三台MySQL机器: ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.5.131 # MySQL Master ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.5.130 # MySQL Slave One ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.5.132 # MySQL Slave Two ## 然后登录到MySQL Master机器进行配置 # 生成密钥,同上。 ssh-keygen -t rsa -b 4096 # 将公钥发送到两台MySQL Slave机器: ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.5.130 # MySQL Slave One ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.5.132 # MySQL Slave Two ## 然后登录到MySQL Slave One机器进行配置 # 生成密钥,同上。 ssh-keygen -t rsa -b 4096 # 将公钥发送到MySQL Master和MySQL Slave Two机器: ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.5.131 # MySQL Master ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.5.132 # MySQL Slave Two ## 然后登录到MySQL Slave Two机器进行配置 # 生成密钥,同上。 ssh-keygen -t rsa -b 4096 # 将公钥发送到MySQL Master和MySQL Slave One机器,中途会要求输入这两台机器root用户的密码: ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.5.131 # MySQL Master ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.5.130 # MySQL Slave One
回到MySQL MHA机器,执行以下命令校验配置是否有误:
1 2 3 4
# 校验SSH,需要出现All SSH connection tests passed successfully代表成功。 masterha_check_ssh --conf=/etc/mha_default_app.cnf # 校验主从复制,需要出现MySQL Replication Health is OK代表成功。 masterha_check_repl --conf=/etc/mha_default_app.cnf
可能出现的错误
如果校验的时候遇到以下错误:
1
[error][/usr/share/perl5/site_perl/MHA/MasterMonitor.pm, ln427] Error happened on checking configurations. Redundant argument in sprintf at /usr/share/perl5/site_perl/MHA/NodeUtil.pm line 201.
# 修改如下,新增了两行,然后下一行sprintf方法内原有的$str更换为刚新增的$strmajor即可。 subparse_mysql_major_version($) { my $str = shift; $str =~ /(\d+)\.(\d+)/; my $strmajor = "$1.$2"; my $result = sprintf( '%03d%03d', $strmajor =~ m/(\d+)/g ); return $result; }
如果出现以下错误:
1
Checking if super_read_only is defined and turned on..DBD::mysql::st execute failed: Unknown system variable 'super_read_only' at /usr/share/perl5/site_perl/MHA/SlaveUtil.pm line 245.
➜ ~ tail -n 100 /var/log/masterha/default_app/default_app.log Fri Sep 11 10:07:31 2020 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping. Fri Sep 11 10:07:31 2020 - [info] Reading application default configuration from /etc/mha_default_app.cnf.. Fri Sep 11 10:07:31 2020 - [info] Reading server configuration from /etc/mha_default_app.cnf.. Fri Sep 11 10:07:31 2020 - [info] MHA::MasterMonitor version 0.58. Fri Sep 11 10:07:32 2020 - [info] GTID failover mode = 0 Fri Sep 11 10:07:32 2020 - [info] Dead Servers: Fri Sep 11 10:07:32 2020 - [info] Alive Servers: Fri Sep 11 10:07:32 2020 - [info] 192.168.5.131(192.168.5.131:3306) Fri Sep 11 10:07:32 2020 - [info] 192.168.5.130(192.168.5.130:3306) Fri Sep 11 10:07:32 2020 - [info] 192.168.5.132(192.168.5.132:3306) Fri Sep 11 10:07:32 2020 - [info] Alive Slaves: Fri Sep 11 10:07:32 2020 - [info] 192.168.5.130(192.168.5.130:3306) Version=10.5.5-MariaDB-log (oldest major version between slaves) log-bin:enabled Fri Sep 11 10:07:32 2020 - [info] Replicating from 192.168.5.131(192.168.5.131:3306) Fri Sep 11 10:07:32 2020 - [info] 192.168.5.132(192.168.5.132:3306) Version=10.5.5-MariaDB-log (oldest major version between slaves) log-bin:enabled Fri Sep 11 10:07:32 2020 - [info] Replicating from 192.168.5.131(192.168.5.131:3306) Fri Sep 11 10:07:32 2020 - [info] Current Alive Master: 192.168.5.131(192.168.5.131:3306) Fri Sep 11 10:07:32 2020 - [info] Checking slave configurations.. Fri Sep 11 10:07:32 2020 - [info] read_only=1 is not set on slave 192.168.5.130(192.168.5.130:3306). Fri Sep 11 10:07:32 2020 - [info] read_only=1 is not set on slave 192.168.5.132(192.168.5.132:3306). Fri Sep 11 10:07:32 2020 - [info] Checking replication filtering settings.. Fri Sep 11 10:07:32 2020 - [info] binlog_do_db= , binlog_ignore_db= Fri Sep 11 10:07:32 2020 - [info] Replication filtering check ok. Fri Sep 11 10:07:32 2020 - [info] GTID (with auto-pos) is not supported Fri Sep 11 10:07:32 2020 - [info] Starting SSH connection tests.. Fri Sep 11 10:07:35 2020 - [info] All SSH connection tests passed successfully. Fri Sep 11 10:07:35 2020 - [info] Checking MHA Node version.. Fri Sep 11 10:07:35 2020 - [info] Version check ok. Fri Sep 11 10:07:35 2020 - [info] Checking SSH publickey authentication settings on the current master.. Fri Sep 11 10:07:35 2020 - [info] HealthCheck: SSH to 192.168.5.131 is reachable. Fri Sep 11 10:07:36 2020 - [info] Master MHA Node version is 0.58. Fri Sep 11 10:07:36 2020 - [info] Checking recovery script configurations on 192.168.5.131(192.168.5.131:3306).. Fri Sep 11 10:07:36 2020 - [info] Executing command: save_binary_logs --command=test --start_pos=4 --binlog_dir=/var/lib/mysql,/var/log/mysql --output_file=/var/log/masterha/default_app/save_binary_logs_test --manager_version=0.58 --start_file=master1-bin.000008 Fri Sep 11 10:07:36 2020 - [info] Connecting to [email protected](192.168.5.131:22).. Creating /var/log/masterha/default_app if not exists.. ok. Checking output directory is accessible or not.. ok. Binlog found at /var/lib/mysql, up to master1-bin.000008 Fri Sep 11 10:07:36 2020 - [info] Binlog setting check done. Fri Sep 11 10:07:36 2020 - [info] Checking SSH publickey authentication and checking recovery script configurations on all alive slave servers.. Fri Sep 11 10:07:36 2020 - [info] Executing command : apply_diff_relay_logs --command=test --slave_user='mha_user' --slave_host=192.168.5.130 --slave_ip=192.168.5.130 --slave_port=3306 --workdir=/var/log/masterha/default_app --target_version=10.5.5-MariaDB-log --manager_version=0.58 --relay_log_info=/var/lib/mysql/relay-log.info --relay_dir=/var/lib/mysql/ --slave_pass=xxx Fri Sep 11 10:07:36 2020 - [info] Connecting to [email protected](192.168.5.130:22).. Checking slave recovery environment settings.. Opening /var/lib/mysql/relay-log.info ... ok. Relay log found at /var/lib/mysql, up to slave2-relay-bin.000008 Temporary relay log file is /var/lib/mysql/slave2-relay-bin.000008 Checking if super_read_only is defined and turned on.. not present or turned off, ignoring. Testing mysql connection and privileges.. done. Testing mysqlbinlog output.. done. Cleaning up test file(s).. done. Fri Sep 11 10:07:36 2020 - [info] Executing command : apply_diff_relay_logs --command=test --slave_user='mha_user' --slave_host=192.168.5.132 --slave_ip=192.168.5.132 --slave_port=3306 --workdir=/var/log/masterha/default_app --target_version=10.5.5-MariaDB-log --manager_version=0.58 --relay_log_info=/var/lib/mysql/relay-log.info --relay_dir=/var/lib/mysql/ --slave_pass=xxx Fri Sep 11 10:07:36 2020 - [info] Connecting to [email protected](192.168.5.132:22).. Checking slave recovery environment settings.. Opening /var/lib/mysql/relay-log.info ... ok. Relay log found at /var/lib/mysql, up to slave1-relay-bin.000008 Temporary relay log file is /var/lib/mysql/slave1-relay-bin.000008 Checking if super_read_only is defined and turned on.. not present or turned off, ignoring. Testing mysql connection and privileges.. done. Testing mysqlbinlog output.. done. Cleaning up test file(s).. done. Fri Sep 11 10:07:37 2020 - [info] Slaves settings check done. Fri Sep 11 10:07:37 2020 - [info] 192.168.5.131(192.168.5.131:3306) (current master) +--192.168.5.130(192.168.5.130:3306) +--192.168.5.132(192.168.5.132:3306)
Fri Sep 11 10:07:37 2020 - [warning] master_ip_failover_script is not defined. Fri Sep 11 10:07:37 2020 - [warning] shutdown_script is not defined. Fri Sep 11 10:07:37 2020 - [info] Set master ping interval 3 seconds. Fri Sep 11 10:07:37 2020 - [warning] secondary_check_script is not defined. It is highly recommended setting it to check master reachability from two or more routes. Fri Sep 11 10:07:37 2020 - [info] Starting ping health check on 192.168.5.131(192.168.5.131:3306).. Fri Sep 11 10:07:37 2020 - [info] Ping(SELECT) succeeded, waiting until MySQL doesn't respond.. ➜ ~
Fri Sep 11 11:57:45 2020 - [warning] Got error on MySQL select ping: 1927 (Connection was killed) Fri Sep 11 11:57:45 2020 - [info] Executing SSH check script: save_binary_logs --command=test --start_pos=4 --binlog_dir=/var/lib/mysql,/var/log/mysql --output_file=/var/log/masterha/default_app/save_binary_logs_test --manager_version=0.58 --binlog_prefix=master1-bin Fri Sep 11 11:57:45 2020 - [warning] HealthCheck: SSH to 192.168.5.131 is NOT reachable. Fri Sep 11 11:57:51 2020 - [warning] Got error on MySQL connect: 2002 (Can't connect to MySQL server on '192.168.5.131' (110)) Fri Sep 11 11:57:51 2020 - [warning] Connection failed 2 time(s).. Fri Sep 11 11:57:54 2020 - [warning] Got error on MySQL connect: 2002 (Can't connect to MySQL server on '192.168.5.131' (110)) Fri Sep 11 11:57:54 2020 - [warning] Connection failed 3 time(s).. Fri Sep 11 11:57:57 2020 - [warning] Got error on MySQL connect: 2002 (Can't connect to MySQL server on '192.168.5.131' (110)) Fri Sep 11 11:57:57 2020 - [warning] Connection failed 4 time(s).. Fri Sep 11 11:57:57 2020 - [warning] Master is not reachable from health checker! Fri Sep 11 11:57:57 2020 - [warning] Master 192.168.5.131(192.168.5.131:3306) is not reachable! Fri Sep 11 11:57:57 2020 - [warning] SSH is NOT reachable. Fri Sep 11 11:57:57 2020 - [info] Connecting to a master server failed. Reading configuration file /etc/masterha_default.cnf and /etc/mha_default_app.cnf again, and trying to connect to all servers to check server status.. Fri Sep 11 11:57:57 2020 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping. Fri Sep 11 11:57:57 2020 - [info] Reading application default configuration from /etc/mha_default_app.cnf.. Fri Sep 11 11:57:57 2020 - [info] Reading server configuration from /etc/mha_default_app.cnf.. Fri Sep 11 11:57:58 2020 - [info] GTID failover mode = 0 Fri Sep 11 11:57:58 2020 - [info] Dead Servers: Fri Sep 11 11:57:58 2020 - [info] 192.168.5.131(192.168.5.131:3306) Fri Sep 11 11:57:58 2020 - [info] Alive Servers: Fri Sep 11 11:57:58 2020 - [info] 192.168.5.130(192.168.5.130:3306) Fri Sep 11 11:57:58 2020 - [info] 192.168.5.132(192.168.5.132:3306) Fri Sep 11 11:57:58 2020 - [info] Alive Slaves: Fri Sep 11 11:57:58 2020 - [info] 192.168.5.130(192.168.5.130:3306) Version=10.5.5-MariaDB-log (oldest major version between slaves) log-bin:enabled Fri Sep 11 11:57:58 2020 - [info] Replicating from 192.168.5.131(192.168.5.131:3306) Fri Sep 11 11:57:58 2020 - [info] 192.168.5.132(192.168.5.132:3306) Version=10.5.5-MariaDB-log (oldest major version between slaves) log-bin:enabled Fri Sep 11 11:57:58 2020 - [info] Replicating from 192.168.5.131(192.168.5.131:3306) Fri Sep 11 11:57:58 2020 - [info] Checking slave configurations.. Fri Sep 11 11:57:58 2020 - [info] read_only=1 is not set on slave 192.168.5.130(192.168.5.130:3306). Fri Sep 11 11:57:58 2020 - [info] read_only=1 is not set on slave 192.168.5.132(192.168.5.132:3306). Fri Sep 11 11:57:58 2020 - [info] Checking replication filtering settings.. Fri Sep 11 11:57:58 2020 - [info] Replication filtering check ok. Fri Sep 11 11:57:58 2020 - [info] Master is down! Fri Sep 11 11:57:58 2020 - [info] Terminating monitoring script. Fri Sep 11 11:57:58 2020 - [info] Got exit code 20 (Master dead). Fri Sep 11 11:57:58 2020 - [info] MHA::MasterFailover version 0.58. Fri Sep 11 11:57:58 2020 - [info] Starting master failover. Fri Sep 11 11:57:58 2020 - [info] Fri Sep 11 11:57:58 2020 - [info] * Phase 1: Configuration Check Phase.. Fri Sep 11 11:57:58 2020 - [info] Fri Sep 11 11:57:59 2020 - [info] GTID failover mode = 0 Fri Sep 11 11:57:59 2020 - [info] Dead Servers: Fri Sep 11 11:57:59 2020 - [info] 192.168.5.131(192.168.5.131:3306) Fri Sep 11 11:57:59 2020 - [info] Checking master reachability via MySQL(double check)... Fri Sep 11 11:58:00 2020 - [info] ok. Fri Sep 11 11:58:00 2020 - [info] Alive Servers: Fri Sep 11 11:58:00 2020 - [info] 192.168.5.130(192.168.5.130:3306) Fri Sep 11 11:58:00 2020 - [info] 192.168.5.132(192.168.5.132:3306) Fri Sep 11 11:58:00 2020 - [info] Alive Slaves: Fri Sep 11 11:58:00 2020 - [info] 192.168.5.130(192.168.5.130:3306) Version=10.5.5-MariaDB-log (oldest major version between slaves) log-bin:enabled Fri Sep 11 11:58:00 2020 - [info] Replicating from 192.168.5.131(192.168.5.131:3306) Fri Sep 11 11:58:00 2020 - [info] 192.168.5.132(192.168.5.132:3306) Version=10.5.5-MariaDB-log (oldest major version between slaves) log-bin:enabled Fri Sep 11 11:58:00 2020 - [info] Replicating from 192.168.5.131(192.168.5.131:3306) Fri Sep 11 11:58:00 2020 - [info] Starting Non-GTID based failover. Fri Sep 11 11:58:00 2020 - [info] Fri Sep 11 11:58:00 2020 - [info] ** Phase 1: Configuration Check Phase completed. Fri Sep 11 11:58:00 2020 - [info] Fri Sep 11 11:58:00 2020 - [info] * Phase 2: Dead Master Shutdown Phase.. Fri Sep 11 11:58:00 2020 - [info] Fri Sep 11 11:58:00 2020 - [info] Forcing shutdown so that applications never connect to the current master.. Fri Sep 11 11:58:00 2020 - [warning] master_ip_failover_script is not set. Skipping invalidating dead master IP address. Fri Sep 11 11:58:00 2020 - [warning] shutdown_script is not set. Skipping explicit shutting down of the dead master. Fri Sep 11 11:58:01 2020 - [info] * Phase 2: Dead Master Shutdown Phase completed. Fri Sep 11 11:58:01 2020 - [info] Fri Sep 11 11:58:01 2020 - [info] * Phase 3: Master Recovery Phase.. Fri Sep 11 11:58:01 2020 - [info] Fri Sep 11 11:58:01 2020 - [info] * Phase 3.1: Getting Latest Slaves Phase.. Fri Sep 11 11:58:01 2020 - [info] Fri Sep 11 11:58:01 2020 - [info] The latest binary log file/position on all slaves is master1-bin.000001:1759 Fri Sep 11 11:58:01 2020 - [info] Latest slaves (Slaves that received relay log files to the latest): Fri Sep 11 11:58:01 2020 - [info] 192.168.5.130(192.168.5.130:3306) Version=10.5.5-MariaDB-log (oldest major version between slaves) log-bin:enabled Fri Sep 11 11:58:01 2020 - [info] Replicating from 192.168.5.131(192.168.5.131:3306) Fri Sep 11 11:58:01 2020 - [info] 192.168.5.132(192.168.5.132:3306) Version=10.5.5-MariaDB-log (oldest major version between slaves) log-bin:enabled Fri Sep 11 11:58:01 2020 - [info] Replicating from 192.168.5.131(192.168.5.131:3306) Fri Sep 11 11:58:01 2020 - [info] The oldest binary log file/position on all slaves is master1-bin.000001:1759 Fri Sep 11 11:58:01 2020 - [info] Oldest slaves: Fri Sep 11 11:58:01 2020 - [info] 192.168.5.130(192.168.5.130:3306) Version=10.5.5-MariaDB-log (oldest major version between slaves) log-bin:enabled Fri Sep 11 11:58:01 2020 - [info] Replicating from 192.168.5.131(192.168.5.131:3306) Fri Sep 11 11:58:01 2020 - [info] 192.168.5.132(192.168.5.132:3306) Version=10.5.5-MariaDB-log (oldest major version between slaves) log-bin:enabled Fri Sep 11 11:58:01 2020 - [info] Replicating from 192.168.5.131(192.168.5.131:3306) Fri Sep 11 11:58:01 2020 - [info] Fri Sep 11 11:58:01 2020 - [info] * Phase 3.2: Saving Dead Master's Binlog Phase.. Fri Sep 11 11:58:01 2020 - [info] Fri Sep 11 11:58:01 2020 - [warning] Dead Master is not SSH reachable. Could not save it's binlogs. Transactions that were not sent to the latest slave (Read_Master_Log_Pos to the tail of the dead master's binlog) were lost. Fri Sep 11 11:58:01 2020 - [info] Fri Sep 11 11:58:01 2020 - [info] * Phase 3.3: Determining New Master Phase.. Fri Sep 11 11:58:01 2020 - [info] Fri Sep 11 11:58:01 2020 - [info] Finding the latest slave that has all relay logs for recovering other slaves.. Fri Sep 11 11:58:01 2020 - [info] All slaves received relay logs to the same position. No need to resync each other. Fri Sep 11 11:58:01 2020 - [info] Searching new master from slaves.. Fri Sep 11 11:58:01 2020 - [info] Candidate masters from the configuration file: Fri Sep 11 11:58:01 2020 - [info] Non-candidate masters: Fri Sep 11 11:58:01 2020 - [info] New master is 192.168.5.130(192.168.5.130:3306) Fri Sep 11 11:58:01 2020 - [info] Starting master failover.. Fri Sep 11 11:58:01 2020 - [info] From: 192.168.5.131(192.168.5.131:3306) (current master) +--192.168.5.130(192.168.5.130:3306) +--192.168.5.132(192.168.5.132:3306)
To: 192.168.5.130(192.168.5.130:3306) (new master) +--192.168.5.132(192.168.5.132:3306) Fri Sep 11 11:58:01 2020 - [info] Fri Sep 11 11:58:01 2020 - [info] * Phase 3.4: New Master Diff Log Generation Phase.. Fri Sep 11 11:58:01 2020 - [info] Fri Sep 11 11:58:01 2020 - [info] This server has all relay logs. No need to generate diff files from the latest slave. Fri Sep 11 11:58:01 2020 - [info] Fri Sep 11 11:58:01 2020 - [info] * Phase 3.5: Master Log Apply Phase.. Fri Sep 11 11:58:01 2020 - [info] Fri Sep 11 11:58:01 2020 - [info] *NOTICE: If any error happens from this phase, manual recovery is needed. Fri Sep 11 11:58:01 2020 - [info] Starting recovery on 192.168.5.130(192.168.5.130:3306).. Fri Sep 11 11:58:01 2020 - [info] This server has all relay logs. Waiting all logs to be applied.. Fri Sep 11 11:58:01 2020 - [info] done. Fri Sep 11 11:58:01 2020 - [info] All relay logs were successfully applied. Fri Sep 11 11:58:01 2020 - [info] Getting new master's binlog name and position.. Fri Sep 11 11:58:01 2020 - [info] slave2-bin.000001:329 Fri Sep 11 11:58:01 2020 - [info] All other slaves should start replication from here. Statement should be: CHANGE MASTER TO MASTER_HOST='192.168.5.130', MASTER_PORT=3306, MASTER_LOG_FILE='slave2-bin.000001', MASTER_LOG_POS=329, MASTER_USER='replication_user', MASTER_PASSWORD='xxx'; Fri Sep 11 11:58:01 2020 - [warning] master_ip_failover_script is not set. Skipping taking over new master IP address. Fri Sep 11 11:58:01 2020 - [info] ** Finished master recovery successfully. Fri Sep 11 11:58:01 2020 - [info] * Phase 3: Master Recovery Phase completed. Fri Sep 11 11:58:01 2020 - [info] Fri Sep 11 11:58:01 2020 - [info] * Phase 4: Slaves Recovery Phase.. Fri Sep 11 11:58:01 2020 - [info] Fri Sep 11 11:58:01 2020 - [info] * Phase 4.1: Starting Parallel Slave Diff Log Generation Phase.. Fri Sep 11 11:58:01 2020 - [info] Fri Sep 11 11:58:01 2020 - [info] -- Slave diff file generation on host 192.168.5.132(192.168.5.132:3306) started, pid: 2345. Check tmp log /var/log/masterha/default_app/192.168.5.132_3306_20200911115758.log if it takes time.. Fri Sep 11 11:58:02 2020 - [info] Fri Sep 11 11:58:02 2020 - [info] Log messages from 192.168.5.132 ... Fri Sep 11 11:58:02 2020 - [info] Fri Sep 11 11:58:01 2020 - [info] This server has all relay logs. No need to generate diff files from the latest slave. Fri Sep 11 11:58:02 2020 - [info] End of log messages from 192.168.5.132. Fri Sep 11 11:58:02 2020 - [info] -- 192.168.5.132(192.168.5.132:3306) has the latest relay log events. Fri Sep 11 11:58:02 2020 - [info] Generating relay diff files from the latest slave succeeded. Fri Sep 11 11:58:02 2020 - [info] Fri Sep 11 11:58:02 2020 - [info] * Phase 4.2: Starting Parallel Slave Log Apply Phase.. Fri Sep 11 11:58:02 2020 - [info] Fri Sep 11 11:58:02 2020 - [info] -- Slave recovery on host 192.168.5.132(192.168.5.132:3306) started, pid: 2347. Check tmp log /var/log/masterha/default_app/192.168.5.132_3306_20200911115758.log if it takes time.. Fri Sep 11 11:58:03 2020 - [info] Fri Sep 11 11:58:03 2020 - [info] Log messages from 192.168.5.132 ... Fri Sep 11 11:58:03 2020 - [info] Fri Sep 11 11:58:02 2020 - [info] Starting recovery on 192.168.5.132(192.168.5.132:3306).. Fri Sep 11 11:58:02 2020 - [info] This server has all relay logs. Waiting all logs to be applied.. Fri Sep 11 11:58:02 2020 - [info] done. Fri Sep 11 11:58:02 2020 - [info] All relay logs were successfully applied. Fri Sep 11 11:58:02 2020 - [info] Resetting slave 192.168.5.132(192.168.5.132:3306) and starting replication from the new master 192.168.5.130(192.168.5.130:3306).. Fri Sep 11 11:58:02 2020 - [info] Executed CHANGE MASTER. Fri Sep 11 11:58:02 2020 - [info] Slave started. Fri Sep 11 11:58:03 2020 - [info] End of log messages from 192.168.5.132. Fri Sep 11 11:58:03 2020 - [info] -- Slave recovery on host 192.168.5.132(192.168.5.132:3306) succeeded. Fri Sep 11 11:58:03 2020 - [info] All new slave servers recovered successfully. Fri Sep 11 11:58:03 2020 - [info] Fri Sep 11 11:58:03 2020 - [info] * Phase 5: New master cleanup phase.. Fri Sep 11 11:58:03 2020 - [info] Fri Sep 11 11:58:03 2020 - [info] Resetting slave info on the new master.. Fri Sep 11 11:58:03 2020 - [info] 192.168.5.130: Resetting slave info succeeded. Fri Sep 11 11:58:03 2020 - [info] Master failover to 192.168.5.130(192.168.5.130:3306) completed successfully. Fri Sep 11 11:58:03 2020 - [info]
----- Failover Report -----
mha_default_app: MySQL Master failover 192.168.5.131(192.168.5.131:3306) to 192.168.5.130(192.168.5.130:3306) succeeded
Master 192.168.5.131(192.168.5.131:3306) is down!
Check MHA Manager logs at mysql-mha:/var/log/masterha/default_app/default_app.log for details.
Started automated(non-interactive) failover. The latest slave 192.168.5.130(192.168.5.130:3306) has all relay logs for recovery. Selected 192.168.5.130(192.168.5.130:3306) as a new master. 192.168.5.130(192.168.5.130:3306): OK: Applying all logs succeeded. 192.168.5.132(192.168.5.132:3306): This host has the latest relay log events. Generating relay diff files from the latest slave succeeded. 192.168.5.132(192.168.5.132:3306): OK: Applying all logs succeeded. Slave started, replicating from 192.168.5.130(192.168.5.130:3306) 192.168.5.130(192.168.5.130:3306): Resetting slave info succeeded. Master failover to 192.168.5.130(192.168.5.130:3306) completed successfully.