Database Reference
In-Depth Information
READ_REPAIR
2
BINARY
0
READ
8
MUTATION
711
REQUEST_RESPONSE
2
If you see a lot of zeros in the
Pending
column, you are in one of two situ-
ations: either you have very little cluster activity, or your underlying hardware is
sufficient for the current load on the cluster. If you see a lot of nonzero values in
the
Pending
column, your cluster may be too active for your hardware.
Flushing and Draining
Data coming into the system is temporarily stored in a MemTable. Running
no-
detool flush
purges the data from memory (MemTables) and writes it to the
disk (SSTables). This also enables older CommitLog segments to be removed. Un-
like running a
nodetool drain
, writes are still allowed to the system.
A
flush
is also the first part of a
nodetool drain
. Draining stops the
system from accepting writes after the
flush
is complete. Read requests will still
be processed.
nodetool drain
is commonly used when the system needs to
start up quickly after an upgrade or a restart.
Cleaning
There are many reasons to run
nodetool cleanup
. The most common of
these is a change in replication strategy or replication factor. Although these are
not common things to do to the cluster, there are certainly situations that warrant
either one. After performing the change operation in the CLI (command-line in-
terface) or in CQL, you will come back to the command line and run the cleanup
operation. When you run a cleanup from the command line, it will appear as if the
command is doing nothing. There is no output on standard out for the command
as it runs.
So let's say that you reduced your replication factor from 3 to 2. Now it's time
to run the cleanup. What
nodetool cleanup
does is get rid of all the data
from the extra copy of the data, thus freeing up space on disk. This is similar to a
nodetool repair
in that it rewrites SSTables, but the goal is slightly differ-
ent. The goal of a cleanup is just to remove all keys that no longer belong to this
node.