【发布时间】:2016-01-28 05:30:30
【问题描述】:
为了在这里测试和简单描述问题,我使用两个节点构建了一个cassandra(2.1.11) 集群(192.168.56.110 和192.168.56.111),现在我向这个集群添加了一个额外的节点(192.168.56.112),然后我希望我的新戒指通过使用nodetool move 命令平衡,但是当我使用以下步骤时:
获取
192.168.56.110的所有token范围,如981588427421702712 -- 1007755089748978774获取新节点的所有token范围,如
5458173168911717635 -- 5458821955945522089-
我执行了命令:
[root@test-1 pengcz]# ../cassandra-2.1.11/bin/nodetool -h 192.168.56.110 -u admin -pw admin4587 move 5458173168911717635 error: target token 5458173168911717635 is already owned by another node. -- StackTrace -- java.io.IOException: target token 5458173168911717635 is already owned by another node.根据Load balancing的文章说:
If you add nodes to your cluster your ring will be unbalanced and only way to get perfect balance is to compute new tokens for every node and assign them to each node manually by using nodetool move command.,我觉得我好像理解nodetool move命令错误,但是不知道怎么理解和平衡新集群?任何建议将被认真考虑!
【问题讨论】:
-
你在使用虚拟节点吗? (cassandra.yaml 中设置的 num_tokens 值)。如果是,则根本不需要使用 nodetool move
-
@doanduyhai,谢谢!是的,我设置了
num_tokens: 512,所以 -
@doanduyhai,谢谢!你的回答让我确信我不需要手动重新平衡我的集群,因为我在
cassandra.yaml中设置了num_tokens: 512。在我设置配置并启动新节点的 cassandra 后,余额会自动消失吗?唯一的问题是余额需要很长时间