【问题标题】:How run compaction on using start and end token range如何使用开始和结束令牌范围运行压缩
【发布时间】:2021-08-21 04:59:13
【问题描述】:

我需要在一个非常大的表上运行压缩,40% 的磁盘空间是可用的,但是压缩需要很长时间并且填满 100% 的磁盘然后 Cassandra 进程停止,所以我决定运行压缩开始和结束令牌范围,我选择范围:

cassandra@cqlsh> SELECT tokens FROM system.local;
 tokens
 {'-1086477467151825006', '-6979941880848102278', '-9077716633074993870', '4450419032446811241', '7953145647081579725', '945723047588545683'}

当我通过指定开始和结束令牌范围运行压缩命令时,我收到以下错误:

$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)

【问题讨论】:

    标签: cassandra cassandra-3.0


    【解决方案1】:

    最好使用nodetool ring查找特定节点拥有的确切范围,然后发出相应的修复命令。

    但实际上最好使用Reaper tool - 它会自动进行计算,将拥有的范围拆分为子范围等。

    【讨论】:

    • 我使用 nodetool repair 和 nodetool ring 来查找令牌范围,但范围不太匹配,我也检查了 repear,我找不到确切的位置可以看到范围的分割,只有可以在“查看段”按钮中看到开始和结束范围,但看不到拆分。
    • 在 reaper 中,您指定要创建多少段,然后它将执行所有计算。如果您有巨大的分区,那么也许更多的段是有意义的
    • 为了在您的评论中添加更多内容,我发现“nodetool describering”列出了节点上每个键空间的范围的开始和结束标记
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-10
    • 1970-01-01
    • 2023-02-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多