为了在这里测试和简单地描述问题,我使用两个节点来构建一个cassandra(2.1.11)
集群(192.168.56.110
和192.168.56.111
),现在我向这个集群添加了一个额外的节点(192.168.56.112
),我希望我的新环通过使用nodetool move
命令来平衡,但是当我使用以下脚步:
获取
192.168.56.110
的所有令牌范围,例如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.
根据文章负载均衡说:
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
命令错误,但我不知道如何理解它并平衡新集群?任何建议将被认真考虑!