在同一台机器上发生硬件故障后更换 Cassandra 种子节点?
我有两个虚拟机,每个虚拟机托管一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,种子节点在加入时不会流动。我的建议是从
cassandra.yaml
的seeds
中删除其 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 thecassandra.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 runnodetool disablebinary
on it to prevent that (and of course re-enable it when done).