温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

MySQL报错Slave: received end packet from server, apparent master shutdown

发布时间:2020-08-12 20:12:41 来源:ITPUB博客 阅读:120 作者:feelpurple 栏目:MySQL数据库

MySQL 一台从库的错误日志,大量报下面的错误信息

2018-11-16 15:11:12 10951 [Note] Slave: received end packet from server, apparent master shutdown: 
2018-11-16 15:11:12 10951 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'mysql-bin.000369' at position 255843250
2018-11-16 15:11:12 10951 [Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
2018-11-16 15:20:09 10951 [Note] Slave: received end packet from server, apparent master shutdown: 
2018-11-16 15:20:09 10951 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'mysql-bin.000369' at position 276447773
2018-11-16 15:20:09 10951 [Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.

这套DB有三台从库,而主库上面通过命令只能看到两台从库

root [(none)]> show slave hosts;
+-----------+------+------+-----------+--------------------------------------+
| Server_id | Host | Port | Master_id | Slave_UUID                           |
+-----------+------+------+-----------+--------------------------------------+
|   1373324 |      | 3324 |    174144 | 5dfa3e4b-df15-11e8-8c37-06cbe47ccefb |
|    174192 |      | 3306 |    174144 | b24e27f0-dce5-11e8-bdf4-0cc47a397e1c |
+-----------+------+------+-----------+--------------------------------------+
2 rows in set (0.00 sec)

到缺少的那台从库上面检查server-id,看有没有和其他从库相同

server-id并不相同

mysql> show global variables like 'server%id%';
+----------------+--------------------------------------+
| Variable_name  | Value                                |
+----------------+--------------------------------------+
| server_id      | 2461620                              |
| server_id_bits | 32                                   |
| server_uuid    | b24e27f0-dce5-11e8-bdf4-0cc47a397e1c |
+----------------+--------------------------------------+
3 rows in set (0.00 sec)

排除了server-id,还有可能是DB的uuid相同而导致从数据库注册不到主库。

删除数据库目录下面的server-id文件

# cd /disk1/mysql3320
# cat auto.cnf 
[auto]
server-uuid=11478f92-e973-11e8-8fcf-0cc47a663554
# rm auto.cnf

之后重启问题从库,报错消失。


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI