1:masterha_check_repl 副本集方面报错  replicates is not defined in the configuration file!

具体信息如下:

# /usr/local/bin/masterha_check_repl --conf=/etc/mha/app1.cnf


Thu Nov :: - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Thu Nov :: - [info] Reading application default configuration from /etc/mha/app1.cnf..
Thu Nov :: - [info] Reading server configuration from /etc/mha/app1.cnf..
Thu Nov :: - [info] MHA::MasterMonitor version 0.56.
Thu Nov :: - [error][/usr/local/share/perl5/MHA/ServerManager.pm, ln671] Master 179.179.19.179: from which slave 179.179.19.180(179.179.19.180:) replicates is not defined in the configuration file!
Thu Nov :: - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln424] Error happened on checking configurations. at /usr/local/share/perl5/MHA/MasterMonitor.pm line .
Thu Nov :: - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln523] Error happened on monitoring servers.
Thu Nov :: - [info] Got exit code (Not master dead). MySQL Replication Health is NOT OK!

分析:MHA 漂移过后,我们知道配置信息中 主节点的信息就不在了,我们需要及时维护,否则/usr/local/bin/masterha_check_repl --conf=/etc/mha/XXX.cnf 检查副本集状态报错。

2. masterha_master_switch 在线切换方面 报错 We should not start online master switch when one of connections are running long updates on the current master

具体信息如下:

# /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:)? (YES/no): y

Tue Nov  ::  - [info] Executing FLUSH NO_WRITE_TO_BINLOG TABLES. This may take long time..
Tue Nov :: - [info] ok.
Tue Nov :: - [info] Checking MHA is not monitoring or doing failover..
Tue Nov :: - [info] Checking replication health on 179.179.19.185..
Tue Nov :: - [info] ok.
Tue Nov :: - [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:)). Currently update thread(s) are running.
Details:
{'Time' => '','db' => undef,'Id' => '','User' => 'event_scheduler','State' => 'Waiting on empty queue','Command' => 'Daemon','Info' => undef,'Host' => 'localhost'}
Tue Nov :: - [error][/usr/local/share/perl5/MHA/ManagerUtil.pm, ln177] Got ERROR: at /usr/local/bin/masterha_master_switch line .

分析:set global event_scheduler=off; 主从都要关闭

3. masterha_master_switch 在线切换方面 报错 Got Error: DBI .....failed: Access denied for user

# /usr/local/bin/masterha_master_switch --master_state=alive --conf=/etc/mha/app1.cnf

Starting master switch from 179.179.19.185(179.179.:) to 179.179.19.184(179.179.19.184:)? (yes/NO): yes

Tue Nov  ::  - [info] Checking whether 179.179.19.184(179.179.19.184:) is ok for the new master..
Tue Nov :: - [info] ok.
Tue Nov :: - [info] ** Phase : Configuration Check Phase completed.
Tue Nov :: - [info]
Tue Nov :: - [info] * Phase : Rejecting updates Phase..
Tue Nov :: - [info]
Tue Nov :: - [info] Executing master ip online change script to disable write on the current master:
Tue Nov :: - [info] /usr/local/bin/master_ip_online_change_appuanalysis --command=stop --orig_master_host=179.179.19.185 --orig_master_ip=179.179.19. --orig_master_port=--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= --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 .
at /usr/local/bin/master_ip_online_change_app1 line . Tue Nov :: - [error][/usr/local/share/perl5/MHA/ManagerUtil.pm, ln177] Got ERROR: at /usr/local/bin/masterha_master_switch line .

分析:账号密码有需要转移字符的。app1.cnf 文件中user账号相应的密码 password 不能有待转移的字符,例如本例中的')',但是 账号 repl_user 相应的密码repl_password 没有此限制。

 4.如果使用的是xtrabackup,注意从节点会把event还原上去,可能会造成数据不一致,同步失败的问题。

如果主节点有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

MySQL 有关MHA搭建与切换的几个错误log的更多相关文章

  1. MySQL MHA 搭建&测试

    一:背景介绍 MHA(Master HA)是一款开源的MySQL的高可用工具,能在MySQL主从复制的基础上,实现自动化主服务器故障转移.虽然MHA试图从宕机的主服务器上保存二进制日志,但并不是总是可 ...

  2. mysql mha 主从自动切换 高可用

    mha(Master High Availability)目前在MySQL多服务器(超过二台),高可用方面是一个相对成熟的解决方案. 一,什么是mha,有什么特性 1. 主服务器的自动监控和故障转移 ...

  3. MySQL MHA 搭建&测试(环境:CentOS7 + MySQL5.7.23)

    MySQL MHA架构介绍: MHA(Master High Availability)目前在MySQL高可用方面是一个相对成熟的解决方案,它由日本DeNA公司youshimaton(现就职于Face ...

  4. MySQL MHA搭建

    MHA算是业内比较成熟的MySQL高可用解决方案,在MySQL故障切换过程中,MHA能做到自动完成数据库的故障切换操作,并且在进行故障切换的过程中,MHA能在最大程度上保证数据的一致性,以达到真正意义 ...

  5. mysql高可用架构MHA搭建(centos7+mysql5.7.28)

    无论是传统行业,还是互联网行业,数据可用性都是至关重要的,虽然现在已经步入大数据时代,nosql比较流行,但是作为数据持久化及事务性的关系型数据库依然是项目首选,比如mysql. 现在几乎所有的公司项 ...

  6. MySQL集群搭建(5)-MHA高可用架构

    1 概述 1.1 MHA 简介 MHA - Master High Availability 是由 Perl 实现的一款高可用程序,出现故障时,MHA 以最小的停机时间(通常10-30秒)执行 mas ...

  7. 一次mysql主从加keepalived配置搭建及切换演示

    [需求] 根据需求需要搭建mysql主从架构数据库及加keepalived进行自动切换VIP [环境介绍]  系统环境:CentOS release 6.4 (Final) + Server vers ...

  8. mysql 8.0.18 mgr 搭建及其切换

    mysql 8.0.18 mgr 搭建及其切换 一.系统安装包 yum -y install make gcc-c++ cmake bison-devel ncurses-devel readline ...

  9. MySQL 之 MHA + ProxySQL + keepalived 实现读写分离,高可用(一)

    准备服务器: docker network create --subnet=192.168.0.0/16 staticnetdocker run -d --privileged -v `pwd`/my ...

随机推荐

  1. NIO-概览

    目录 NIO-概览 目录 前言 什么是NIO 通道 缓冲区 选择器 其他 管道 FileLock 参考文档 NIO-概览 目录 NIO-概览 前言 本来是想学习Netty的,但是Netty是一个NIO ...

  2. 英语口语考试资料Friendships

    Friendships Remember Friendships can be complicated. When you want to get to know someone, it helps ...

  3. 漫谈LiteOS之开发板-GPIO(基于GD32450i-EVAL)

    [摘要] 本文主要从GPIO的定义.工作模式.特色.工作场合.以及GD32450i-EVAL开发板的引脚.对应的寄存器以及GPIO的流水灯示例对GPIO加以介绍,希望对你有所帮助. 1定义 GPIO( ...

  4. Python中的Tcp协议的应用之Tcp服务端程序开发

    TCP通信协议是面向连接的可靠的网络通信协议. 网络间想要进行数据传输必须要用到socket,socket翻译过来叫做套接字,其主要作用是不同设备或同一台设备之间的进程通信工具. Python中的Tc ...

  5. Charles Fiddler使用

    http://blog.devtang.com/2015/11/14/charles-introduction/ Charles 从入门到精通 http://www.infoq.com/cn/arti ...

  6. Remember the Word (UVA-1402)

    Neal is very curious about combinatorial problems, and now here comes a problem about words. Knowing ...

  7. 【Nodejs】326- 从零开发一个node命令行工具

    本文由 IMWeb 社区授权转载自腾讯内部 KM 论坛.点击阅读原文查看 IMWeb 社区更多精彩文章. 什么是命令行工具? 命令行工具(Cmmand Line Interface)简称cli,顾名思 ...

  8. 视频来了!Visual Studio Online 东半球首秀 @ .NET Conf 2019

    2019 年 11 月 9 日,.NET Conf 2019 中国峰会于上海中谷小南国花园酒店举行,全国的 .NET 大咖相聚上海. 这次我演讲的主题是<Visual Studio Code — ...

  9. 【Eureka】服务发现调用

    [Eureka]服务发现调用 转载:https://www.cnblogs.com/yangchongxing/p/10779832.html 1.使用 Netfix Feign 客户端调用服务 首先 ...

  10. Java做成Zip文件,Java实现压缩文件

    import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import ...