具体信息如下:
# /usr/local/bin/masterha_check_repl --conf=/etc/mha/app1.cnf Thu Nov 21 15:33:15 2018 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping. Thu Nov 21 15:33:15 2018 - [info] Reading application default configuration from /etc/mha/app1.cnf.. Thu Nov 21 15:33:15 2018 - [info] Reading server configuration from /etc/mha/app1.cnf.. Thu Nov 21 15:33:15 2018 - [info] MHA::MasterMonitor version 0.56. Thu Nov 21 15:33:16 2018- [error][/usr/local/share/perl5/MHA/ServerManager.pm, ln671] Master 179.179.19.179:3306 from which slave 179.179.19.180(179.179.19.180:3306) replicates is not defined in the configuration file! Thu Nov 21 15:33:16 2018 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln424] Error happened on checking configurations. at /usr/local/share/perl5/MHA/MasterMonitor.pm line 326. Thu Nov 21 15:33:16 2018 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln523] Error happened on monitoring servers. Thu Nov 21 15:33:16 2018 - [info] Got exit code 1 (Not master dead). MySQL Replication Health is NOT OK!
分析:MHA 漂移过后,我们知道html" target="_blank">配置信息中 主节点的信息就不在了,我们需要及时维护,否则/usr/local/bin/masterha_check_repl --conf=/etc/mha/XXX.cnf 检查副本集状态报错。
具体信息如下:
# /usr/local/bin/masterha_master_switch --master_state=alive --conf=/etc/mha/app1.cnf It is better to execute FLUSH NO_WRITE_TO_BINLOG TABLES on the master before switching. Is it ok to execute on 179.179.19.184(179.179.19.184:3306)? (YES/no): y Tue Nov 19 17:19:09 2018 - [info] Executing FLUSH NO_WRITE_TO_BINLOG TABLES. This may take long time.. Tue Nov 19 17:19:09 2018 - [info] ok. Tue Nov 19 17:19:09 2018 - [info] Checking MHA is not monitoring or doing failover.. Tue Nov 19 17:19:09 2018 - [info] Checking replication health on 179.179.19.185.. Tue Nov 19 17:19:09 2018 - [info] ok. Tue Nov 19 17:19:09 2018 - [error][/usr/local/share/perl5/MHA/MasterRotate.pm, ln161] We should not start online master switch when one of connections are running long updates on the current master(179.179.19.184(179.179.19.184:3306)). Currently 1 update thread(s) are running. Details: {'Time' => '12815','db' => undef,'Id' => '1','User' => 'event_scheduler','State' => 'Waiting on empty queue','Command' => 'Daemon','Info' => undef,'Host' => 'localhost'} Tue Nov 19 17:19:09 2018 - [error][/usr/local/share/perl5/MHA/ManagerUtil.pm, ln177] Got ERROR: at /usr/local/bin/masterha_master_switch line 53.
分析:set global event_scheduler=off; 主从都要关闭
# /usr/local/bin/masterha_master_switch --master_state=alive --conf=/etc/mha/app1.cnf Starting master switch from 179.179.19.185(179.179.19:3306) to 179.179.19.184(179.179.19.184:3306)? (yes/NO): yes Tue Nov 19 18:52:04 2018 - [info] Checking whether 179.179.19.184(179.179.19.184:3306) is ok for the new master.. Tue Nov 19 18:52:04 2018 - [info] ok. Tue Nov 19 18:52:04 2018 - [info] ** Phase 1: Configuration Check Phase completed. Tue Nov 19 18:52:04 2018 - [info] Tue Nov 19 18:52:04 2018 - [info] * Phase 2: Rejecting updates Phase.. Tue Nov 19 18:52:04 2018 - [info] Tue Nov 19 18:52:04 2018 - [info] Executing master ip online change script to disable write on the current master: Tue Nov 19 18:52:04 2018 - [info] /usr/local/bin/master_ip_online_change_appuanalysis --command=stop --orig_master_host=179.179.19.185 --orig_master_ip=179.179.19.185 --orig_master_port=3306--orig_master_user='weixinLX391P_xldbmha' --orig_master_password='weixinLX391P_xldbmha\)qlk' --new_master_host=179.179.19.184 --new_master_ip=179.179.19.184 --new_master_port=55988 --new_master_user='us_mha' --new_master_password='weixinLX391P_xldbmha\)qlk' --orig_master_ssh_user=root --new_master_ssh_user=root Got Error: DBI connect(';host=179.179.19.184;port=3306;mysql_connect_timeout=4','weixinLX391P_xldbmha',...) failed: Access denied for user 'weixinLX391P_xldbmha'@'179.179.19.166' (using password: YES) at /usr/local/share/perl5/MHA/DBHelper.pm line 205. at /usr/local/bin/master_ip_online_change_app1 line 119. Tue Nov 19 18:52:04 2018 - [error][/usr/local/share/perl5/MHA/ManagerUtil.pm, ln177] Got ERROR: at /usr/local/bin/masterha_master_switch line 53.
分析:账号密码有需要转移字符的。app1.cnf 文件中user账号相应的密码 password 不能有待转移的字符,例如本例中的')',但是 账号 repl_user 相应的密码repl_password 没有此限制。
如果主节点有event,需要手动关闭从节点的event。例如,主节点有归档删除数据的event,从节点需要关闭,否则报错。类似如下错误:
Could not execute Delete_rows event on table ????DB.*****table; Can't find record in '*****', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log FIRST, end_log_pos XXXXXXX
检查的命令:
/usr/local/bin/masterha_check_repl --conf=/etc/mha/qqweixinordb.cnf
主要的报错信息
Can't exec "mysqlbinlog": No such file or directory at /usr/local/share/perl5/MHA/BinlogManager.pm line 106. mysqlbinlog version command failed with rc 1:0, please verify PATH, LD_LIBRARY_PATH, and client options at /usr/local/bin/apply_diff_relay_logs line 493. Fri Aug 28 04:38:22 2019 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln205] Slaves settings check failed! Fri Aug 28 04:38:22 2019 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln413] Slave configuration failed. Fri Aug 28 04:38:22 2019 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln424] Error happened on checking configurations. at /usr/local/bin/masterha_check_repl line 48. Fri Aug 28 04:38:22 2019 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln523] Error happened on monitoring servers. Fri Aug 28 04:38:22 2019 - [info] Got exit code 1 (Not master dead). MySQL Replication Health is NOT OK!
解决方案--在每个DB节点执行以下命令
ln -s /usr/local/mysql/bin/mysqlbinlog /usr/local/bin/mysqlbinlog ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql
再次检查,报错信息消失,OK。
以root账号设置的ssh免密登陆,而ssh有过期限制,则mha ssh检查时报错:
/usr/local/bin/masterha_check_ssh --conf=/etc/mha/qqorder.cnf Thu Nov 5 10:09:09 2018 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping. Thu Nov 5 10:09:09 2018 - [info] Reading application default configuration from /etc/mha/pms20epime.cnf.. Thu Nov 5 10:09:09 2018 - [info] Reading server configuration from /etc/mha/pms20epime.cnf.. Thu Nov 5 10:09:09 2018 - [info] Starting SSH connection tests.. Thu Nov 5 10:09:09 2018 - [error][/usr/local/share/perl5/MHA/SSHCheck.pm, ln63] Thu Nov 5 10:09:09 2018 - [debug] Connecting via SSH from root@172.181.191.191(172.181.191.191:22) to root@172.181.191.192(172.181.191.192:22).. WARNING: Your password has expired. Password change required but no TTY available. Thu Nov 5 10:09:09 2018 - [error][/usr/local/share/perl5/MHA/SSHCheck.pm, ln111] SSH connection from root@172.181.191.191(172.181.191.191:22) to root@172.181.191.192(172.181.191.192:22) failed! Thu Nov 5 10:09:10 2018 - [error][/usr/local/share/perl5/MHA/SSHCheck.pm, ln63] Thu Nov 5 10:09:09 2018 - [debug] Connecting via SSH from root@172.181.191.192(172.181.191.192:22) to root@172.181.191.191(172.181.191.191:22).. WARNING: Your password has expired. Password change required but no TTY available. Thu Nov 5 10:09:10 2018 - [error][/usr/local/share/perl5/MHA/SSHCheck.pm, ln111] SSH connection from root@172.181.191.192(172.181.191.192:22) to root@172.181.191.191(172.181.191.191:22) failed! SSH Configuration Check Failed! at /usr/local/bin/masterha_check_ssh line 44.
另外一种表现,就是第二次执行账号切换时报错 sudo su -
解决方案在root账号下,执行以下命令:
chage -M 99999 root
以上就是MySQL 有关MHA搭建与切换的几个错误log汇总的详细内容,更多关于MySQL MHA搭建与切换的资料请关注小牛知识库其它相关文章!
本文向大家介绍MySQL 搭建MHA架构部署的步骤,包括了MySQL 搭建MHA架构部署的步骤的使用技巧和注意事项,需要的朋友参考一下 MAH 一:MAH架构介绍 MHA (Master High Availability)目前在MySQL高可用方面是一个相对成熟的解决方案,它由日本人youshimaton开发,是一套优秀的作为MySQL高可用性环境下故障切换和主从提升的高可用软件。在MySQL故
我有带CTP1的VS_2013更新2。1.Win8。1×64;支持Hyper-V的英特尔i3;50GB几乎全C驱动器,完全归功于visual studio。 我对MDHA中背靠背的错误感到厌倦,所以我想马上询问社区。有人有办法解决这些错误吗。 我的系统变量- 阿杜之家酒店- 安图之家酒店- 吉特尤之家酒店- JAVA_HOME- JDK_HOME- 路径- WindowsPhone模拟器720p错
我希望在我的表单的每个选项卡上都有一个切换按钮。随后在代码中使用此切换按钮,根据切换按钮中的值是真还是假来创建脚本。我希望当我选中第一个选项卡上的一个切换按钮时,其他选项卡上所有同名的切换按钮都显示相同的开/关位置。这可能吗?
本文向大家介绍关于mysql init_connect的几个要点总结,包括了关于mysql init_connect的几个要点总结的使用技巧和注意事项,需要的朋友参考一下 init_connect的作用 init_connect通常用于:当一个连接进来时,做一些操作,比如设置autocommit为0,比如记录当前连接的ip来源和用户等信息到一个新表里,当做登陆日志信息 使用init_connect
本文向大家介绍postgresql 切换 log、xlog日志的实现,包括了postgresql 切换 log、xlog日志的实现的使用技巧和注意事项,需要的朋友参考一下 os: centos 7.4 db: postgresql 9.6 切换log: 切换xlog: 补充:postgresql流复制主从切换+resetxlog 主 192.168.3.46 从 192.168.3.47 现象:由
问题内容: 我复习了很多有关这些东西的信息,但是不明白它们之间有什么区别?在Fowler的UML中,Distilled说“聚合”严格意义上是没有意义的,因此作者建议不要在图表中使用它。请解释一下什么时候应该使用它们,以及它们将如何影响Java代码。 问题答案: 这是一个非常有争议的问题。正如Martin在答案中解释的那样,订单汇总了产品。这可以认为是正确的。Grady Booch在他的“面向对象的