根据 CAP
Consistency - All nodes gave the same data
Availability means the ability to access the cluster even if a node in the cluster goes down.
Partition tolerance means that the cluster continues to function even if there is a "partition" (communication break) between two nodes (both nodes are up, but can't communicate).
但 Mysql 默认行为是主从或主主。
所以为了,主从
So For, Master-Master
我错过了什么吗?
最佳答案
MySQL 数据库引擎通过引入节点来平衡集群设计,从而达到 CAP 定理。
因此,当您有两 (2) 个节点时,如果两台服务器之间存在网络问题,集群将被分成 2 个分区。并且每个人将拥有成员(member)总数的 50%(1/2)。这就是为什么没有一个分区会达到法定人数,也没有一个允许查询。因此,要获得完整的分区容错性,集群设计至少需要添加第三个节点,以便您的数据库达到一次故障的分区容错性。
因此,集群 即使两个节点之间的“ 分区 ”(通信中断)(两个节点都已启动,但无法通信)仍继续运行,因为一个分区仍然有仲裁(2/3 = 66%,即大于 50%)。
关于mysql - CAP 定理 - 为什么 Mysql 是 CA,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64578822/