Home  >  Q&A  >  body text

mysql主从同步改为双向同步的问题

公司项目原先配置了两台主机进行Mysql主从同步,server_a里的appdb库实时同步到server_b。:

server_a

server-id       = 1
binlog-do-db = appdb

server_b

server-id       = 2
replicate-do-db = appdb

现在出现了一个新的需求,serber_b上的appdb库里有个单独的表 appdb.userlog(只在server_b上产生数据),需要同步回server_a。
那么如果现在把server_a的master设置成server_b同步回去的话可行吗?
会不会变成一个死循环( b->a->b )?

迷茫迷茫2762 days ago682

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 14:43:53

    Have you not considered things like redis?
    Obviously a is the host, and b is the backup. The data generated on it should be something excavated when it is idle, right? I personally think it is better to store this kind of data separately, such as server-C or redis cache.

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 14:43:53

    mysql dual master synchronization

    reply
    0
  • Cancelreply