以下master-master
配置適用於 MySQL Server 5.1.x(Ubuntu 10.04)。
大師1(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
##################################
大師2(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 複製的四節點集群,以實現高可用性和故障轉移。是否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 生產準備好了嗎?
是的。但看看這了解更多。