以下master-master
配置适用于 MySQL Server 5.1.x(Ubuntu 10.04)。
Master1(192.168.2.80)
##################################
#MySQL Replication
##################################
skip-host-cache
skip-name-resolve
event_scheduler = ON
max_connections = 500
max_connect_errors = 1000
server-id = 10
replicate-same-server-id = 0
auto-increment-increment = 10
auto-increment-offset = 1
master-host = 192.168.2.81
master-user = repli
master-password = secret
master-connect-retry = 60
binlog-format = MIXED
#binlog-ignore-db = information_schema
#binlog-ignore-db = lb1
#max_binlog_size = 500M
log-bin = /var/log/mysql/mysql-bin
log-bin-index = /var/log/mysql/bin-log.index
log-slave-updates
report-host = 192.168.2.80
replicate-ignore-db = information_schema
replicate-ignore-db = lb2
replicate-ignore-db = performance_schema
relay_log_space_limit = 3G
relay-log = /var/log/mysql/relay.log
relay-log-index = /var/log/mysql/relay-log.index
##################################
Master2(192.168.2.81)
##################################
#MySQL Replication
##################################
skip-host-cache
skip-name-resolve
event_scheduler = ON
max_connections = 500
max_connect_errors = 1000
server-id = 20
replicate-same-server-id = 0
auto-increment-increment = 10
auto-increment-offset = 2
master-host = 192.168.2.80
master-user = repli
master-password = secret
master-connect-retry = 60
binlog-format = MIXED
#binlog-ignore-db = information_schema
#binlog-ignore-db = lb2
#max_binlog_size = 500M
log-bin = /var/log/mysql/mysql-bin
log-bin-index = /var/log/mysql/bin-log.index
log-slave-updates
report-host = 192.168.2.81
replicate-ignore-db = information_schema
replicate-ignore-db = lb1
replicate-ignore-db = performance_schema
relay_log_space_limit = 3G
relay-log = /var/log/mysql/relay.log
relay-log-index = /var/log/mysql/relay-log.index
##################################
现在它无法与 MySQL Server 5.5(ubuntu 12.04)配合使用。我的意思是说,当我使用上述配置重新启动 mysql 服务时,mysql 服务需要很长时间才能启动,而且根本无法启动。mysql 日志中没有任何内容,而且为空。我尝试终止 mysql 并重新启动它,但它仍然无法启动,如果我删除上述复制配置,它就会正常启动。
我在使用 mysql 5.5 时出了什么问题?我计划在 Ubuntu 服务器上设置一个带有 mysql 复制的四节点集群,以实现 HA 和故障转移。是否Ubuntu 12.04
推荐MySQL 5.5
用于生产?
需要您的意见。谢谢!
更新 1
master-*
在两个主服务器上注释掉以下几行之后,MySQL 可以正常启动并且复制可以正常工作。
#master-host = 192.168.2.xx
#master-user = repli
#master-password = secret
#master-connect-retry = 60
那么如何在从属服务器上指定主服务器?CHANGE MASTER TO MASTER_HOST='192.168.2.xx', MASTER_USER='repli', MASTER_PASSWORD='secret',...
够了吗?MySQL 5.5.24 和 ubuntu 12.04 是否已准备好投入生产?
答案1
我的意思是说,当我使用上述配置重新启动 mysql 服务时,mysql 服务需要很长时间才能启动,甚至根本无法启动。mysql 日志中没有任何内容,为空。
您是否指定log-error
选项中/etc/my.cnf
?
master-*
在两个主服务器上注释掉以下几行之后,MySQL 正常启动并且复制工作正常。#master-host = 192.168.2.xx #master-user = repli #master-password = secret #master-connect-retry = 60
那么如何指定主服务器和从服务器呢?
CHANGE MASTER TO MASTER_HOST='192.168.2.xx', MASTER_USER='repli', MASTER_PASSWORD='secret',...
够了吗?
这master-*
在 MySQL 5.5 中,选项已被删除。当然,CHANGE MASTER TO
这已经足够了,因为值已保存到master.info
文件中。
MySQL 5.5.24 和 ubuntu 12.04 可以投入生产了吗?
是的。但看看这了解更多信息。