Mnesia聚类

发布于 2024-09-30 15:41:14 字数 242 浏览 8 评论 0 原文

如果我将 2 个节点聚集在一起,通过我的实验和在线阅读,我了解到节点 A 将类似于“主”节点,节点 B 将复制表(如果我愿意)。 (否则它只会远程访问它们。)

如果节点 B 出现故障会发生什么?它只是重新复制自上次以来更改过的数据吗?

如果节点 A 宕机也会发生什么。节点B还能用吗?如果是这样,如果节点 B 上的数据发生更改,节点 A 是否会将其复制到自身?到目前为止我的理解是节点 A 并不关心节点 B 说什么,但请有人告诉我我错了。

If I am clustering 2 nodes together, from my experimenting and reading up online I understand that Node A will be like a "master" node and Node B will copy the tables over if I want them to. (Otherwise it will just access them remotely.)

What happens though if Node B goes down? Does it just recopy the data that's been changed since it was last up?

Also what happens if Node A goes down. Is Node B still usable? If so, if data is changed on Node B, does Node A copy it over to itself? My understanding so far is that Node A doesn't care about what Node B says, but someone please tell me I'm wrong.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清秋悲枫 2024-10-07 15:41:14

由于接受的答案是仅链接的答案,我想我会为任何过来的人记录这一点:

  1. Mnesia 并不能通过主次架构来正常工作。相反,一些节点具有数据的本地副本,一些节点具有远程副本。 (您可以通过从控制台运行 mnesia:info() 来查看这一点。有一个 remote 表列表,以及每个本地表的列表:< code>ram_copies、disc_copiesdisc_only_copies。)
  2. 如果节点发生故障,只要存在某个具有本地副本的表,涉及该表的操作就会被执行。美好的。
  3. Mnesia 的缺点之一是它容易受到网络分区事件的影响。如果您的集群中两个节点之间的网络连接出现故障,那么每个节点都会认为另一个节点已关闭,并继续写入数据。从中恢复是很复杂的。但在更常见的情况下,如果一个节点出现故障,则具有本地数据副本的节点会继续运行,并且当故障节点恢复时,它会与集群同步。

Since the accepted answer is a link only answer, figured I would document this for anyone who comes along:

  1. Mnesia doesn't quite work by having a primary-secondary architecture. Instead, some nodes have local copies of data, and some have remote copies. (You can see this by running mnesia:info() from the console. There is a list of remote tables, and a list for each of the local-tables: ram_copies,disc_copies and disc_only_copies.)
  2. If a node goes down, as long as there is some table with a local copy, operations involving that table are fine.
  3. One of the down-sides with Mnesia is that it is subject to network partition events. If in your cluster the network connection between two nodes goes bad, then each one will think that the other node is down, and continue to write data. Recovery from this is complicated. In the more mundane case though, if one node goes down, then nodes with local copies of data continue along, and when the down-node recovers, it syncs back up with the cluster.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文