MHA报错问题:User repl does not exist or does not have REPLICATION SLAVE privilege!
来源:

爱学习的程序员2019
2016-09-06
老师好,在做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)
劳烦老师帮忙排查一下,报错是什么原因?为何测试不通过呢?谢谢老师!
写回答
2回答
-
sqlercn
2016-09-06
masterha_check_repl 看看是不是正常?
022016-09-06 -
sqlercn
2016-09-06
因该是1.111这个服务器上repl用户的问题。再仔细查看一下用户权限和密码是否正确
012016-09-06
相似问题