You can use cbstats to access information about individual nodes, and the buckets associated with the nodes, in a Couchbase cluster. The utility is located in one of the following directories, depending upon your platform install:
| Linux | /opt/couchbase/bin/cbstats |
| Windows | C:\Program Files\Couchbase\Server\bin\cbstats.exe |
| Mac OS X | /Applications/Couchbase
\Server.app/Contents/Resources/couchbase-core/bin/cbstats |
You can use this utility to get couchbase node statistics. The general format for using it is:
shell> cbstats HOST:BUCKET_PORT COMMAND [-flags] [bucketname password]For this command, note that host and port are specifically for a bucket, not a node or cluster. The following describes the command format:
HOST is the hostname and
BUCKET_PORT is the dedicated port for the
bucket.
COMMAND is one of the
cbstats from the commands listed below.
-flags are one of the optional flags
described below.
bucketname is the name of the Couchbase or
memcached bucket.
password is the for bucket-level
authentication.
The following are the possible cbstats commands
you can use:
Table 7.4. cbstats Tool Commands
| Command | Description |
|---|---|
all | Provides statistics for a named bucket. |
allocator | Memory allocation for bucket, if exists. |
checkpoint [vbid] | Checkpoints are internal markers used to flag items in queue. View them with this command. |
dispatcher [logs] | |
hash [detail] | |
items | |
kvstore | |
kvtimings | |
raw argument | |
reset | Resets hit- and miss- counters which indicate number of requests and failed requests. |
slabs | |
tap [username password] | |
tapagg | |
timings | Shows history and time durations of different read/write operations. In milliseconds. |
vkey keyname vbid | |
help |
For example, the cbstats output can be used
with other command-line tools to sort and filter the data.
watch --diff "cbstats \ ip-10-12-19-81:11210 all | egrep 'item|mem|flusher|ep_queue|bg|eje|resi|warm'"