MySql 复制场景
我在定义复制和同步不同 mysql 服务器中的某些信息的最佳方法时遇到问题。
让我解释一下:
实际场景:
服务器 A
-表A1(读/写)操作
-表A2(读/写)操作
服务器B
-表 B1 (写入)操作
所需场景:
服务器 A
-表A1(读/写)操作
-表A2(读/写)操作
-表复制 B1 (读取)操作
服务器 B
-表B1(写入)操作
-表 A1 复制(读取)操作
-表 A2 复制(读取)操作
我应该如何定义我的 mysql 复制配置?
我应该将两台服务器定义为Master吗?
问候,
佩德罗
I have a problem defining the best way to replicate and synchronize some information that I have in different mysql servers.
Let me explain:
Actual Scenario:
Server A
-Table A1 (read/write) Operations
-Table A2 (read/write) Operations
Server B
-Table B1 (write) Operations
Desired Scenario:
Server A
-Table A1 (read/write) Operations
-Table A2 (read/write) Operations
-Table replicated B1 (read) Operations
Server B
-Table B1 (write) Operations
-Table A1 replicated (read) Operations
-Table A2 replicated (read) Operations
How should I define my mysql replication configuration?
Should I define the two servers as Master?
Regards,
Pedro
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 MySQL 进行此类复制。 请查看以下内容 从属选项
replicate-do-db
replicate-ignore-db
replicate-do-table
replicate-ignore-表
replicate-ignore-table
replicate-wild-do-table
replicate-wild-ignore-table
和 相应的注释。 使用这些选项,您可以将两台服务器设置为相互从属服务器并限制要复制的表(数据库)。 由于 MySQL 无法进行多主复制,因此您必须确保所有写入都定向到正确的服务器,并且没有任何内容写入复制表中。
You can do this kind of replication with MySQL. Please have a look at the following slave options
replicate-do-db
replicate-ignore-db
replicate-do-table
replicate-ignore-table
replicate-ignore-table
replicate-wild-do-table
replicate-wild-ignore-table
and the corresponding annotations. With these options you can setup both servers to be mutual slaves and restrict the tables (databases) to be replicated. As MySQL is not able to do a multi-master replication you have to ensure that all writes are directed to the correct server and that nothing gets written into replicated tables.