Cassandra nodetool修复究竟做了什么? [英] What does Cassandra nodetool repair exactly do?

查看:546
本文介绍了Cassandra nodetool修复究竟做了什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://docs.datastax.com/en /cassandra/2.0/cassandra/operations/ops_repair_nodes_c.html 我知道


nodetool修复命令修复所有

The nodetool repair command repairs inconsistencies across all of the replicas for a given range of data.




  • 但是如何解决这些不一致的问题呢?它写的是使用Merkle树 - 但这是为了比较而不是修复'破碎'的数据。

  • 数据如何破碎?尽管硬盘驱动器出现故障,仍然有任何常见情况?

  • 问题放在一边:压缩驱动了墓碑,对吗?因此,运行nodetool修复比gc_grace秒更频繁的要求只是为了确保所有数据传播到适当的副本?

    Question aside: it's compaction which evicts tombstones, right? So the requirement for running nodetool repair more frequently than gc_grace seconds is only to ensure that all data is spread to appropriate replicas? Shouldn't be that the usual scenario?

    推荐答案

    每当对副本的写入没有完成时,数据可能会变得不一致原因。如果节点已关闭,如果节点已关闭,但网络连接已关闭,如果队列已填满,写入已丢失,磁盘故障等,则可能会发生此情况。

    The data can become inconsistent whenever a write to a replica is not completed for whatever reason. This can happen if a node is down, if the node is up but the network connection is down, if a queue fills up and the write is dropped, disk failure, etc.

    当通过比较merkle树检测到不一致的数据时,通过从具有较新数据的节点流式传输它们来修复数据的坏区段。 Streaming是Cassandra中的一个基本机制,也用于将空节点引导到集群中。

    When inconsistent data is detected by comparing the merkle trees, the bad sections of data are repaired by streaming them from the nodes with the newer data. Streaming is a basic mechanism in Cassandra and is also used for bootstrapping empty nodes into the cluster.

    您需要在gc grace秒内运行修复的原因是,tombstones被同步到所有节点。如果一个节点缺少一个墓碑,那么它在压缩过程中不会丢弃该数据。具有墓碑的节点将在压缩期间丢弃数据,然后当它们稍后运行修复时,可以从缺少墓碑的节点复活已删除的数据。

    The reason you need to run repair within gc grace seconds is so that tombstones will be sync'd to all nodes. If a node is missing a tombstone, then it won't drop that data during compaction. The nodes with the tombstone will drop the data during compaction, and then when they later run repair, the deleted data can be resurrected from the node that was missing the tombstone.

    这篇关于Cassandra nodetool修复究竟做了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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