恢复清除的 mysql binlog 文件
我在一对服务器上设置了复制。一是主人,二是奴隶。
最近在master上,binlog文件被过早地清除了(通过文件名,所以mysql没有阻止过早地删除文件)。
现在 SLAVE 的状态为:
从二进制日志读取数据时,从主服务器收到致命错误 1236:“无法在二进制日志索引文件中找到第一个日志文件名”
我不想恢复丢失的二进制日志文件,因此从服务器将从完成的位置重新开始读取。
这些文件已经就位,但如何强制主服务器“取消清除”它的日志列表(以便它们在“显示二进制日志”中可见)?
I've got a replication set up on pair of servers. One is a master and second is a slave.
Recently on master the binlog files were purged too early (by filename so mysql haven't prevented too early removal of file).
Now the SLAVE has status:
Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'
I wan't to restore the missing binlog files so the slave will restart reading from the point it finished.
The files are already in place but how can I force master to 'unpurge' it's log list (so they are visible in SHOW BINARY LOGS)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我成功了。然而这个解决方案并不完美/100% 安全。
我已将所有文件名输入到 mysql-bin.index 中
(如果您要使用它,请先检查 mysql-bin.index 文件中的文件名格式并根据您的需要进行调整)
,然后重新启动 mysql,mysql 在启动时重新加载该文件。
主人准备好了。
事情就足够了
现在在 SLAVE 上做的
,它将继续他的工作。
Ok I made it. However this solution isn't perfect/100% safe.
I've entered all filenames to my mysql-bin.index
(if you will use it check the filename format in mysql-bin.index file first and adjust to your needs)
Then restart mysql and mysql reloads that file on start.
the MASTER is ready.
Now it's enough to do
and
on SLAVE and it will continue his job.