【问题描述】:
在master停机维护启动服务之后,slave的Slave_IO_Running状态被置为NO
Slave_SQL_Running为Yes,猜测应该是master的锅
继续检查网络,权限等问题之后仍然为不可用
也尝试重新
change master to ...., ...., ....,
master_log_file = 'master-bin.034555',
master_log_pos = 98;
依旧不可用
-
160322 9:42:51 [Note] Slave SQL thread initialized, starting replication in log 'master-bin.034555' at position 98, relay log './MySQLd-relay-bin.0000
-
01' position: 4
-
160322 9:43:01 [Note] Slave I/O thread: connected to master 'repl@*.*.*.*:3306', replication started in log 'master-bin.034555' at position 98
-
160322 9:43:01 [ERROR] Error reading packet from server: Misconfigured master -server id was not set ( server_errno=1236)
-
160322 9:43:01 [ERROR] Got fatal error 1236: 'Misconfigured master - server id was not set' from master when reading data from binary log
-
160322 9:43:01 [Note] Slave I/O thread exiting, read up to log 'master-bin.034555', position 98
-
160322 9:43:07 [Note] Error reading relay log event: slave SQL thread was killed
检查配置文件发现#server-id = xxx 被注释
【解决方案】:
由于server_id为“Dynamic Variable”
故到master中手动执行
-
mysql> SET GLOBAL server_id=3028;
-
Query OK, 0 rows affected(0.00 sec)
最后在将配置文件中添加
server-id=3028
在slave上检查:
-
mysql> SHOWSLAVE STATUS\G
-
*************************** 1. row***************************
-
Slave_IO_State: Waitingfor masterto send event
-
Master_Host: 192.168.30.28
-
Master_User: repl
-
Master_Port: 3306
-
Connect_Retry: 60
-
Master_Log_File:master-bin.034556
-
Read_Master_Log_Pos: 59312658
-
Relay_Log_File: mysqld-relay-bin.000002
-
Relay_Log_Pos: 64698308
-
Relay_Master_Log_File:master-bin.034555
-
Slave_IO_Running: Yes
-
Slave_SQL_Running: Yes
-
…………………………
-
Seconds_Behind_Master: 10071
-
1 rowin set (0.00 sec)
解决。
同样,某些时候在start slave时报错“The server is not configured as slave”,
同样也很有可能是server-id的缘故,只需要手动在主和从库上执行:
SET GLOBAL server_id = xxx,并保证两台server-id不一样即可,最后写入my.cnf中。
作者微信公众号(持续更新)
网页题目:【MySQL】Server-id导致Slave_IO_Running:No主从复制故障
文章分享:https://www.cdcxhl.com/article0/jsgdio.html
成都网站建设公司_创新互联,为您提供网站设计公司、网站改版、做网站、App设计、外贸建站、品牌网站建设
广告
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源:
创新互联