首页 > 技术文章 > 错误排查修改(连载中)

zhouruan 2021-09-15 09:01 原文

MySQL主从复制与读写分离实验中 出现

Slave_IO_Running: No

这种情况

一般是因为
1、网络不通
2、my. cnf配置有问题
3、密码、file文件名、pos偏移量不对
4、防火墙没有关闭

Slave_SQL_Running: No


这种情况
一般是因为 主服务器的数据库一开始就和从服务器的数据库不一样 导致的问题
我把主服务器与从服务器的不一样的数据库导出备份 再通过scp 传输给从服务器 从服务器 导入一下

然后关闭同步 重新 在主服务器查看一下主服务状态 然后再配置同步
主服务器查看

从服务器重新同步

ok了

MHA 安装epel源出现

yum install epel-release --nogpgcheck -y
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
没有可用软件包 epel-release。
错误:无须任何处理

可以使用 在线源 下载

cd /etc/yum.repos.d/
mv CentOS-Base.repo CentOS-Base.repo_ bak
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

也可以吧本地源之前移走的文件移回来

masterha_check_repl -conf=/etc/masterha/app1.cnf

[error][/usr/local/share/perl5/MHA/ServerManager.pm, ln301] Got MySQL error when connecting 192.168.247.10(192.168.247.10:3306) :1045:Access denied for user 'mha'@'192.168.247.30' (using password: YES), but this is not a MySQL crash. Check MySQL server settings.

出现这样的错误 是因为 mysql授权时出现错误

grant all privileges on *.* to 'mha'@'192.168.247.%' identified by 'manager';

重新授权

推荐阅读