知道虚拟节点设置下的Cassandra集群中哪个真实节点已启动

时间:2013-08-13 08:02:42

标签: cassandra nodetool

虚拟节点是Cassandra中一个功能强大的设置,它减轻了为每个节点分配正确的初始令牌的负担,但有时我发现在读取nodetool ring的输出时很痛苦,其中每个节点由吨数描述线。例如:

node-1  155         Up     Normal  228.55 KB       8.31%               7196378057413163154
node-1  155         Up     Normal  228.55 KB       8.31%               7215375135797395653
node-1  155         Up     Normal  228.55 KB       8.31%               7299851409832649823
node-1  155         Up     Normal  228.55 KB       8.31%               7361899028342316034
node-1  155         Up     Normal  228.55 KB       8.31%               7470359832465044920
node-1  155         Up     Normal  228.55 KB       8.31%               7631123206720404219
node-1  155         Up     Normal  228.55 KB       8.31%               7675034684873781539
node-1  155         Up     Normal  228.55 KB       8.31%               7871044212864174985
node-1  155         Up     Normal  228.55 KB       8.31%               7888407753199222932
node-1  155         Up     Normal  228.55 KB       8.31%               7916197345035903777
node-1  155         Up     Normal  228.55 KB       8.31%               7940203367286725631
node-1  155         Up     Normal  228.55 KB       8.31%               7981190016602200507
node-1  155         Up     Normal  228.55 KB       8.31%               8015518064513163806
node-1  155         Up     Normal  228.55 KB       8.31%               8018007479871405889
.....

如果我的目标只是简单地知道哪个真实节点已经启动,以及每个真实节点拥有多少数据,我能知道该怎么做吗?

1 个答案:

答案 0 :(得分:2)

您应该使用nodetool status,每个节点只输出一行,例如

$ bin/nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address    Load       Tokens  Owns   Host ID                               Rack
UN  127.0.0.1  152.64 KB  256     100.0%  22f70e40-4070-483a-9fa6-e272556b7164  rack1