Syntax
Request syntax:
- cbstats [hostname]:11210 key [keyname] [vbid]
+ cbstats host:11210 [common options] key keyname vbid
Description
The following key information is available.
@@ -25,22 +25,17 @@
key_cas
- The keys current cas value.
- KV
-
-
- key_data_age
- How long the key has waited for its value to be persisted (0 if clean).
+ The key’s current cas value, as a decimal integer.
KV
key_exptime
- Expiration time from the epoch.
+ Expiration time from the epoch, as a decimal integer.
KV
key_flags
- Flags for this key.
+ Flags for this key, as a decimal integer.
KV
@@ -48,30 +43,59 @@
If the value is not yet persisted.
KV
+
+ key_is_resident
+ If the value is resident in memory.
+ KV
+
key_valid
- See description below*.
+ See description below. *
V
key_vb_state
- The vbucket state of this key.
+ The vBucket state of this key.
KV
- *key_valid= can have the following responses:
-
- - this_is_a_bug: Some case we didn’t take care of.
- - dirty:The value in memory has not been persisted yet.
- - length_mismatch: The key length in memory doesn’t match the length on the disk.
- - data_mismatch: The data in memory doesn’t match the data on disk.
- - flags_mismatch: The flags in memory don’t match the flags on disk.
- - valid: The key is both on disk and in memory
- - ram_but_not_disk: The value doesn’t exist yet on disk.
- - item_deleted: The item has been deleted.
-
+ * key_valid can have the following responses:
+
+
+ - this_is_a_bug
+ - Some case we didn’t take care of.
+
+
+ - dirty
+ - The value in memory has not been persisted yet.
+
+
+ - length_mismatch
+ - The key length in memory doesn’t match the length on the disk.
+
+
+ - data_mismatch
+ - The data in memory doesn’t match the data on disk.
+
+
+ - flags_mismatch
+ - The flags in memory don’t match the flags on disk.
+
+
+ - valid
+ - The key is both on disk and in memory.
+
+
+ - ram_but_not_disk
+ - The value doesn’t exist yet on disk.
+
+
+ - item_deleted
+ - The item has been deleted.
+
+
@@ -88,27 +112,58 @@
- KEYNAME
+ keyname
Name of the key.
- VBID
- vBucket ID.
+ vbid
+ vBucket ID. †
+
+
+ † To find the vBucket ID associated with a given key, you can use the cbc-hash
+ command, which is available as part of the Couchbase C SDK (libcouchbase).
+
+ - For more information on the Couchbase C SDK, see .
+ - For more information on the cbc-hash command, see
+ Couchbase C Client:
+ cbc(1) - Couchbase Client Commandline Utility.
+
+
+
+ For common cbstats options, see .
- Example
+
+
+ Example 1: Find the vBucket ID associated with a given key
+
+ Request
+ cbc-hash 21st_amendment_brewery_cafe -U couchbase://localhost/beer-sample -u Administrator -P password
+
+ Response
+ 21st_amendment_brewery_cafe: [vBucket=553, Index=1] Server: 10.142.180.102:11210, CouchAPI: http://10.142.180.102:8092/beer-sample
+Replica #0: Index=0, Host=10.142.180.101:11210
+
+
+
+ Example 2: Get key information
+
Request
- cbstats 10.5.2.54:11210 key foo 115
-Response
- Example response for the key foo:
- key_cas: 41206791218746
- key_exptime: 0
- key_flags: 0
- key_is_dirty: 0
+ cbstats localhost:11210 -u Administrator -p password -b beer-sample key 21st_amendment_brewery_cafe 553
+
+ Response
+ stats for key 21st_amendment_brewery_cafe
+ key_cas: 1532081261254082560
+ key_exptime: 0
+ key_flags: 2
+ key_is_dirty: false
+ key_is_resident: true
+ key_vb_state: replica
+
diff --git a/content/cli/cbstats/cbstats-vkey.dita b/content/cli/cbstats/cbstats-vkey.dita
index 9119e53853..658041869b 100644
--- a/content/cli/cbstats/cbstats-vkey.dita
+++ b/content/cli/cbstats/cbstats-vkey.dita
@@ -2,16 +2,16 @@