MySQL Slave 不复制

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8733801/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 22:14:30  来源:igfitidea点击:

MySQL Slave not Replicating

mysqlreplicationmaster-slave

提问by jeffery_the_wind

I have set up MySQL master/slave replication for 2 servers before without problems, I usually follow the great documentation on the MySQL website here. However this time I have set it up and everything looks like it should be working, but the slave is not updating with new data from the master. I will show some output from both the master and the server.

我之前已经为 2 个服务器设置了 MySQL 主/从复制,没有问题,我通常会按照此处MySQL 网站上的优秀文档进行操作。但是这次我已经设置好了,一切看起来都应该正常工作,但是从站没有使用来自主站的新数据进行更新。我将显示来自主服务器和服务器的一些输出。

Master (IP:10.1.1.21)

大师 (IP:10.1.1.21)

show processlist

'107', 'repl', '10.1.1.22:60686', NULL, 'Binlog Dump', '523', 'Has sent all binlog to slave; waiting for binlog to be updated', NULL

'107', 'repl', '10.1.1.22:60686', NULL, 'Binlog Dump', '523', '已将所有二进制日志发送给从站;等待 binlog 更新', NULL

show master status

'mysql-bin.000280', '10494', 'joomla', 'mysql'

'mysql-bin.000280'、'10494'、'joomla'、'mysql'

Slave (IP:10.1.1.22)

从站(IP:10.1.1.22)

show processlist

'9', 'system user', '', NULL, 'Connect', '625', 'Waiting for master to send event', NULL

'10', 'system user', '', NULL, 'Connect', '10', 'Has read all relay log; waiting for the slave I/O thread to update it', NULL

'9', '系统用户', '', NULL, 'Connect', '625', '等待主机发送事件', NULL

'10', 'system user', '', NULL, 'Connect', '10', '已读取所有中继日志;等待从属 I/O 线程更新它', NULL

show slave status

'Waiting for master to send event', '10.1.1.21', 'repl', '3306', '60', 'mysql-bin.000280', '14029', 'tim-Dell-DM061-relay-bin.000002', '14174', 'mysql-bin.000280', 'Yes', 'Yes', '', '', '', '', '', '', '0', '', '0', '14029', '14338', 'None', '', '0', 'No', '', '', '', '', '', '0', 'No', '0', '', '0', ''

'等待主发送事件'、'10.1.1.21'、'repl'、'3306'、'60'、'mysql-bin.000280'、'14029'、'tim-Dell-DM061-relay-bin。 000002'、'14174'、'mysql-bin.000280'、'是'、'是'、''、''、''、''、''、''、'0'、''、'0 ', '14029', '14338', '无', '', '0', '否', '', '', '', '', '', '0', '否', '0 ', '', '0', ''

The way I tested to see if it was working was to create a table on the master. I did this and this new table did not propagate to the slave. I did check the relay binary log, and it did have a lot of updates in it. This is a website database, and I just checked it the # of hits are propagating to the slave, so it seems to be working a little.

我测试它是否有效的方法是在主服务器上创建一个表。我这样做了,这个新表没有传播到奴隶。我确实检查了中继二进制日志,它确实有很多更新。这是一个网站数据库,我刚刚检查了它的点击数正在传播到从站,所以它似乎有点工作。

Creating a table is not propagating, and also i tried inserting some data into a test table that existing when I did the initial data sync to the slave, this does not propagate to the slave either.

创建表不会传播,而且我还尝试将一些数据插入到我对从属设备进行初始数据同步时存在的测试表中,这也不会传播到从属设备。

Any ideas of how I can debug this further??

关于如何进一步调试的任何想法?

Thanks!

谢谢!

EDIT:

编辑:

the show global variables like 'replicate%'returns 2 columns: "Variable_name", "Value". There aren't any rows of data.

show global variables like 'replicate%'返回2列:“变量名”,“价值”。没有任何数据行。

回答by JDseca

Apparently your bin position on the master is currently 10494 and your slave sees your Read_Master_Log_Pos as 14029.

显然,您在主站上的 bin 位置当前为 10494,而您的从站将您的 Read_Master_Log_Pos 视为 14029。

So your slave thinks it is ahead of the master in log position, and waiting for the master to have new data.

所以你的奴隶认为它在日志位置领先于主人,并等待主人有新的数据。

回答by RolandoMySQLDBA

In our SHOW MASTER STATUS;I noticed you have this

在我们的SHOW MASTER STATUS;我注意到你有这个

'mysql-bin.000280', '10494', 'joomla', 'mysql'

I cringe when someone uses binlog-do-db. Here is why.

当有人使用 binlog-do-db 时,我会感到畏缩。这就是为什么

There is an old bug report for MySQL 4.0 that I do not fully believe was fixed.

有一个关于 MySQL 4.0 的旧错误报告,我不完全相信它已修复