6

MySQL 主从连接正常,但是不同步数据该怎么排查

 3 years ago
source link: https://www.v2ex.com/t/802277
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  MySQL

MySQL 主从连接正常,但是不同步数据该怎么排查

  moell · 11 小时 11 分钟前 · 541 次点击
正常运行了两年的从库,早上主从断掉了,然后同事直接跳过了错误信息(错误信息当时没注意,我目前不知道什么原因造成的),start slave 之后 ,Slave_IO_Running: Yes Slave_SQL_Running: Yes 显示正常,但是就是不同步数据。存储空间没问题,mysqld.log 也没有异常信息 ,各位大佬指点一二,我该怎么去排查呀!谢谢各位了MySQL:5.7.24
6 条回复    2021-09-16 14:59:07 +08:00

ice2016   11 小时 4 分钟前

moell   10 小时 29 分钟前

@ice2016 不好意思,现在看是有错误日志的。我尝试过从 bin_log 文件的第一个位置开始同步,和最新的主库的位置开始同步都没成功 。
[Warning] Neither --relay-log nor --relay-log-index were used; so replication may break when this MySQL server acts as a slave and has his hostname changed!! Please use '--relay-log=localhost-relay-bin' to avoid this problem.
[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.
[ERROR] Slave I/O for channel '': error connecting to master '' - retry-time: 60 retries: 1, Error_code: 2003
[Warning] Slave SQL for channel '': If a crash happens this configuration does not guarantee that the relay log info will be consistent, Error_code: 0
[Note] Slave SQL thread for channel '' initialized, starting replication in log 'bin_log13.000001' at position 23289168, relay log './localhost-relay-bin.000004' position: 101377
[Note] Event Scheduler: Loaded 0 events
[Note] /usr/local/mysql/bin/mysqld: ready for connections.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK