Cassandra built-in tool nodetool-Monitoring
Cassandra common monitoring commands
Cassandra comes with several powerful clusters or data management tools, which can help diagnose and maintain Cassandra clusters and quickly solve various problems:
Nodetool
Nodetool is a command-line toolset that monitors Cassandra and performs routine database operations. As a built-in tool, nodetool is generally used to run directly on nodes.
The nodetool toolset supports most important JMX metrics and actions and contains commands for administrators.
The relevant commands are as follows:
Nodetool: a command-line toolset that monitors Cassandra and performs routine database operations. As a built-in tool, nodetool is generally used to run directly on nodes. The nodetool toolset supports most important JMX metrics and actions and contains commands for administrators. Cassandra utility: Cassandra utility is actually a startup configuration interface provided by Cassandra, which means that you can configure cassandra startup parameters, such as runtime java heap size, and so on. Cassandra-stress tool:cassandra stress tool is a stress testing tool for clusters. SSTable utilities: a set of tools for manipulating sstable: CQL shell: a command line tool for interacting with data in a Cassandra cluster through CQL (Cassandra Query Language) Cluster node list: [cassandra] 172.20.101.157 172.20.101.164 172.20.101.165 172.20.101.160 172.20.101.166 172.20.101.166 172.20.101.167 list the help content of the specified command nodetool help command-name for example: view the details of the status command nodetool help statusnodetool common monitoring commands:
The nodetool toolset provides a set of metrics, server metrics, and compression statistics for viewing tables.
Nodetool describecluster
Output cluster information
Cluster Information: Name: pttest Snitch: org.apache.cassandra.locator.GossipingPropertyFileSnitch DynamicEndPointSnitch: enabled Partitioner: org.apache.cassandra.dht.Murmur3Partitioner Schema versions: 8560f200-adbb-3a18-8d5e-a1f7f7856194: [172.20.101.164,172.20.101.165,172.20.101.166,172.20.101.167,172.20.101.160,172.20.101.157] nodetool status:
Output a quick summary of the cluster ring and the current status of the cluster
[root@kubm-01 ~] # nodetool status Datacenter: dc1=Status=Up/Down | / State=Normal/Leaving/Joining/Moving-- Address Load Tokens Owns (effective) Host ID RackUN 172.20.101.164 173.72 KiB 256 34.2% dcbbad83-fe7c-4580-ade7-aa763b8d2c40 rack1UN 172.20.101.165 50.4 KiB 256 35.0% cefe8a3b-918f-463b-8c7d-faab0b9351f9 Rack1UN 172.20.101.166 95.5 KiB 256 34.1% 88e16e35-50dd-4ee3-aa1a-f10a8c61a3eb rack1UN 172.20.101.167 50.4 KiB 256 32.3% 8808aaf7-690c-4f0c-be9b-ce655c1464d4 rack1UN 172.20.101.160 194.83 KiB 256 31.5% 57cc39fc-e47b-4c96-b9b0-b004f2b79242 rack1UN 172.20.101.157 176.67 KiB 256 33.0% 091ff0dc-415b-48a7-b4ce-e70c84bbfafc rack1nodetool netstats:
Display statistics for network connection operations
[root@kubm-01] # nodetool netstats-- human-readableMode: NORMALNot sending any streams.Read Repair Statistics:Attempted: 0Mismatch (Blocking): 0Mismatch (Background): 0Pool Name Active Pending Completed DroppedLarge messages 0Small messages a 0 0 0Small messages nanda a 0 163 0Gossip messages A 0 3150335 0 view the load of a node Memory usage [ptmind@kubm-01 ~] $nodetool info ID: 091ff0dc-415b-48a7-b4ce-e70c84bbfafcGossip active: trueThrift active: falseNative Transport active: trueLoad: 282.65 KiBGeneration No: 1561803589Uptime (seconds): 844997Heap Memory (MB): 354.14 / 3970.00Off Heap Memory (MB): 0.00Data Center : dc1Rack: rack1Exceptions: 0Key Cache: entries 119 Size 11.7 KiB, capacity 100 MiB, 435 hits, 596 requests, 0.730 recent hit rate, 14400 save period in secondsRow Cache: entries 0, size 0 bytes, capacity 0 bytes, 0 hits, 0 requests, NaN recent hit rate, 0 save period in secondsCounter Cache: entries 0, size 0 bytes, capacity 50 MiB, 0 hits, 0 requests, NaN recent hit rate, 7200 save period in secondsChunk Cache: entries 11, size 704 KiB, capacity 480 MiB, 1388 misses, 2253 requests, 0.384 recent hit rate NaN microseconds miss latencyPercent Repaired: 100.0%Token: (invoke with-T/--tokens to see all 256tokens) wnodetool tpstats:
Displays the status of each phase of a Cassandra operation such as active, pending, and completed tasks
OPTIONS-F-- format Output format (json Yaml) [root@kubm-01 ~] # nodetool tpstats Pool Name Active Pending Completed Blocked All time blockedReadStage 0 0 1 000 0MiscStage 0 000 0CompactionExecutor 0 0 491131 0 0MutationStage 0 0 45 0 0MemtableReclaimMemory 0 0 586 0 0PendingRangeCalculator 0 0 13 0 0GossipStage 0 0 3150790 0 0.PerDiskMemtableFlushWriter_0 0 0 586 0 0ValidationExecutor 0 0 0 0 0.Message type DroppedREAD 0.REQUEST_RESPONSE 0PAGED_RANGE 0READ_REPAIR 0nodetool cfstats:
Displays statistics for each table and keyspace
Option-F,-- format Output format (json, yaml)-H,-- human-readable Display bytes in human readable form, i.e. KiB, MiB, GiB, TiB-i Ignore the list of tables and display the remaining tables create keyspacecreate keyspace ptmind_test with replication = {'class':'NetworkTopologyStrategy','dc1':2} and durable_writes = true Create the table cassandra@cqlsh:ptmind_test > CREATE TABLE users (. User_id text PRIMARY KEY,... First_name text,... Last_name text,... Emails set...); insert data: INSERT INTO users (user_id, first_name, last_name, emails) VALUES ('2percent,' kevin', 'kevin', {' kevin@ptmind.com', 'kevin@gmail.com'}) View the specified tablespace Output all [root@kubm-01 ~] # nodetool cfstats ptmind_test.usersTotal number of tables: 37-Keyspace: ptmind_test Read Count: 0 Read Latency: NaN ms Write Count: 0 Write Latency: NaN ms Pending Flushes: 0 Table: users.. by default Average live cells per slice (last five minutes): NaN Maximum live cells per slice (last five minutes): 0 Average tombstones per slice (last five minutes): NaN Maximum tombstones per slice (last five minutes): 0 Dropped Mutations: 0nodetool cfhistograms:
Displays table statistics, including read and write latency, row size, number of columns, and number of SSTable
[root@kubm-01 ~] # nodetool cfhistograms ptmind_test.usersNo SSTables exists Unable to calculate 'Partition Size' and' Cell Count' percentilesptmind_test/users histogramsPercentile SSTables Write Latency Read Latency Partition Size Cell Count (micros) (micros) (bytes) 50% 0.00 0.00 0.00 NaN NaN.Max 0.00 0.00 0.00 NaN NaNnodetool compactionstats
Displays the progress of tasks that are currently being compressed
Pending tasks: 0