有哪些选项可以加快对Cassandra的全面修复? [英] What options are there to speed up a full repair in Cassandra?

查看:102
本文介绍了有哪些选项可以加快对Cassandra的全面修复?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Cassandra数据中心,我想对其进行全面维修。数据中心用于分析/批处理,我愿意牺牲延迟以加快全面修复的速度( nodetool修复)。

I have a Cassandra datacenter which I'd like to run a full repair on. The datacenter is used for analytics/batch processing and I'm willing to sacrifice latencies to speed up a full repair (nodetool repair). Writes to the datacenter is moderate.

我有什么选择可以使完整修复更快?一些想法:

What are my options to make the full repair faster? Some ideas:


  • 增加 streamthroughput

  • 我想我可以禁用自动压缩功能并暂时删除 compactionthroughput 。但是,不确定我是否愿意...

  • Increase streamthroughput?
  • I guess I could disable autocompation and decrase compactionthroughput temporarily. Not sure I'd want to that, though...

其他信息:


  • 我正在运行SSD,但是没有花任何时间调整 cassandra.yaml

  • I'm running SSDs but haven't spent any time adjusting cassandra.yaml for this.

推荐答案

默认情况下,按顺序完整修复。节点数据集的状态和差异存储在二叉树中。重新创建这些是这里的主要因素。根据此datastax博客条目,每次进行修复,必须计算树,修复中涉及的每个节点都必须从存储的所有稳定表构造其merkle树,从而使计算非常昂贵。

Full repairs are run sequentially by default. The state and differences of the nodes' datasets are stored in binary trees. Recreating these is the main factor here. According to this datastax blog entry, "Every time a repair is carried out, the tree has to be calculated, each node that is involved in the repair has to construct its merkle tree from all the sstables it stores making the calculation very expensive."

我看到显着提高完全修复速度的唯一方法是以 parallel 方式运行或修复 subrange by subrange 。您的标签表明您运行了Cassandra 2.0。

The only way I see to significantly increase the speed of a full repair is to run it in parallel or repair subrange by subrange. Your tag implies that you run Cassandra 2.0.

1)并行完全修复

 nodetool repair -par, or --parallel, means carry out a parallel repair.

根据 Cassandra 2.0的nodetool文档


不同于顺序修复(如上所述),并行修复可同时为所有节点构造Merkle表。因此,不需要(或生成)快照。使用并行修复来快速完成修复,或者在出现操作性停机的情况下允许在修复期间完全消耗资源。

Unlike sequential repair (described above), parallel repair constructs the Merkle tables for all nodes at the same time. Therefore, no snapshots are required (or generated). Use a parallel repair to complete the repair quickly or when you have operational downtime that allows the resources to be completely consumed during the repair.

2)子范围修复
nodetool接受像这样的开始和结束令牌参数

2) Subrange repair nodetool accepts start and end token parameters like so

 nodetool repair -st (start token) -et (end token) $keyspace $columnfamily

为简单起见,请检查出这个为您计算令牌并执行范围修复的python脚本:
https://github.com/ BrianGallew / cassandra_range_repair

For simplicity sake, check out this python script that calculates tokens for you and executes the range repairs: https://github.com/BrianGallew/cassandra_range_repair

让我指出两个备选方案:

Let me point out two alternative options:

A)Jeff Jirsa指出

A) Jeff Jirsa pointed to incremental repairs.

这些功能可从Cassandra 2.1开始使用。您需要先执行某些迁移步骤,可以这样使用nodetool:

These are available starting with Cassandra 2.1. You will need to perform certain migration steps before you can use nodetool like this:

nodetool repair -inc, or --incremental means do an incremental repair.

B) OpsCenter维修服务

对于我公司 itembase.com 中的几个集群,我们使用 DataStax OpsCenter中的维修服务,用于执行和管理小范围维修作为服务。

For the couple of clusters at my company itembase.com, we use the repair service in DataStax OpsCenter which is executing and managing small range repairs as a service.

这篇关于有哪些选项可以加快对Cassandra的全面修复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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