MySQL MHA 报错处理

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介: 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.

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 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、脚本文件没有执行权限

Sat Mar 23 07:25:46 2019 - error 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 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 Failed to get master_ip_failover_script status with return code 2:0.
Sat Mar 23 07:27:44 2019 - error Error happened on checking configurations. at /usr/bin/masterha_check_repl line 48
Sat Mar 23 07:27:44 2019 - error Error happened on monitoring servers.
Sat Mar 23 07:27:44 2019 - [info] Got exit code 1 (Not master dead).

解决办法:#!/usr/bin/env perl要最顶行
原文地址https://www.cnblogs.com/102x/p/10583959.html

相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
2月前
|
SQL 消息中间件 关系型数据库
Flink数据源问题之读取mysql报错如何解决
Flink数据源是指Apache Flink用于读取外部系统数据的接口或组件;本合集将探讨Flink数据源的类型、配置方法和最佳实践,以及在使用数据源时可能遇到的错误和解决方案。
49 0
|
2月前
|
缓存 关系型数据库 MySQL
百度搜索:蓝易云【CentOS8服务器安装MySQL报错:no match mysql-community-server】
现在,你已经成功安装了MySQL服务器并解决了"no match mysql-community-server"的报错问题。祝你使用愉快!
42 1
|
17天前
|
关系型数据库 MySQL 数据库
运行flyway报错, MySQL 5.6 is no longer supported by Flyway Community Edition
运行flyway报错, MySQL 5.6 is no longer supported by Flyway Community Edition
18 1
|
2月前
|
关系型数据库 MySQL Docker
MySQL 5.7 timestamp类型设置default value为'0000-00-00 00:00:00'报错的解决方法
MySQL 5.7 timestamp类型设置default value为'0000-00-00 00:00:00'报错的解决方法
|
4月前
|
关系型数据库 MySQL
MySQL 报错 [ERROR] [FATAL] InnoDB: Table flags are 0 in the data dictionary but the flags in file
MySQL 报错 [ERROR] [FATAL] InnoDB: Table flags are 0 in the data dictionary but the flags in file
306 0
|
3月前
|
SQL 数据采集 关系型数据库
如何解决MySQL报错 You have an error in your SQL syntax; check the manual that corresponds to your MySQL?
如何解决MySQL报错 You have an error in your SQL syntax; check the manual that corresponds to your MySQL?
|
26天前
|
Java 关系型数据库 MySQL
Flink1.18.1和CDC2.4.1 本地没问题 提交任务到服务器 报错java.lang.NoClassDefFoundError: Could not initialize class io.debezium.connector.mysql.MySqlConnectorConfig
【2月更文挑战第33天】Flink1.18.1和CDC2.4.1 本地没问题 提交任务到服务器 报错java.lang.NoClassDefFoundError: Could not initialize class io.debezium.connector.mysql.MySqlConnectorConfig
46 2
|
1月前
|
分布式计算 DataWorks 关系型数据库
DataWorks报错问题之dataworks同步rds数据到maxcompute时报错如何解决
DataWorks是阿里云提供的一站式大数据开发与管理平台,支持数据集成、数据开发、数据治理等功能;在本汇总中,我们梳理了DataWorks产品在使用过程中经常遇到的问题及解答,以助用户在数据处理和分析工作中提高效率,降低难度。
|
1月前
|
DataWorks 关系型数据库 MySQL
DataWorks报错问题之dataworks配置mysql数据源报错如何解决
DataWorks是阿里云提供的一站式大数据开发与管理平台,支持数据集成、数据开发、数据治理等功能;在本汇总中,我们梳理了DataWorks产品在使用过程中经常遇到的问题及解答,以助用户在数据处理和分析工作中提高效率,降低难度。
|
1月前
|
SQL DataWorks NoSQL
DataWorks报错问题之从hive到mysql报错如何解决
DataWorks是阿里云提供的一站式大数据开发与管理平台,支持数据集成、数据开发、数据治理等功能;在本汇总中,我们梳理了DataWorks产品在使用过程中经常遇到的问题及解答,以助用户在数据处理和分析工作中提高效率,降低难度。