让MySQL数据库复制始终使用最空闲的节点?
我们开始使用 MySQL 的多主复制管理器,我想知道是否可以像多对称处理一样对待这个设置:一个进程从进程队列中弹出,节点(在本例中是服务器)是大多数空闲的人被选来从事这项工作。
似乎发生的情况是,只有当 mysqld 崩溃或消失时,该服务才会切换到从属服务。
有没有一种方法可以让 MySQL 的数据库复制以更加分布式的方式进行?也许除了MMM之外还有其他软件可以做到这一点?
当 mysqld 速度变慢时(而不仅仅是当它失败时),有没有办法将读取器角色切换到另一台服务器?
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 process 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)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用Mysql多主复制,在一般情况下写入任意节点是不安全的。这是因为它是异步的。
始终写入同一节点。我的意思是永远。仅当您确定另一个节点已关闭时才写入另一个节点,并且您确定在它关闭之前整个二进制日志已被处理。
实际上,这意味着始终写入一个节点。
无论如何,在多个节点之间分散写入不会提高写入性能,因为无论如何两个节点都必须执行所有写入操作。
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.