1

虚拟节点是 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
.....

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

4

1 回答 1

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
于 2013-08-13T08:34:24.127 回答