Cassandra自带一个nodetool工具,安装目录/bin/nodetool
nodetool help:帮助信息
[cassandra@node3 bin]$ ./nodetool help usage: nodetool [(-p <port> | --port <port>)] [(-h <host> | --host <host>)] [(-pwf <passwordFilePath> | --password-file <passwordFilePath>)] [(-pw <password> | --password <password>)] [(-u <username> | --username <username>)] <command> [<args>] The most commonly used nodetool commands are: assassinate 强制删除节点 bootstrap Monitor/manage node's bootstrap process cleanup 触发不再属于某个节点的键的立即清除。默认情况下,清除所有键空间(常规合并过程最终总会删除这些数据) clearsnapshot 清楚快照 compact 对一个或多个表强制(主)压缩,或对给定的SSTables强制用户定义的压缩 compactionhistory 打印压缩的历史信息 compactionstats 打印压缩的统计信息 decommission 退服节点,让该节点不再提供服务(退服节点执行) describecluster 打印集群信息 describering Shows the token ranges info of a given keyspace disableautocompaction 为给定的键空间和表关闭自动压缩 disablebackup 禁用增量备份 disablebinary Disable native transport (binary protocol) disablegossip Disable gossip (effectively marking the node down) disablehandoff 禁止存储和传递提示移交 disablehintsfordc 禁止向数据中心传输提示移交 disablethrift Disable thrift server drain 停止监听来自客户端和其他节点的命令。刷新所有表 enableautocompaction 为给定的键空间和表启用自动压缩 enablebackup 开启增量备份 enablebinary Reenable native transport (binary protocol) enablegossip Reenable gossip enablehandoff 重新启用当前节点上存储和传递提示移交 enablehintsfordc 为以前禁用的数据中心开启提示移交 enablethrift Reenable thrift server failuredetector Shows the failure detector information for the cluster flush 刷新memtable到sstable。flush keyspace [table] garbagecollect Remove deleted data from one or more tables gcstats Print GC Statistics getcompactionthreshold 查看表的合并阈值 getcompactionthroughput 查看系统中压缩/合并的吞吐量上限 MB/s getconcurrentcompactors Get the number of concurrent compactors in the system. getendpoints Print the end points that owns the key getinterdcstreamthroughput Print the Mb/s throughput cap for inter-datacenter streaming in the system getlogginglevels 打印日志级别 getsstables Print the sstable filenames that own the key getstreamthroughput Print the Mb/s throughput cap for streaming in the system gettimeout Print the timeout of the given type in ms gettraceprobability Print the current trace probability value gossipinfo 打印这个节点通过gossip向其他节点传递的参数 help 打印帮助信息 info 打印节点信息 invalidatecountercache 清除计数器缓存 invalidatekeycache 清除键缓存 invalidaterowcache 清除行缓存 join Join the ring listsnapshots 显示快照 move 重新分配token。 move +节点开始令牌 netstats Print network information on provided host (connecting node by default) pausehandoff 暂停提示移交传输进程 proxyhistograms 显示了读请求、写请求和区间请求的延迟。在这里所请求的节点作为协调器。 rangekeysample Shows the sampled keys held across all keyspaces rebuild 从其他节点重建数据 rebuild_index 重建二级索引,与修复一样,CPU和I/O开销很大 refresh 在不重启的情况下将新放置的SSTables加载到系统中 refreshsizeestimates Refresh system.size_estimates reloadlocalschema Reload local node schema from system tables reloadtriggers Reload trigger classes relocatesstables Relocates sstables to the correct disk removenode 移除节点 repair 通过逆熵修复表 replaybatchlog Kick off batchlog replay and wait for finish resetlocalschema Reset node's local schema and resync resumehandoff Resume提示移交传输进程 ring 查看token环信息 scrub Scrub (rebuild sstables for) one or more tables setcachecapacity 设置全局键、行和计数器缓存容量(以MB为单位) setcachekeystosave 覆盖为保持缓存元素所配置的设置,即一个文件中要保持多少个键缓存和行缓存 setcompactionthreshold 设置合并阈值的最小和最大值 setcompactionthroughput 为系统中的压缩/合并设吞吐量上限MB/s,或设置0以禁用节流 setconcurrentcompactors Set number of concurrent compactors in the system. sethintedhandoffthrottlekb 控制提示传送时使用的带宽 setinterdcstreamthroughput Set the Mb/s throughput cap for inter-datacenter streaming in the system, or 0 to disable throttling setlogginglevel 动态设置日志级别 setstreamthroughput Set the Mb/s throughput cap for streaming in the system, or 0 to disable throttling settimeout Set the specified timeout in ms, or 0 to disable timeout settraceprobability 设置将任何给定请求跟踪到值的概率。0为禁用,1为所有请求启用,0为默认值 snapshot 创建快照 status 打印集群信息 statusbackup 查看增量备份状态 statusbinary Status of native transport (binary protocol) statusgossip 打印gossip状态 statushandoff 打印当前节点提交移交状态 statusthrift 打印thrift服务状态 stop Stop compaction stopdaemon Stop cassandra daemon tablehistograms 打印给定表的统计直方图 tablestats 打印表统计信息 toppartitions Sample and print the most active partitions for a given column family tpstats 打印线程池统计信息 truncatehints 截断本地节点上的所有提示移交,或截断指定端点的提示移交. upgradesstables 升级操作之后运行,将存储的数据文件转换为最新的格式。 verify Verify (check data checksum for) one or more tables version 打印cassandra版本 viewbuildstatus Show progress of a materialized view build
getmaxhintwindow 4.0新增,打印最大的提示移交窗口
handoffwindow 打印当前提示移交的切换窗口
setmaxhintwindow 设置指定的最大提示窗口
See 'nodetool help <command>' for more information on a specific command.