开发者

Make MySQL database replication always use the most free node?

开发者 https://www.devze.com 2022-12-22 12:08 出处:网络
We started using Multi-Master Replication Manager for MySQL, and I am wondering whether it is possible to to treat this setup like multi-symmetric processing: a pro开发者_Python百科cess pops off the p

We started using Multi-Master Replication Manager for MySQL, and I am wondering whether it is possible to to treat this setup like multi-symmetric processing: a pro开发者_Python百科cess pops off the process queue, and the node (in this case a server) that is most free is selected for the job.

It seems that what happens is, the service switches to a slave ONLY when it mysqld crashes or goes away.

Is there a way to make database replication for MySQL act in more of a distributed manner? Maybe there is other software besides MMM that can do this?

Is there a way to switch the reader role to another server when mysqld slows down (rather than just when it fails)?


With Mysql multi-master replication it is not safe to write to arbitrary nodes in the general case. This is because it is asynchronous.

Always write to the same node. I mean ALWAYS. Only ever write to the other node if you're sure it's down, and you're sure that before it went down, the whole binlog was processed.

In practice this means always write to one node.

In any case, spreading the writing between several nodes will do nothing to increase write performance as both nodes must do all the writes anyway.

0

精彩评论

暂无评论...
验证码 换一张
取 消