Cassandra 节点 - 重建 vs.修理 [英] Cassandra node - rebuild v.s. repair

查看:15
本文介绍了Cassandra 节点 - 重建 vs.修理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么区别:

a) nodetool 重建

b) nodetool 修复 [-pr]

换句话说,各个命令究竟做了什么?

In other words, what exactly do the respective commands do?

推荐答案

nodetool rebuild:类似于引导过程(向集群添加新节点时),但适用于数据中心.这里的过程主要是一个从已经存活的节点到新节点的流(新节点是空的).所以定义了非常快的节点的key范围之后,剩下的就可以看作是一个复制操作.

nodetool rebuild: is similar to the bootstrapping process (when you add a new node to the cluster) but for a datacenter. The process here is mainly a streaming from the already live nodes to the new nodes (the new ones are empty). So after defining the key ranges for the nodes which is very fast, the rest can be seen as a copy operation.

nodetool repair -pr:不是复制操作,被修复的节点不为空,它已经包含数据但如果复制因子大于1,则需要将数据与其余副本上的数据进行比较如果有差异,它将被纠正.这个过程涉及很多流,但它不是数据流:被修复的节点请求一个默克尔树(基本上是一个哈希树),以验证两个节点的信息是否相同,如果不相同,它请求一个具有任何差异的数据部分的完整流(因此所有副本具有相同的数据).如果比在验证之前流式传输整个数据更快,则流式传输此哈希值,这是在假设大多数数据在两个节点上相同(除了此处和那里的一些差异之外)的情况下工作的.这个过程也会删除从数据库中删除时创建的墓碑,定义一个新的检查点",之后删除数据时会创建新的墓碑,但不再使用旧的墓碑.

nodetool repair -pr: is not a copy operation, the node being repaired is not empty, it already contains data but if the replication factor is greater than 1 that data needs to be compared to the data on the rest of the replicas and if there is a difference it will be corrected. The process involves a lot of streaming but it is not data streaming: the node being repaired requests a merkle tree (basically a tree of hashes) in order to verify if the information both nodes have is the same or not, if not it requests a full stream of the section of the data that has any difference (so all the replicas have the same data). Streaming this hashes if faster than streaming the whole data before verification, this works under the assumption that most data will be the same on both nodes except for some differences here and there. This process also removes tombstones created when deleting from the database, defining like a new "checkpoint" after which new tombstones will be created upon deletion of data, but the old ones will not be used anymore.

希望能帮到你!

这篇关于Cassandra 节点 - 重建 vs.修理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆