故障集,持续更新
2021/9/7 6:06:11
本文主要是介绍故障集,持续更新,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
目录- 1. MHA测试报错
- (1)报错情况
- (2)报错原因
- (3)如何解决
1. MHA测试报错
(1)报错情况
masterha_check_repl -conf=/etc/masterha/app1.cnf报错,显示如下
[root@manager scripts]# masterha_check_repl -conf=/etc/masterha/app1.cnf Tue Sep 7 02:59:56 2021 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping. Tue Sep 7 02:59:56 2021 - [info] Reading application default configuration from /etc/masterha/app1.cnf.. Tue Sep 7 02:59:56 2021 - [info] Reading server configuration from /etc/masterha/app1.cnf.. Tue Sep 7 02:59:56 2021 - [info] MHA::MasterMonitor version 0.57. Tue Sep 7 02:59:57 2021 - [info] GTID failover mode = 0 Tue Sep 7 02:59:57 2021 - [info] Dead Servers: Tue Sep 7 02:59:57 2021 - [info] Alive Servers: Tue Sep 7 02:59:57 2021 - [info] 192.168.122.10(192.168.122.10:3306) Tue Sep 7 02:59:57 2021 - [info] 192.168.122.11(192.168.122.11:3306) Tue Sep 7 02:59:57 2021 - [info] 192.168.122.12(192.168.122.12:3306) Tue Sep 7 02:59:57 2021 - [info] Alive Slaves: Tue Sep 7 02:59:57 2021 - [info] 192.168.122.11(192.168.122.11:3306) Version=5.7.17-log (oldest major version between slaves) log-bin:enabled Tue Sep 7 02:59:57 2021 - [info] Replicating from 192.168.122.10(192.168.122.10:3306) Tue Sep 7 02:59:57 2021 - [info] Primary candidate for the new Master (candidate_master is set) Tue Sep 7 02:59:57 2021 - [info] 192.168.122.12(192.168.122.12:3306) Version=5.7.17-log (oldest major version between slaves) log-bin:enabled Tue Sep 7 02:59:57 2021 - [info] Replicating from 192.168.122.10(192.168.122.10:3306) Tue Sep 7 02:59:57 2021 - [info] Current Alive Master: 192.168.122.10(192.168.122.10:3306) Tue Sep 7 02:59:57 2021 - [info] Checking slave configurations.. Tue Sep 7 02:59:57 2021 - [warning] relay_log_purge=0 is not set on slave 192.168.122.11(192.168.122.11:3306). Tue Sep 7 02:59:57 2021 - [warning] relay_log_purge=0 is not set on slave 192.168.122.12(192.168.122.12:3306). Tue Sep 7 02:59:57 2021 - [info] Checking replication filtering settings.. Tue Sep 7 02:59:57 2021 - [info] binlog_do_db= , binlog_ignore_db= Tue Sep 7 02:59:57 2021 - [info] Replication filtering check ok. Tue Sep 7 02:59:57 2021 - [info] GTID (with auto-pos) is not supported Tue Sep 7 02:59:57 2021 - [info] Starting SSH connection tests.. Tue Sep 7 03:00:00 2021 - [info] All SSH connection tests passed successfully. Tue Sep 7 03:00:00 2021 - [info] Checking MHA Node version.. Tue Sep 7 03:00:00 2021 - [info] Version check ok. Tue Sep 7 03:00:00 2021 - [info] Checking SSH publickey authentication settings on the current master.. Tue Sep 7 03:00:00 2021 - [info] HealthCheck: SSH to 192.168.122.10 is reachable. Tue Sep 7 03:00:00 2021 - [info] Master MHA Node version is 0.57. Tue Sep 7 03:00:00 2021 - [info] Checking recovery script configurations on 192.168.122.10(192.168.122.10:3306).. Tue Sep 7 03:00:00 2021 - [info] Executing command: save_binary_logs --command=test --start_pos=4 --binlog_dir=/usr/local/mysql/data --output_file=/tmp/save_binary_logs_test --manager_version=0.57 --start_file=master-bin.000001 Tue Sep 7 03:00:00 2021 - [info] Connecting to root@192.168.122.10(192.168.122.10:22).. Creating /tmp if not exists.. ok. Checking output directory is accessible or not.. ok. Binlog found at /usr/local/mysql/data, up to master-bin.000001 Tue Sep 7 03:00:00 2021 - [info] Binlog setting check done. Tue Sep 7 03:00:00 2021 - [info] Checking SSH publickey authentication and checking recovery script configurations on all alive slave servers.. Tue Sep 7 03:00:00 2021 - [info] Executing command : apply_diff_relay_logs --command=test --slave_user='mha' --slave_host=192.168.122.11 --slave_ip=192.168.122.11 --slave_port=3306 --workdir=/tmp --target_version=5.7.17-log --manager_version=0.57 --relay_log_info=/usr/local/mysql/data/relay-log.info --relay_dir=/usr/local/mysql/data/ --slave_pass=xxx Tue Sep 7 03:00:00 2021 - [info] Connecting to root@192.168.122.11(192.168.122.11:22).. mysqlbinlog: [ERROR] unknown variable 'default-character-set=utf8' mysqlbinlog version command failed with rc 7:0, please verify PATH, LD_LIBRARY_PATH, and client options at /usr/local/bin/apply_diff_relay_logs line 493. Tue Sep 7 03:00:01 2021 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln208] Slaves settings check failed! Tue Sep 7 03:00:01 2021 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln416] Slave configuration failed. Tue Sep 7 03:00:01 2021 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln427] Error happened on checking configurations. at /usr/local/bin/masterha_check_repl line 48. Tue Sep 7 03:00:01 2021 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln525] Error happened on monitoring servers. Tue Sep 7 03:00:01 2021 - [info] Got exit code 1 (Not master dead). MySQL Replication Health is NOT OK!
(2)报错原因
锁定报错原因为:[ERROR] unknown variable 'default-character-set=utf8'@192.168.122.11
(3)如何解决
前往192.168.122.11主机(以及同配置的其他slave主机)的/etc/my.cnf删除错误配置并重启mysql服务即可
[root@manager scripts]# masterha_check_repl -conf=/etc/masterha/app1.cnf Tue Sep 7 03:10:16 2021 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping. Tue Sep 7 03:10:16 2021 - [info] Reading application default configuration from /etc/masterha/app1.cnf.. Tue Sep 7 03:10:16 2021 - [info] Reading server configuration from /etc/masterha/app1.cnf.. Tue Sep 7 03:10:16 2021 - [info] MHA::MasterMonitor version 0.57. Tue Sep 7 03:10:17 2021 - [info] GTID failover mode = 0 Tue Sep 7 03:10:17 2021 - [info] Dead Servers: Tue Sep 7 03:10:17 2021 - [info] Alive Servers: Tue Sep 7 03:10:17 2021 - [info] 192.168.122.10(192.168.122.10:3306) Tue Sep 7 03:10:17 2021 - [info] 192.168.122.11(192.168.122.11:3306) Tue Sep 7 03:10:17 2021 - [info] 192.168.122.12(192.168.122.12:3306) Tue Sep 7 03:10:17 2021 - [info] Alive Slaves: Tue Sep 7 03:10:17 2021 - [info] 192.168.122.11(192.168.122.11:3306) Version=5.7.17-log (oldest major version between slaves) log-bin:enabled Tue Sep 7 03:10:17 2021 - [info] Replicating from 192.168.122.10(192.168.122.10:3306) Tue Sep 7 03:10:17 2021 - [info] Primary candidate for the new Master (candidate_master is set) Tue Sep 7 03:10:17 2021 - [info] 192.168.122.12(192.168.122.12:3306) Version=5.7.17-log (oldest major version between slaves) log-bin:enabled Tue Sep 7 03:10:17 2021 - [info] Replicating from 192.168.122.10(192.168.122.10:3306) Tue Sep 7 03:10:17 2021 - [info] Current Alive Master: 192.168.122.10(192.168.122.10:3306) Tue Sep 7 03:10:17 2021 - [info] Checking slave configurations.. Tue Sep 7 03:10:17 2021 - [info] read_only=1 is not set on slave 192.168.122.11(192.168.122.11:3306). Tue Sep 7 03:10:17 2021 - [warning] relay_log_purge=0 is not set on slave 192.168.122.11(192.168.122.11:3306). Tue Sep 7 03:10:17 2021 - [info] read_only=1 is not set on slave 192.168.122.12(192.168.122.12:3306). Tue Sep 7 03:10:17 2021 - [warning] relay_log_purge=0 is not set on slave 192.168.122.12(192.168.122.12:3306). Tue Sep 7 03:10:17 2021 - [info] Checking replication filtering settings.. Tue Sep 7 03:10:17 2021 - [info] binlog_do_db= , binlog_ignore_db= Tue Sep 7 03:10:17 2021 - [info] Replication filtering check ok. Tue Sep 7 03:10:17 2021 - [info] GTID (with auto-pos) is not supported Tue Sep 7 03:10:17 2021 - [info] Starting SSH connection tests.. Tue Sep 7 03:10:20 2021 - [info] All SSH connection tests passed successfully. Tue Sep 7 03:10:20 2021 - [info] Checking MHA Node version.. Tue Sep 7 03:10:20 2021 - [info] Version check ok. Tue Sep 7 03:10:20 2021 - [info] Checking SSH publickey authentication settings on the current master.. Tue Sep 7 03:10:20 2021 - [info] HealthCheck: SSH to 192.168.122.10 is reachable. Tue Sep 7 03:10:20 2021 - [info] Master MHA Node version is 0.57. Tue Sep 7 03:10:20 2021 - [info] Checking recovery script configurations on 192.168.122.10(192.168.122.10:3306).. Tue Sep 7 03:10:20 2021 - [info] Executing command: save_binary_logs --command=test --start_pos=4 --binlog_dir=/usr/local/mysql/data --output_file=/tmp/save_binary_logs_test --manager_version=0.57 --start_file=master-bin.000001 Tue Sep 7 03:10:20 2021 - [info] Connecting to root@192.168.122.10(192.168.122.10:22).. Creating /tmp if not exists.. ok. Checking output directory is accessible or not.. ok. Binlog found at /usr/local/mysql/data, up to master-bin.000001 Tue Sep 7 03:10:20 2021 - [info] Binlog setting check done. Tue Sep 7 03:10:20 2021 - [info] Checking SSH publickey authentication and checking recovery script configurations on all alive slave servers.. Tue Sep 7 03:10:20 2021 - [info] Executing command : apply_diff_relay_logs --command=test --slave_user='mha' --slave_host=192.168.122.11 --slave_ip=192.168.122.11 --slave_port=3306 --workdir=/tmp --target_version=5.7.17-log --manager_version=0.57 --relay_log_info=/usr/local/mysql/data/relay-log.info --relay_dir=/usr/local/mysql/data/ --slave_pass=xxx Tue Sep 7 03:10:20 2021 - [info] Connecting to root@192.168.122.11(192.168.122.11:22).. Checking slave recovery environment settings.. Opening /usr/local/mysql/data/relay-log.info ... ok. Relay log found at /usr/local/mysql/data, up to relay-log-bin.000006 Temporary relay log file is /usr/local/mysql/data/relay-log-bin.000006 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. Tue Sep 7 03:10:21 2021 - [info] Executing command : apply_diff_relay_logs --command=test --slave_user='mha' --slave_host=192.168.122.12 --slave_ip=192.168.122.12 --slave_port=3306 --workdir=/tmp --target_version=5.7.17-log --manager_version=0.57 --relay_log_info=/usr/local/mysql/data/relay-log.info --relay_dir=/usr/local/mysql/data/ --slave_pass=xxx Tue Sep 7 03:10:21 2021 - [info] Connecting to root@192.168.122.12(192.168.122.12:22).. Checking slave recovery environment settings.. Opening /usr/local/mysql/data/relay-log.info ... ok. Relay log found at /usr/local/mysql/data, up to relay-log-bin.000006 Temporary relay log file is /usr/local/mysql/data/relay-log-bin.000006 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. Tue Sep 7 03:10:21 2021 - [info] Slaves settings check done. Tue Sep 7 03:10:21 2021 - [info] 192.168.122.10(192.168.122.10:3306) (current master) +--192.168.122.11(192.168.122.11:3306) +--192.168.122.12(192.168.122.12:3306) Tue Sep 7 03:10:21 2021 - [info] Checking replication health on 192.168.122.11.. Tue Sep 7 03:10:21 2021 - [info] ok. Tue Sep 7 03:10:21 2021 - [info] Checking replication health on 192.168.122.12.. Tue Sep 7 03:10:21 2021 - [info] ok. Tue Sep 7 03:10:21 2021 - [info] Checking master_ip_failover_script status: Tue Sep 7 03:10:21 2021 - [info] /usr/local/bin/master_ip_failover --command=status --ssh_user=root --orig_master_host=192.168.122.10 --orig_master_ip=192.168.122.10 --orig_master_port=3306 IN SCRIPT TEST====/sbin/ifconfig ens33:1 down==/sbin/ifconfig ens33:1 192.168.122.200=== Checking the Status of the script.. OK Tue Sep 7 03:10:21 2021 - [info] OK. Tue Sep 7 03:10:21 2021 - [warning] shutdown_script is not defined. Tue Sep 7 03:10:21 2021 - [info] Got exit code 0 (Not master dead). MySQL Replication Health is OK.
这篇关于故障集,持续更新的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-23Springboot应用的多环境打包入门
- 2024-11-23Springboot应用的生产发布入门教程
- 2024-11-23Python编程入门指南
- 2024-11-23Java创业入门:从零开始的编程之旅
- 2024-11-23Java创业入门:新手必读的Java编程与创业指南
- 2024-11-23Java对接阿里云智能语音服务入门详解
- 2024-11-23Java对接阿里云智能语音服务入门教程
- 2024-11-23JAVA对接阿里云智能语音服务入门教程
- 2024-11-23Java副业入门:初学者的简单教程
- 2024-11-23JAVA副业入门:初学者的实战指南