1

为了在这里测试和简单地描述问题,我使用两个节点来构建一个cassandra(2.1.11)集群(192.168.56.110192.168.56.111),现在我向这个集群添加了一个额外的节点(192.168.56.112),我希望我的新环通过使用nodetool move命令来平衡,但是当我使用以下脚步:

  1. 获取192.168.56.110的所有令牌范围,例如981588427421702712 -- 1007755089748978774

  2. 获取新节点的所有token范围,如5458173168911717635 -- 5458821955945522089

  3. 我执行了命令:

     [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命令错误,但我不知道如何理解它并平衡新集群?任何建议将被认真考虑!

4

1 回答 1

0

因此,您将设置 num_tokens 更改为 512。启动新节点后,您应该记住种子节点不会自动引导,但其他节点在启动后会平衡数据。要平衡种子节点,您应该为您的节点运行 nodetool repair。时间取决于数据大小。

于 2016-01-27T21:30:30.690 回答