检测数据/节点分区错误

发布于 2024-07-19 07:27:16 字数 484 浏览 3 评论 0原文

上次我看到数据/分区节点错误是因为我启动了 erlang shell,它通过 cookies 等连接到同一 CPU 上的节点。启动后,shell 立即将分区错误转储到屏幕上。 这太麻烦了……

  1. 我该如何捕获这个异常?
  2. 如何以编程方式修复异常? (在另一个问题中问)
  3. 我如何防止这种异常?

[更新] 我有两个盒子正在运行我的 Yaws 应用程序。 数据库通过 Mnesia 的 extra_db_node 功能进行复制。 在服务器运行后的某个时间,我登录到其中一个盒子并使用不同的 sname 和相同的 cookie 启动“erl”,以便 3 个节点可以进行通信。 shell 稳定并显示 shell 提示符后不久...屏幕上会显示一个复杂的元组,表明存在网络分区错误。 此消息似乎是控制台转储,而不是可能被我的雅司病应用程序捕获的异常...但我希望我的雅司病应用程序能够检测到错误并采取纠正措施。

The last time I saw a data/partition node error it was because I launched the erlang shell which connected to the node on the same CPU via cookies etc. Immediately after startup the shell dumped the partition error on the screen. This is terribly bothersome....

  1. how do I trap this exception?
  2. how do I repair the exception programatically? (asked in another question)
  3. how do I prevent this exception?

[update] I have two boxes that are running my Yaws application. The databases are replicated via Mnesia's extra_db_node feature. At some time after the servers are running I log into one of the boxes and launch 'erl' with a different sname and same cookie so that the 3 nodes can communicate. Shortly after the shell stabilizes and the shell prompt is displayed... a complex tuple is displayed on the screen indicating that there is a network partition error. This message appears to be a console dump rather than an exception that could be trapped by my yaws applications... but I want my yaws applications to detect the error and take corrective action.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文