我有 2 台 CentOS 5.5 服务器运行 Mysql 5.5,配置为主-主复制。当我在一台服务器上遇到网络问题时,我在另一台服务器上的日志中看到以下消息:
111105 2:38:30 [注意] 停止异步 binlog_dump 到从属(server_id:2)
当网络问题消失时,复制不会自动恢复,但会在一小时后开始:
111105 3:37:41 [Note] Start binlog_dump to slave_server(2), pos(mysql-bin.000157, 344487149)
111105 3:37:41 [Note] Start asynchronous binlog_dump to slave (server_id: 2), pos(mysql-bin.000157, 344487149)
我认为它只是配置了计时器,但是哪一个?以下是 mysql 配置:
serv-01:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
symbolic-links=0
plugin-load=archive=ha_archive.so;blackhole=ha_blackhole.so
#Replication
old_passwords=1
log-bin=/var/lib/mysql/mysql-bin
expire_logs_days=3
binlog-do-db=roomserv
binlog-do-db=asterisk
binlog-ignore-db=mysql
binlog-ignore-db=information_schema
server-id=1
auto_increment_increment= 2
auto_increment_offset = 1
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
服务-02:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
symbolic-links=0
#Replication
old_passwords=1
server-id=2
log-bin=/var/lib/mysql/mysql-bin
expire_logs_days=3
binlog-do-db=roomserv
binlog-do-db=asterisk
binlog-ignore-db=mysql
binlog-ignore-db=information_schema
#auto increment id offset
auto_increment_increment= 2
auto_increment_offset = 2
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
答案1
MySQL 5.5 中的复制有几处变化。其中之一是主心跳。
看: http://blogs.oracle.com/MySQL/entry/mysql_55_whats_new_in_replication
但是,我并不认为这是你的问题。鉴于这些事件的凌晨时间戳是它们的备份、cron 作业或其他服务重启,可能会触发此问题?
我想知道新的半同步方法是否会在主-主设置中引起问题。
更多详情请参见此处: http://dev.mysql.com/doc/refman/5.5/en/replication-semisync.html