【问题标题】:Does nodetool for cassandra only gather data for a single node or for the entire cluster?cassandra 的 nodetool 是否仅收集单个节点或整个集群的数据?
【发布时间】:2018-07-16 02:41:25
【问题描述】:

我有一个 19 节点 Cassandra 集群用于我们的内部服务。如果我使用 nodetool 登录到一个节点并运行诸如 tablestats 之类的命令,那是只为该特定节点收集统计信息还是为整个集群收集统计信息?

【问题讨论】:

    标签: cassandra nodetool


    【解决方案1】:

    nodetool 用于 cassandra 的实用程序收集整个集群,而不是单个节点。 例如,如果您运行类似的命令-

    命令:

    nodetool tablestats musicdb.artist
    

    结果:

    Keyspace: musicdb
    Read Count: 0
    Read Latency: NaN ms.
    Write Count: 0
    Write Latency: NaN ms.
    Pending Flushes: 0
        Table: artist
        SSTable count: 1
        Space used (live): 62073
        Space used (total): 62073
        Space used by snapshots (total): 0
        Off heap memory used (total): 1400
        SSTable Compression Ratio: 0.27975344141453456
        Number of keys (estimate): 1000
        Memtable cell count: 0
        Memtable data size: 0
        Memtable off heap memory used: 0
        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: 1264
        Bloom filter off heap memory used: 1256
        Index summary off heap memory used: 128
        Compression metadata off heap memory used: 16
        Compacted partition minimum bytes: 104
        Compacted partition maximum bytes: 149
        Compacted partition mean bytes: 149
        Average live cells per slice (last five minutes): 0.0
        Maximum live cells per slice (last five minutes): 0
        Average tombstones per slice (last five minutes): 0.0
        Maximum tombstones per slice (last five minutes): 0
    

    上面的表artist属于键空间musicdb的状态来自整个集群

    【讨论】:

    • 我在 3 个数据节点上运行了该命令并返回了不同的使用空间。
    • 在 DC2 节点上尝试此命令。如果 DC1 的复制因子为 3,DC2 的复制因子为 1,那么您的 DC2 节点将返回用于上述命令的整个空间。
    【解决方案2】:

    如果 -h,大多数 nodetool 命令在集群中的单个节点上运行 不用于标识一个或多个其他节点。如果节点从 您发出的命令是预期目标,您不需要 -h 选项来识别目标;否则,对于远程 调用,使用 -h 标识一个或多个目标节点。

    Nodetool Utility

    【讨论】:

    • 谢谢,所以如果我需要获取整个集群的统计信息,那么我用 -h 添加每个节点,nodetool 会进行数学运算以获取聚合值?
    • 如何使用-h指定多个节点?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-04-03
    • 2017-04-13
    • 2012-05-02
    • 1970-01-01
    • 2017-04-21
    • 2011-06-14
    • 1970-01-01
    相关资源
    最近更新 更多