每次重新启动时,Cassandra节点是否会被分配一个新令牌?
根据我的有限知识,卡桑德拉(Cassandra)为环中的每个新节点分配了一个随机令牌。环位置很重要,因为根据位置将数据复制在简单的外观中。那么,当节点重新启动并想再次加入戒指时会发生什么?如果是这种情况,那么每次重新启动时,都需要将该节点中的所有数据发送到正确的位置。
From my limited knowledge, Cassandra assigns a random token for every new node in the ring. The ring position is important because data is replicated in the SimpleStrategy according to the position. So what happens when the node restarts and wants to join the ring again, will it be assigned a new token? If that's the case then all the data in that node needs to be sent to their correct place every time it restarts.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Cassandra节点首次加入集群时,只有分配了一个令牌。
当一个节点成功地引导时,它分配给令牌存储在
system.local
表中,因此它知道重新启动时拥有哪个令牌范围。所有节点还可以在内存中跟踪彼此的令牌分配,并通过八卦传播(请参阅nodetool gossipinfo
)。请注意,具有多个令牌(虚拟节点配置)的节点也适用。干杯!
Cassandra nodes only get assigned a token when they join a cluster for the very first time.
When a node has bootstrapped successfully, it's allocated token is stored in the
system.local
table so it knows which token range(s) it owns when it is restarted. All the nodes also keep track of each other's token assignments in memory and are propagated via gossip (seenodetool gossipinfo
).Note that the same applies for nodes with multiple tokens (virtual nodes configuration). Cheers!