Cassandra Commands
1 min readcassandra -f [start commads] ./nodetool status [checking status] ./nodetool ring [depicts of the state of nodes] ./nodetool -h 192.168.0.101 clean [cleanup of keys that no longer belong to a particular node] ./nodetool -h 192.168.0.101 info [gives information token,disk storage, generation number,uptime seconds,heap] ./nodetool -h 192.168.0.101 compact [immediate compaction on the entire node,key space,column family level] ./nodetool flush keyspace_name table_name [flush memtables to sstables]
Decommissioning & Removing nodes.
./nodetool -h 192.168.0.101 decommission
[leave the node from the cluster] -- execute in decommission node
./nodetool removenode host_id [removing a node permanently] -- encrypted id
Node Repair
./nodetool -h localhost repair
[fix the data on any node]
./nodetool -h 192.168.0.101 repair full
Replacing Node
./cassandra -Dcassandra.replace_address=192.168.0.101
[replacing node] -- From new node command line
./nodetool cfstats keyspace.table_name
[column family statistics]
Cluster Statistics Tools
./nodetool -h 192.168.0.101 netstats
[view the network statistics]
./nodetool -h 192.168.0.101 tpstats
[view the thread pool statistics]
./nodetool -h 192.168.0.101 compactionstats
[indicates the compaction process running at an instant]
./nodetool drain
[forces the node to stop listening to other nodes and clients]
./nodetool -h 192.168.0.101 upgradesstables
[rebuilds sstables]
Snapshot
./nodetool -h 192.168.0.102 snapshot keyspace_name -cf table_name -t snapshot_name
./nodetool -h clearsnapshot keyspace_name -t snashot_name
./nodetool listsnapshots