数据库教程:MySQL MHA 报错处理

安装环境:CentOS 6.5 MySQL 5.7.22 MHA 0.56 1、找不到mysql 命令 Sat Mar 23 07:17:50 2019 – [info] Connecting to root@192.168.32.181(server2:22).. Checking slave r …

安装环境:centos 6.5 mysql 5.7.22 mha 0.56

 

 

1、找不到mysql 命令

sat mar 23 07:17:50 2019 – [info] connecting to root@192.168.32.181(server2:22)..
checking slave recovery environment settings..
opening /data/mysql/relay-log.info … ok.
relay log found at /data/mysql, up to server2-relay-bin.000005
temporary relay log file is /data/mysql/server2-relay-bin.000005
testing mysql connection and privileges..sh: mysql: command not found
mysql command failed with rc 127:0!

 

解决办法:找到mysql 的安装目录,创建适当的软链接

ln -s /usr/local/mysql/bin/mysqlbinlog /usr/local/bin/mysqlbinlog
ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql

2、脚数据库技术:MySQL MHA 报错处理件没有执行权限

sat mar 23 07:25:46 2019 – [error][/usr/share/perl5/vendor_perl/mha/mastermonitor.pm, ln424] error happened on checking configurations. can’t exec “/usr/local/bin/master_ip_failover”: permission denied at /usr/share/perl5/vendor_perl/mha/managerutil.pm line 68.
sat mar 23 07:25:46 2019 – [error][/usr/share/perl5/vendor_perl/mha/mastermonitor.pm, ln523] error happened on monitoring servers.
sat mar 23 07:25:46 2019 – [info] got exit code 1 (not master dead).

mysql replication health is not ok!

解决办法:赋权

chmod +x /usr/local/bin/master_ip_failover

 

3、master_ip_failover脚本错误

 

sat mar 23 07:27:44 2019 – [info] checking master_ip_failover_script status:
sat mar 23 07:27:44 2019 – [info] /usr/local/bin/master_ip_failover –command=status –ssh_user=root –orig_master_host=server1 –orig_master_ip=192.168.32.180 –orig_master_port=3306
/usr/local/bin/master_ip_failover: line 4: use: command not found
/usr/local/bin/master_ip_failover: line 6: use: command not found
/usr/local/bin/master_ip_failover: line 10: use: command not found
/usr/local/bin/master_ip_failover: line 14: syntax error near unexpected token `newline’
/usr/local/bin/master_ip_failover: line 14: `my ( ‘
sat mar 23 07:27:44 2019 – [error][/usr/share/perl5/vendor_perl/mha/mastermonitor.pm, ln226] failed to get master_ip_failover_script status with return code 2:0.
sat mar 23 07:27:44 2019 – [error][/usr/share/perl5/vendor_perl/mha/mastermonitor.pm, ln424] error happened on checking configurations. at /usr/bin/masterha_check_repl line 48
sat mar 23 07:27:44 2019 – [error][/usr/share/perl5/vendor_perl/mha/mastermonitor.pm, ln523] error happened on monitoring servers.
sat mar 23 07:27:44 2019 – [info] got exit code 1 (not master dead).

 

解决办法:#!/usr/bin/env perl要最顶行

 

需要了解更多数据库技术:MySQL MHA 报错处理,都可以关注数据库技术分享栏目—计算机技术网(www.ctvol.com)!

本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/dtteaching/831397.html

(0)
上一篇 2021年9月19日
下一篇 2021年9月19日

精彩推荐