问题原文
原帖链接 · dlo · CC BY-SA 3.0
I have master-master replication set up on 2 Debian servers, and they replicate everything, including the mysql database itself (so that new users and such also replicate). This generally works very well, except that most, if not all, apt upgrades to mysql involve some changes to the mysql database schema, which cause replication errors that halt replication. Ultimately, I always need to manually fix by skipping the errant statements on each side. This is always time-consuming, and I worry I could make mistakes doing it manually (skipping too many statements, mistyping CHANGE MASTER details, etc.).
Is there something I can do to make sure that apt-get updates to MySQL in the future will get processed smoothly without causing replication problems? Surely there's a well-established best practice for this?
已采纳解答
原帖链接 · dlo · CC BY-SA 3.0
I don't know if it will work for every possible upgrade scenario, but I just tested this, and the upgrade worked without any replication problems:
# /etc/mysql/conf.d/binlog_ignoredb_mysql.cnf.disabled
# Rename this to end in .cnf prior to performing `apt-get upgrade`.
# Otherwise, its attempts to `ALTER TABLE users` will cause replication errors.
# After upgrade is complete, rename back to .disabled and then /etc/init.d/mysql restart
[mysqld]
binlog-ignore-db=mysql
Note that my test was on a minor upgrade (5.5.41 to 5.5.43).
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
