所有数据库的MySQL Master-Master复制.怎么样?

前端之家收集整理的这篇文章主要介绍了所有数据库的MySQL Master-Master复制.怎么样?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
背景:在 this excellent guide之后,我在Master-Master基于行的复制(RBR)中设置了两个MysqL 5.1服务器.我希望复制所有数据库,并定期添加数据库.

目标:我希望能够通过将DB添加到其中一个服务器来向复制添加数据库;无需停止两个从站,更改配置文件,重新启动MysqL服务器,然后再次启动从站.

问:根据我的阅读,我想我可以通过在每个服务器的配置中省略任何binlog-do-db,binlog-ignore-db,replicate-do-db和replicate-ignore-db设置来实现这一点,但是我不能确定.关于如何评估Database-Table-级别复制选项的MysqL文档让我觉得根本没有办法实现这一点.

我的/etc/MysqL/my.cnf文件的相关部分复制如下.我是在正确的轨道上吗?我想要的甚至可能吗?

硕士1:

[MysqLd]
binlog-format = row
server-id = 1
replicate-same-server-id = 0
auto-increment-increment = 2
auto-increment-offset = 1

master-host = <master2_ip>
master-user = slave_user
master-password = <password>
master-connect-retry = 60

log-bin = /var/log/MysqL/MysqL-bin.log
relay-log = /var/lib/MysqL/slave-relay.log
relay-log-index = /var/lib/MysqL/slave-relay-log.index
expire_logs_days = 14
max_binlog_size = 2048M

硕士2:

[MysqLd]
binlog-format = row
server-id = 2
replicate-same-server-id = 0
auto-increment-increment = 2
auto-increment-offset = 2

master-host = <master1_ip>
master-user = slave_user
master-password = <password>
master-connect-retry = 60

log-bin = /var/log/MysqL/MysqL-bin.log
relay-log = /var/lib/MysqL/slave-relay.log
relay-log-index = /var/lib/MysqL/slave-relay-log.index
expire_logs_days = 14
max_binlog_size = 2048M

解决方法

这就是我为两位大师所做的
log-bin = MysqLd-bin
binlog-ignore-db=test
binlog-ignore-db=information_schema
binlog-ignore-db=MysqL
log-slave-updates
replicate-ignore-db=test
replicate-ignore-db=information_schema
replicate-ignore-db=MysqL
relay-log=MysqLd-relay-bin

猜你在找的MsSQL相关文章