cassandra - 如何使用开始和结束令牌范围运行压缩
问题描述
我需要在一个非常大的表上运行压缩,40% 的磁盘空间是可用的,但是压缩需要很长时间并填满 100% 的磁盘然后 Cassandra 进程停止,所以我决定按开始和结束运行压缩令牌范围,我选择范围:
cassandra@cqlsh> SELECT tokens FROM system.local;
tokens
{'-1086477467151825006', '-6979941880848102278', '-9077716633074993870', '4450419032446811241', '7953145647081579725', '945723047588545683'}
当我通过指定开始和结束令牌范围运行 compact 命令时,我收到以下错误:
$nodetool repair -st -1091112185956497009 -et -1164785492893427439 main tbl_evetns
error: Repair job has failed with the error message: [2021-06-02 22:57:42,499] Requested range (-1091112185956497009,-1164785492893427439] intersects a local range ((6717615618706114838,7883825036204854784]) but is not fully contained in one; this would lead to imprecise repair. keyspace: main
-- StackTrace --
java.lang.RuntimeException: Repair job has failed with the error message: [2021-06-02 22:57:42,499] Requested range (-1091112185956497009,-1164785492893427439] intersects a local range ((6717615618706114838,7883825036204854784]) but is not fully contained in one; this would lead to imprecise repair. keyspace: main
at org.apache.cassandra.tools.RepairRunner.progress(RepairRunner.java:116)
at org.apache.cassandra.utils.progress.jmx.JMXNotificationProgressListener.handleNotification(JMXNotificationProgressListener.java:77)
解决方案
最好是nodetool ring
找到特定节点拥有的确切范围,然后发出相应的修复命令。
但实际上最好使用Reaper 工具- 它会自动进行计算,将拥有的范围拆分为子范围等。
推荐阅读
- r - 如何使用 bookdown word_document_2 包含参考文献和参考书目列表?
- python - 如何合并两个代码?
- php - 如何更改 MAMP 5.3 中的 php 版本以拥有 php 5.5.38
- angular - 字符串类型的参数不可分配给 paramMap
- node.js - Mongoose - 将文档保存到另一个模型
- assembly - 将字符串转换为数字
- javascript - JavaScript - 算法练习 - 将数组分成小部分
- kotlin - Koin 和 Room 的数据绑定
- django-rest-framework - 在处理项目的图像和文件时使用通用关系
- android - 使用 LiveData 设置 ViewModel 和使用 Retrofit 设置存储库的正确方法