Does nodetool for cassandra only gather data for a single node or for the entire cluster?
Asked Answered
P

2

6

I have a 19-node Cassandra cluster for our internal service. If I log into a node using nodetool and run commands like tablestats, etc, does that gather stats just for that particular node or for the entire cluster?

Popliteal answered 6/2, 2018 at 5:40 Comment(0)
G
3

nodetool utility for cassandra gather for entire cluster, not a single node. For example, if you run command like-

command:

nodetool tablestats musicdb.artist

result:

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

Status of the table artist belongs to keyspace musicdb above is from the entire cluster.

Gesellschaft answered 7/2, 2018 at 8:32 Comment(2)
I ran the command on 3 data nodes and return different space used.Adrianaadriane
try this command on the DC2 node. If your replication factor is 3 for DC1 and 1 for DC2 then your DC2 node will return the entire space used for the above command.Gesellschaft
N
3

Most nodetool commands operate on a single node in the cluster if -h is not used to identify one or more other nodes. If the node from which you issue the command is the intended target, you do not need the -h option to identify the target; otherwise, for remote invocation, identify the target node, or nodes, using -h.

Nodetool Utility

Nasal answered 6/2, 2018 at 5:45 Comment(2)
Thank you, so if I need to get stats for the entire cluster, then I add each node with a -h and nodetool will do the math to get me the aggregated values?Popliteal
how to specify multiple nodes using -h?Adrianaadriane
G
3

nodetool utility for cassandra gather for entire cluster, not a single node. For example, if you run command like-

command:

nodetool tablestats musicdb.artist

result:

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

Status of the table artist belongs to keyspace musicdb above is from the entire cluster.

Gesellschaft answered 7/2, 2018 at 8:32 Comment(2)
I ran the command on 3 data nodes and return different space used.Adrianaadriane
try this command on the DC2 node. If your replication factor is 3 for DC1 and 1 for DC2 then your DC2 node will return the entire space used for the above command.Gesellschaft

© 2022 - 2024 — McMap. All rights reserved.