如何访问新容器中的 Cassandra docker 卷?
更新我的 Cassandra docker 容器后,出现以下错误:
CassandraDaemon.java:911 - 致命配置错误 org.apache.cassandra.exceptions.ConfigurationException:无法将令牌数量从 256 更改为 16
我正在使用 cassandra:最新图像,并且可能更新了其版本,之后每次我尝试再次运行它时,服务器都会关闭。有什么想法吗?
After update my Cassandra docker container it raised the following error:
CassandraDaemon.java:911 - Fatal configuration error
org.apache.cassandra.exceptions.ConfigurationException: Cannot change the number of tokens from 256 to 16
I am using cassandra:latest image, and probably its updated its version, and after that the server shutdown every time I try to run it again. Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
用户在 https://community.datastax.com/questions/13536/ 我在这里重新发布我的答案。
我们不建议将 Cassandra 容器更新到较新的版本。 Cassandra 4.0+ 预先配置了 一个新的默认 16 个虚拟节点 (CASSANDRA-13701):
旧版本的 Cassandra 默认值为 256。一旦 Cassandra 加入集群,就无法更改分配给节点的令牌数量(即使是单个节点) - 节点集群)。正如您已经发现的,更改分配的令牌将阻止 Cassandra 启动。
您需要编辑
cassandra.yaml
才能允许 Cassandra 启动。如果您将容器命名为cassandra
:您可以使用以下命令查看 cassandra 容器的配置:
您将看到配置目录设置为:
制作配置文件的本地副本:
编辑本地副本,然后复制容器的修改版本为:
干杯!
The user asked the same question on https://community.datastax.com/questions/13536/ and I'm re-posting my answer here.
We do not recommend updating a Cassandra container to a newer version. Cassandra 4.0+ is pre-configured with a new default of 16 virtual nodes (CASSANDRA-13701):
Older versions of Cassandra had a default of 256. It is not possible to change the number of tokens allocated to a node once Cassandra has joined a cluster (even for single-node clusters). As you have already discovered, changing the allocated tokens will prevent Cassandra from starting.
You will need to edit the
cassandra.yaml
in order to allow Cassandra to start. Provided you named your containercassandra
:you can view the cassandra container's configuration with:
and you will see that the configuration directory is set to:
Make a local copy of the configuration file:
Edit your local copy then copy the modified version to the the container with:
Cheers!
Cassandra允许最小令牌数量为256,因此只需将cassandra.yaml中的num_tokens修改为256或更高的值,然后重新启动Cassandra
Cassandra allow the min token number is 256, so just modify num_tokens to 256 or higher value in cassandra.yaml, then restart Cassandra