背景:在
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