免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1628 | 回复: 0

MHA报错问题:User repl does not exist or does not have REPLICATION SLAVE priv... [复制链接]

论坛徽章:
8
数据库技术版块每日发帖之星
日期:2015-12-22 06:20:00数据库技术版块每日发帖之星
日期:2015-12-23 06:20:00数据库技术版块每周发帖之星
日期:2016-02-03 16:55:09数据库技术版块每日发帖之星
日期:2016-07-15 06:20:00IT运维版块每日发帖之星
日期:2016-08-13 06:20:00数据库技术版块每日发帖之星
日期:2016-08-15 06:20:00IT运维版块每日发帖之星
日期:2016-08-16 06:20:00IT运维版块每日发帖之星
日期:2016-08-17 06:20:00
发表于 2016-09-06 10:15 |显示全部楼层
本帖最后由 zhancat200801 于 2016-09-06 10:17 编辑

在做MHA配置并测试的时候,执行如下命令:


masterha_check_repl --conf=/etc/app1.cnf
报错如下:




[root@host12 ~]# masterha_check_repl --conf=/etc/app1.cnf
Tue Sep  6 01:31:11 2016 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Tue Sep  6 01:31:11 2016 - [info] Reading application default configuration from /etc/app1.cnf..
Tue Sep  6 01:31:11 2016 - [info] Reading server configuration from /etc/app1.cnf..
Tue Sep  6 01:31:11 2016 - [info] MHA::MasterMonitor version 0.56.
Tue Sep  6 01:31:12 2016 - [info] GTID failover mode = 1
Tue Sep  6 01:31:12 2016 - [info] Dead Servers:
Tue Sep  6 01:31:12 2016 - [info] Alive Servers:
Tue Sep  6 01:31:12 2016 - [info]   192.168.1.107(192.168.1.107:3306)
Tue Sep  6 01:31:12 2016 - [info]   192.168.1.111(192.168.1.111:3306)
Tue Sep  6 01:31:12 2016 - [info]   192.168.1.112(192.168.1.112:3306)
Tue Sep  6 01:31:12 2016 - [info] Alive Slaves:
Tue Sep  6 01:31:12 2016 - [info]   192.168.1.111(192.168.1.111:3306)  Version=5.6.31-log (oldest major version between slaves) log-bin:enabled
Tue Sep  6 01:31:12 2016 - [info]     GTID ON
Tue Sep  6 01:31:12 2016 - [info]     Replicating from 192.168.1.107(192.168.1.107:3306)
Tue Sep  6 01:31:12 2016 - [info]     Primary candidate for the new Master (candidate_master is set)
Tue Sep  6 01:31:12 2016 - [info]   192.168.1.112(192.168.1.112:3306)  Version=5.6.31-log (oldest major version between slaves) log-bin:enabled
Tue Sep  6 01:31:12 2016 - [info]     GTID ON
Tue Sep  6 01:31:12 2016 - [info]     Replicating from 192.168.1.107(192.168.1.107:3306)
Tue Sep  6 01:31:12 2016 - [info]     Not candidate for the new Master (no_master is set)
Tue Sep  6 01:31:12 2016 - [info] Current Alive Master: 192.168.1.107(192.168.1.107:3306)
Tue Sep  6 01:31:12 2016 - [info] Checking slave configurations..
Tue Sep  6 01:31:12 2016 - [info] Checking replication filtering settings..
Tue Sep  6 01:31:12 2016 - [info]  binlog_do_db= , binlog_ignore_db=
Tue Sep  6 01:31:12 2016 - [info]  Replication filtering check ok.
Tue Sep  6 01:31:12 2016 - [error][/usr/local/share/perl5/MHA/Server.pm, ln393] 192.168.1.111(192.168.1.111:3306): User repl does not exist or does not have REPLICATION SLAVE privilege! Other slaves can not start replication from this host.
Tue Sep  6 01:31:12 2016 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln424] Error happened on checking configurations.  at /usr/local/share/perl5/MHA/ServerManager.pm line 1403
Tue Sep  6 01:31:12 2016 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln523] Error happened on monitoring servers.
Tue Sep  6 01:31:12 2016 - [info] Got exit code 1 (Not master dead).




MHA配置文件如下:




[server default]
user=muser
ssh_user=root
password=654321
manager_workdir=/home/mysql_mha
manager_log=/var/log/masterha/mha.log
#远程服务器的工作目录
remote_workdir=/home/mysql_mha
ssh_user=root
repl_user=repl
repl_password=654321
ping_interval=1
master_binlog_dir=/var/log/mysql/binlog
#master_ip_failover_script=/usr/bin/master_ip_failover
secondary_check_script=/usr/local/bin/masterha_secondary_check -s 192.168.1.126 -s 192.168.1.11 -s 192.168.1.107

[server1]
hostname=192.168.1.107
candidate_master=1

[server2]
hostname=192.168.1.111
candidate_master=1

[server3]
hostname=192.168.1.112
no_master=1
经过排查,网络、ssh联通性均没有问题,在master上检查授权也没有问题:


mysql> show grants for 'repl'@'%';
+-------------------------------------------------------------------------------------------------------------------------------------+
| Grants for repl@%                                                                                                                   |
+-------------------------------------------------------------------------------------------------------------------------------------+
| GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'repl'@'%' IDENTIFIED BY PASSWORD '*2A032F7C5BA932872F0F045E0CF6B53CF702F2C5' |
+-------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
权限检查没有问题,但报错明明是权限问题,太奇怪了,哪位高人帮忙排查一下,报错是什么原因?谢谢!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP