[root@mysql8-3 ~]# masterha_check_repl --conf=/etc/mha/mysql_mha.cnf
Mon Mar 7 11:04:32 2022 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Mon Mar 7 11:04:32 2022 - [info] Reading application default configuration from /etc/mha/mysql_mha.cnf..
Mon Mar 7 11:04:32 2022 - [info] Reading server configuration from /etc/mha/mysql_mha.cnf..
Mon Mar 7 11:04:32 2022 - [info] MHA::MasterMonitor version 0.58.
Mon Mar 7 11:04:33 2022 - [info] GTID failover mode = 0
Mon Mar 7 11:04:33 2022 - [info] Dead Servers:
Mon Mar 7 11:04:33 2022 - [info] Alive Servers:
Mon Mar 7 11:04:33 2022 - [info] 192.168.100.161(192.168.100.161:3306)
Mon Mar 7 11:04:33 2022 - [info] 192.168.100.162(192.168.100.162:3306)
Mon Mar 7 11:04:33 2022 - [info] 192.168.100.163(192.168.100.163:3306)
Mon Mar 7 11:04:33 2022 - [info] Alive Slaves:
Mon Mar 7 11:04:33 2022 - [info] 192.168.100.161(192.168.100.161:3306) Version=8.0.26 (oldest major version between slaves) log-bin:enabled
Mon Mar 7 11:04:33 2022 - [info] GTID ON
Mon Mar 7 11:04:33 2022 - [info] Replicating from 192.168.100.162(192.168.100.162:3306)
Mon Mar 7 11:04:33 2022 - [info] Primary candidate for the new Master (candidate_master is set)
Mon Mar 7 11:04:33 2022 - [info] 192.168.100.163(192.168.100.163:3306) Version=8.0.26 (oldest major version between slaves) log-bin:enabled
Mon Mar 7 11:04:33 2022 - [info] GTID ON
Mon Mar 7 11:04:33 2022 - [info] Replicating from 192.168.100.162(192.168.100.162:3306)
Mon Mar 7 11:04:33 2022 - [info] Not candidate for the new Master (no_master is set)
Mon Mar 7 11:04:33 2022 - [info] Current Alive Master: 192.168.100.162(192.168.100.162:3306)
Mon Mar 7 11:04:33 2022 - [info] Checking slave configurations..
Mon Mar 7 11:04:33 2022 - [info] read_only=1 is not set on slave 192.168.100.161(192.168.100.161:3306).
Mon Mar 7 11:04:33 2022 - [info] read_only=1 is not set on slave 192.168.100.163(192.168.100.163:3306).
Mon Mar 7 11:04:33 2022 - [info] Checking replication filtering settings..
Mon Mar 7 11:04:33 2022 - [info] binlog_do_db= , binlog_ignore_db=
Mon Mar 7 11:04:33 2022 - [info] Replication filtering check ok.
Mon Mar 7 11:04:33 2022 - [info] GTID (with auto-pos) is not supported
Mon Mar 7 11:04:33 2022 - [info] Starting SSH connection tests..
Mon Mar 7 11:04:37 2022 - [info] All SSH connection tests passed successfully.
Mon Mar 7 11:04:37 2022 - [info] Checking MHA Node version..
Mon Mar 7 11:04:39 2022 - [info] Version check ok.
Mon Mar 7 11:04:39 2022 - [info] Checking SSH publickey authentication settings on the current master..
Mon Mar 7 11:04:39 2022 - [info] HealthCheck: SSH to 192.168.100.162 is reachable.
Mon Mar 7 11:04:39 2022 - [info] Checking recovery script configurations on 192.168.100.162(192.168.100.162:3306)..
Mon Mar 7 11:04:39 2022 - [info] Executing command: save_binary_logs --command=test --start_pos=4 --binlog_dir=/data1/mysql8/data --output_file=/data1/mysql_mha/save_binary_logs_test --manager_version=0.58 --start_file=mysql-bin.000003
Mon Mar 7 11:04:39 2022 - [info] Connecting to root@192.168.100.162(192.168.100.162:22)..
Creating /data1/mysql_mha if not exists.. ok.
Checking output directory is accessible or not..
ok.
Binlog found at /data1/mysql8/data, up to mysql-bin.000003
Mon Mar 7 11:04:41 2022 - [info] Binlog setting check done.
Mon Mar 7 11:04:41 2022 - [info] Checking SSH publickey authentication and checking recovery script configurations on all alive slave servers..
Mon Mar 7 11:04:41 2022 - [info] Executing command : apply_diff_relay_logs --command=test --slave_user='mha' --slave_host=192.168.100.161 --slave_ip=192.168.100.161 --slave_port=3306 --workdir=/data1/mysql_mha --target_version=8.0.26 --manager_version=0.58 --relay_dir=/data1/mysql8/data --current_relay_log=relay_bin.000007 --slave_pass=xxx
Mon Mar 7 11:04:41 2022 - [info] Connecting to root@192.168.100.161(192.168.100.161:22)..
Can't exec "mysqlbinlog": 没有那个文件或目录 at /usr/share/perl5/vendor_perl/MHA/BinlogManager.pm line 106.
mysqlbinlog version command failed with rc 1:0, please verify PATH, LD_LIBRARY_PATH, and client options
at /usr/bin/apply_diff_relay_logs line 532.
Mon Mar 7 11:04:46 2022 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln208] Slaves settings check failed!
Mon Mar 7 11:04:46 2022 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln416] Slave configuration failed.
Mon Mar 7 11:04:46 2022 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln427] Error happened on checking configurations. at /usr/bin/masterha_check_repl line 48.
Mon Mar 7 11:04:46 2022 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln525] Error happened on monitoring servers.
Mon Mar 7 11:04:46 2022 - [info] Got exit code 1 (Not master dead).
MySQL Replication Health is NOT OK!
所有节点执行 ln -s binlog软链接
[root@mysql8-1 ~]# ln -s /usr/local/mysql8/bin/mysqlbinlog /usr/local/bin/mysqlbinlog
[root@mysql8-1 ~]# ln -s /usr/local/mysql8/bin/mysql /usr/local/bin/mysql
[root@mysql8-1 ~]# ll /usr/local/bin/mysql*
lrwxrwxrwx 1 root root 27 3月 7 11:25 /usr/local/bin/mysql -> /usr/local/mysql8/bin/mysql
lrwxrwxrwx 1 root root 33 3月 7 11:25 /usr/local/bin/mysqlbinlog -> /usr/local/mysql8/bin/mysqlbinlog
[root@mysql8-2 ~]# ln -s /usr/local/mysql8/bin/mysqlbinlog /usr/local/bin/mysqlbinlog
[root@mysql8-2 ~]# ln -s /usr/local/mysql8/bin/mysql /usr/local/bin/mysql
[root@mysql8-3 ~]# ln -s /usr/local/mysql8/bin/mysql /usr/local/bin/mysql
[root@mysql8-3 ~]# ln -s /usr/local/mysql8/bin/mysqlbinlog /usr/local/bin/mysqlbinlog
再次运行,就不报错了
[root@mysql8-3 ~]# masterha_check_repl --conf=/etc/mha/mysql_mha.cnf
Mon Mar 7 11:26:41 2022 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Mon Mar 7 11:26:41 2022 - [info] Reading application default configuration from /etc/mha/mysql_mha.cnf..
Mon Mar 7 11:26:41 2022 - [info] Reading server configuration from /etc/mha/mysql_mha.cnf..
Mon Mar 7 11:26:41 2022 - [info] MHA::MasterMonitor version 0.58.
Mon Mar 7 11:26:42 2022 - [info] GTID failover mode = 0
Mon Mar 7 11:26:42 2022 - [info] Dead Servers:
Mon Mar 7 11:26:42 2022 - [info] Alive Servers:
Mon Mar 7 11:26:42 2022 - [info] 192.168.100.161(192.168.100.161:3306)
Mon Mar 7 11:26:42 2022 - [info] 192.168.100.162(192.168.100.162:3306)
Mon Mar 7 11:26:42 2022 - [info] 192.168.100.163(192.168.100.163:3306)
Mon Mar 7 11:26:42 2022 - [info] Alive Slaves:
Mon Mar 7 11:26:42 2022 - [info] 192.168.100.161(192.168.100.161:3306) Version=8.0.26 (oldest major version between slaves) log-bin:enabled
Mon Mar 7 11:26:42 2022 - [info] GTID ON
Mon Mar 7 11:26:42 2022 - [info] Replicating from 192.168.100.162(192.168.100.162:3306)
Mon Mar 7 11:26:42 2022 - [info] Primary candidate for the new Master (candidate_master is set)
Mon Mar 7 11:26:42 2022 - [info] 192.168.100.163(192.168.100.163:3306) Version=8.0.26 (oldest major version between slaves) log-bin:enabled
Mon Mar 7 11:26:42 2022 - [info] GTID ON
Mon Mar 7 11:26:42 2022 - [info] Replicating from 192.168.100.162(192.168.100.162:3306)
Mon Mar 7 11:26:42 2022 - [info] Not candidate for the new Master (no_master is set)
Mon Mar 7 11:26:42 2022 - [info] Current Alive Master: 192.168.100.162(192.168.100.162:3306)
Mon Mar 7 11:26:42 2022 - [info] Checking slave configurations..
Mon Mar 7 11:26:42 2022 - [info] read_only=1 is not set on slave 192.168.100.161(192.168.100.161:3306).
Mon Mar 7 11:26:42 2022 - [info] read_only=1 is not set on slave 192.168.100.163(192.168.100.163:3306).
Mon Mar 7 11:26:42 2022 - [info] Checking replication filtering settings..
Mon Mar 7 11:26:42 2022 - [info] binlog_do_db= , binlog_ignore_db=
Mon Mar 7 11:26:42 2022 - [info] Replication filtering check ok.
Mon Mar 7 11:26:42 2022 - [info] GTID (with auto-pos) is not supported
Mon Mar 7 11:26:42 2022 - [info] Starting SSH connection tests..
Mon Mar 7 11:26:45 2022 - [info] All SSH connection tests passed successfully.
Mon Mar 7 11:26:45 2022 - [info] Checking MHA Node version..
Mon Mar 7 11:26:45 2022 - [info] Version check ok.
Mon Mar 7 11:26:45 2022 - [info] Checking SSH publickey authentication settings on the current master..
Mon Mar 7 11:26:46 2022 - [info] HealthCheck: SSH to 192.168.100.162 is reachable.
Mon Mar 7 11:26:46 2022 - [info] Checking recovery script configurations on 192.168.100.162(192.168.100.162:3306)..
Mon Mar 7 11:26:46 2022 - [info] Executing command: save_binary_logs --command=test --start_pos=4 --binlog_dir=/data1/mysql8/data --output_file=/data1/mysql_mha/save_binary_logs_test --manager_version=0.58 --start_file=mysql-bin.000003
Mon Mar 7 11:26:46 2022 - [info] Connecting to root@192.168.100.162(192.168.100.162:22)..
Creating /data1/mysql_mha if not exists.. ok.
Checking output directory is accessible or not..
ok.
Binlog found at /data1/mysql8/data, up to mysql-bin.000003
Mon Mar 7 11:26:46 2022 - [info] Binlog setting check done.
Mon Mar 7 11:26:46 2022 - [info] Checking SSH publickey authentication and checking recovery script configurations on all alive slave servers..
Mon Mar 7 11:26:46 2022 - [info] Executing command : apply_diff_relay_logs --command=test --slave_user='mha' --slave_host=192.168.100.161 --slave_ip=192.168.100.161 --slave_port=3306 --workdir=/data1/mysql_mha --target_version=8.0.26 --manager_version=0.58 --relay_dir=/data1/mysql8/data --current_relay_log=relay_bin.000007 --slave_pass=xxx
Mon Mar 7 11:26:46 2022 - [info] Connecting to root@192.168.100.161(192.168.100.161:22)..
Checking slave recovery environment settings..
Relay log found at /data1/mysql8/data, up to relay_bin.000007
Temporary relay log file is /data1/mysql8/data/relay_bin.000007
Checking if super_read_only is defined and turned on.. not present or turned off, ignoring.
Testing mysql connection and privileges..
mysql: [Warning] Using a password on the command line interface can be insecure.
done.
Testing mysqlbinlog output.. done.
Cleaning up test file(s).. done.
Mon Mar 7 11:26:47 2022 - [info] Executing command : apply_diff_relay_logs --command=test --slave_user='mha' --slave_host=192.168.100.163 --slave_ip=192.168.100.163 --slave_port=3306 --workdir=/data1/mysql_mha --target_version=8.0.26 --manager_version=0.58 --relay_dir=/data1/mysql8/data --current_relay_log=relay_bin.000002 --slave_pass=xxx
Mon Mar 7 11:26:47 2022 - [info] Connecting to root@192.168.100.163(192.168.100.163:22)..
Checking slave recovery environment settings..
Relay log found at /data1/mysql8/data, up to relay_bin.000002
Temporary relay log file is /data1/mysql8/data/relay_bin.000002
Checking if super_read_only is defined and turned on.. not present or turned off, ignoring.
Testing mysql connection and privileges..
mysql: [Warning] Using a password on the command line interface can be insecure.
done.
Testing mysqlbinlog output.. done.
Cleaning up test file(s).. done.
Mon Mar 7 11:26:47 2022 - [info] Slaves settings check done.
Mon Mar 7 11:26:47 2022 - [info]
192.168.100.162(192.168.100.162:3306) (current master)
+--192.168.100.161(192.168.100.161:3306)
+--192.168.100.163(192.168.100.163:3306)
Mon Mar 7 11:26:47 2022 - [info] Checking replication health on 192.168.100.161..
Mon Mar 7 11:26:47 2022 - [info] ok.
Mon Mar 7 11:26:47 2022 - [info] Checking replication health on 192.168.100.163..
Mon Mar 7 11:26:47 2022 - [info] ok.
Mon Mar 7 11:26:47 2022 - [info] Checking master_ip_failover_script status:
Mon Mar 7 11:26:47 2022 - [info] /data1/mysql_mha/master_ip_failover --command=status --ssh_user=root --orig_master_host=192.168.100.162 --orig_master_ip=192.168.100.162 --orig_master_port=3306
IN SCRIPT TEST====root|sudo /sbin/ifconfig ens192:1 down==root|sudo /sbin/ifconfig ens192:1 192.168.100.167/24===
Checking the Status of the script.. OK
Mon Mar 7 11:26:47 2022 - [info] OK.
Mon Mar 7 11:26:47 2022 - [warning] shutdown_script is not defined.
Mon Mar 7 11:26:47 2022 - [info] Got exit code 0 (Not master dead).
MySQL Replication Health is OK.
网友评论