MySQL复制是双向的 [英] MySQL replication be bi-directional

查看:79
本文介绍了MySQL复制是双向的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经成功建立了MySQL文献中描述的主从复制.

We have successfully set up a Master-Slave replication as described in MySQL literature.

但是,我很好奇是否有人设置了双向复制.例如,如果有人安装了Drupal或Wordpress.第一台(主服务器")数据库服务器关闭,而第二台(从属服务器")启动.一直以来,用户继续进行编辑,写入新数据.重新启动第一个数据库服务器后,可以将写入第二个数据库的更改向上复制到第一个数据库吗?

However, I'm curious if anyone has set up a bidirectional replication. For example, if one has a Drupal or Wordpress installation. The first ('master') database server goes down, and the secondary ('slave') picks up. All the while, users continue to make edits, writing new data. When the First database server is restarted, can changes written to the Second be replicated upward to the First?

也就是说,除了主从服务器之外,还有其他复制策略吗?

That is: are there other replication strategies than only the Master-Slave?

推荐答案

您可以执行主-主复制.不幸的是,Drupal或Wordpress均不支持.最好的办法是从站或从站,如果原先的主站掉线,则将链中的第一个从站设为新的主站.然后将旧的主服务器重新配置为从新的主服务器(或链中的最后一个从服务器)关闭.

You can do Master-Master replication. Unfortunately, Neither Drupal or Wordpress support this. The best thing to do is Master-Slave or Master-Slave-Slave, then make the first slave in the chain the new Master if the original master goes down. Then reconfigure the old Master to slave off the new Master (or last slave in the chain).

您的mysql服务器多长时间关闭一次?

How often does your mysql server go down?

这篇关于MySQL复制是双向的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆