【问题标题】:"Number of Keys" is missing from "nodetool cfstats" output in cassandra 2.1.2. How to get the count of rows now?cassandra 2.1.2 中的“nodetool cfstats”输出中缺少“键数”。现在如何获取行数?
【发布时间】:2015-01-26 23:26:07
【问题描述】:

我非常需要 ColumnFamily 中的行数,但 cassandra 2.1.2 中的“nodetool cfstats”输出中缺少“键数”。现在如何获取行数?

这是cfstats的输出

Keyspace: liftrmt
    Read Count: 0
    Read Latency: NaN ms.
    Write Count: 0
    Write Latency: NaN ms.
    Pending Flushes: 0
            Table: reportcodedaycount
            SSTable count: 4
            Space used (live): 11.49 MB
            Space used (total): 11.49 MB
            Space used by snapshots (total): 0 bytes
            SSTable Compression Ratio: 0.38099920748493266
            Memtable cell count: 0
            Memtable data size: 0 bytes
            Memtable switch count: 0
            Local read count: 0
            Local read latency: NaN ms
            Local write count: 0
            Local write latency: NaN ms
            Pending flushes: 0
            Bloom filter false positives: 0
            Bloom filter false ratio: 0.00000
            Bloom filter space used: 64 bytes
            Compacted partition minimum bytes: 444.17 KB
            Compacted partition maximum bytes: 6.68 MB
            Compacted partition mean bytes: 4.17 MB
            Average live cells per slice (last five minutes): 0.0
            Maximum live cells per slice (last five minutes): 0.0
            Average tombstones per slice (last five minutes): 0.0
            Maximum tombstones per slice (last five minutes): 0.0

【问题讨论】:

    标签: cassandra datastax datastax-java-driver database nosql


    【解决方案1】:

    您需要使用可通过 JMX 访问的新指标。我将使用 JConsole 访问它们。

    打开 jconsole 然后导航到:

    org.apache.cassandra.metrics
        -> ColumnFamily
            -> ksname (in my case test)
                -> cfname (in my case group)
                    -> EstimatedColumnCountHistogram
                        -> Attributes -> Value
    

    打开长 [90] 数组,在我的例子中,它是第二个值。这些是 sstables 中的键,如果它在 memtable 中,则无法通过此指标访问它(即,如果您想查看它,则需要将 memtables 刷新到 sstables)。

    为了清晰起见,插入到 test.group 中的 22 个唯一键的屏幕截图...

    更多关于new metrics API

    【讨论】:

    • 只是一个信息...如果有人没有 x-server(GUI) 来运行 JConsole,那么他可以从命令行本身使用 jmxterm
    【解决方案2】:

    更新:此问题现已在 2.1.3 中解决。

    我继续为此创建了一个 jira。不确定为什么 2.1.2 中缺少键数: https://issues.apache.org/jira/browse/CASSANDRA-8400

    【讨论】:

      猜你喜欢
      • 2016-10-07
      • 2015-03-13
      • 2016-04-07
      • 2014-01-16
      • 1970-01-01
      • 2016-10-26
      • 2016-01-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多