在同一台机器上发生硬件故障后更换 Cassandra 种子节点?

发布于 2025-01-09 13:39:04 字数 900 浏览 0 评论 0原文

我有两个虚拟机,每个虚拟机托管一个 Cassandra 种子节点。我擦除一台虚拟机来模拟硬件故障。 cassandra-env.sh 文件末尾添加 replace_address_first_boot(使用我的真实 IP 地址)

 JVM_OPTS="$JVM_OPTS -Dcassandra.replace_address_first_boot=1.1.1.1"

我重新安装 Cassandra 并在其他计算机列表上的 nodetool status这台机器作为 DN

cassandra.yaml 显示默认值 auto_bootstrap: true

然而,Cassandra 启动失败并显示:

ERROR [main] 2022-02-24 01:43:36,546 CassandraDaemon.java:803 - Exception encountered during startup
java.lang.RuntimeException: Replacing a node without bootstrapping risks invalidating consistency guarantees as the expected data may not be present until repair is run. To perform this operation, please restart with -Dcassandra.allow_unsafe_replace=true      

How can I bootstrap即使新的种子机具有与旧种子机相同的 IP 地址,但不使用 unsafe 标志?

I have two VMs, each hosting a Cassandra seed node. I wipe one VM to simulate a hardware failure. I reinstall Cassandra and add replace_address_first_boot the end of the cassandra-env.sh file (with my real ipaddress)

 JVM_OPTS="$JVM_OPTS -Dcassandra.replace_address_first_boot=1.1.1.1"

nodetool status on the other machine lists this machine as DN

cassandra.yaml displays the default value of auto_bootstrap: true

Yet, Cassandra startup fails with:

ERROR [main] 2022-02-24 01:43:36,546 CassandraDaemon.java:803 - Exception encountered during startup
java.lang.RuntimeException: Replacing a node without bootstrapping risks invalidating consistency guarantees as the expected data may not be present until repair is run. To perform this operation, please restart with -Dcassandra.allow_unsafe_replace=true      

How can I bootstrap the new seed machine even though it has the same ipaddress as the old seed machine without using an unsafe flag?

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

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

发布评论

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

评论(1

只想待在家 2025-01-16 13:39:04

不幸的是,种子节点在加入时不会流动。我的建议是从 cassandra.yamlseeds 中删除其 IP。然后加入后应该就没问题了。

如果您仍然希望它成为种子节点,您可以随时使用其自己的 IP 编辑其 seeds 属性,并在引导完成后重新启动。

否则,如果您可以启动替换节点(无需引导),则始终可以运行 nodetool Repair 来传输数据。但这里的缺点是,节点将尝试在此过程中处理请求,因此您可能需要在其上运行 nodetool disablebinary 来防止这种情况发生(当然, - 完成后启用它)。

Unfortunately, seed nodes don't stream upon joining. My advice would be to remove its IP from the seeds in the cassandra.yaml. Then upon joining, it should be fine.

If you still want it to be a seed node, you can always edit its seeds property with its own IP and restart once bootstrapping is complete.

Otherwise, if you can get the replacement node to start (without bootstrapping), you can always run a nodetool repair to stream the data. The drawback here though, is that the node will try to serve requests during this process, so you may want to run nodetool disablebinary on it to prevent that (and of course re-enable it when done).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文