环形 sql 主从同步, 3 台机子挂掉其中一台该怎么办

2020-07-24 20:09:34 +08:00
 autoname

a 是 b 的主 b 是 c 的主 c 是 a 的主

那么随便挂掉一台,

是不是就凉凉了。。。

有解决方案吗。

3 个项目都有读写需求,

无法做主从,

只能做主主

1114 次点击
所在节点    MySQL
1 条回复
JasonLaw
2020-08-05 22:43:39 +08:00
在“Designing Data-Intensive Applications - CHAPTER 5 Replication - Multi-Leader Replication - Multi-Leader Replication Topologies”中,介绍了三种不同 replication topologies:1. circular topology 2. star topology 3. all-to-all topology 。

它说“A problem with circular and star topologies is that if just one node fails, it can interrupt the flow of replication messages between other nodes, causing them to be unable to communicate until the node is fixed. The topology could be reconfigured to work around the failed node, but in most deployments such reconfiguration would have to be done manually. The fault tolerance of a more densely connected topology (such as all-to-all) is better because it allows messages to travel along different paths, avoiding a single point of failure.”,也就是说如果你继续采用 circular topology 的话,如果其中一个节点失败了,你可以重新配置 topology,你也可以选择容错性更好的 all-to-all topology 。

当然不同的 topologies 都有各自的优缺点,具体的话,你可以看一下“Designing Data-Intensive Applications”这本书。

顺便说一下,你这个根本不是主从同步,而是 Multi-Leader Replication 。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/692894

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX