couchbase-cli commands

couchbase-cli commands

Commands used with the CLI couchbase-cli tool.

Table 1. couchbase-cli commands
Command Description
bucket-compact Compact database and index data.
bucket-create Add a new bucket to the cluster.
bucket-delete Delete an existing bucket.
bucket-edit Modify an existing bucket.
bucket-flush Flush all data from disk for a given bucket.
bucket-list List all buckets in a cluster.
cluster-edit Modify cluster settings.
cluster-init Set the username, password and port of the cluster.
failover Fail over one or more servers. Default: Graceful failover

Hard failover is implemented with the --force option.

group-manage Manages server groups (Enterprise Edition only).
help show longer Syntax, usage, and examples.
node-init Set node specific parameters.
rebalance Start a cluster rebalancing.
rebalance-stop Stop current cluster rebalancing.
rebalance-status Show status of current cluster rebalancing.
server-add Add one or more servers to the cluster.
server-info Show details on one server.
server-list List all servers in a cluster.
server-readd Readds a server that was failed over.
setting-alert Email alert settings.
setting-autofailover Set auto failover settings.
setting-cluster Set various options for a cluster.
setting-compaction Set auto compaction settings.
setting-notification Set notifications.
setting-xdcr Set XDCR-related configuration which affect behavior.
ssl-manage Manage cluster SSL certificate.
xdcr-replicate Create and run replication via XDCR.
xdcr-setup Set up XDCR replication.

couchbase-cli command options

The following are options which can be used with their respective commands.

server-list options

server-list options Description
--group-name=GROUPNAME Displays all server in a server group (Enterprise Edition only)

server-add options

server-add options Description
--server-add=HOST[:PORT] Server to add to cluster
--server-add-username=USERNAME Admin username for the server to be added
--server-add-password=PASSWORD Admin password for the server to be added
--group-name=GROUPNAME Server group where the server is to be added (Enterprise Edition only)

server-readd options

server-readd options Description
--server-add=HOST[:PORT] Server to re-add to cluster
--server-add-username=USERNAME Administrator username for the server to be added
--server-add-password=PASSWORD Administrator password for the server to be added
--group-name=GROUPNAME Server group where the server is to be added (Enterprise Edition only)

group-manage options (Enterprise Edition only)

group-manage options Description
--group-name=GROUPNAME Server group name
--list Shows the server groups and the server assigned to each server group
--create Creates a server group.
--delete Removes an empty server group.
--rename=NEWGROUPNAME Renames an existing server group.
--add-servers="HOST:PORT;HOST:PORT" Adds servers to a group
--move-servers="HOST:PORT;HOST:PORT" Moves a list of server from a group
--from-group=GROUPNAME Moves one or more servers from a group.
--to-group=GROUPNAME Moves one or more server to a group

rebalance options

rebalance options Description
--server-add* See server-add OPTIONS
--server-remove=[host]:[port] The server to remove from cluster

failover option

failover option Description
--server-failover=[host]:[port] Server to failover.
--force Force a hard failover.

cluster-* options

cluster-* options Description
--cluster-username=USER New admin username
--cluster-password=PASSWORD New admin password
--cluster-port=PORT New cluster REST/http port
--cluster-ramsize=RAMSIZEMB Per node RAM quota in MB

node-init options

node-init options Description
--node-init-data-path=PATH Per node path to store data
--node-init-index-path=PATH Per node path to store index
--node-init-hostname=NAME Host name for the node. Default: 127.0.0.1

bucket-* options

bucket-* options Description
--bucket=BUCKETNAME Named bucket to act on
--bucket-type=TYPE Bucket type, either memcached or couchbase
--bucket-port=PORT Standard port, exclusive with bucket-port
--bucket-password=PASSWORD Password for the bucket
--bucket-ramsize=RAMSIZEMB Bucket RAM quota in MB
--bucket-replica=COUNT Replication count
--enable-flush=[0\|1] Enable/disable flush
--enable-index-replica=[0\|1] Enable/disable index replicas
--wait Wait for bucket create to be complete before returning
--force Force command execution without asking for confirmation
--data-only Compact database data only
--view-only Compact view data only

setting-compaction options

setting-compaction options Description
--compaction-db-percentage=PERCENTAGE Percentage of disk fragmentation when database compaction is triggered
--compaction-db-size=SIZE[MB] Size of disk fragmentation when database compaction is triggered
--compaction-view-percentage=PERCENTAGE Percentage of disk fragmentation when views compaction is triggered
--compaction-view-size=SIZE[MB] Size of disk fragmentation when views compaction is triggered
--compaction-period-from=HH:MM Enable compaction from this time onwards
--compaction-period-to=HH:MM Stop enabling compaction at this time
--enable-compaction-abort=[0\|1] Allow compaction to abort when time expires
--enable-compaction-parallel=[0\|1] Allow parallel compaction processes for database and view

setting-alert and notification options

setting-alert options Description
--enable-email-alert=[0\|1] Allow email alert.
--email-recipients=RECIPIENT Email recipents, separate addresses with, or ;
--email-sender=SENDER Sender email address.
--email-user=USER Email server username.
--email-password=PWD Email server password. This option returns an empty password.
--email-host=HOST Email server hostname.
--email-port=PORT Email server port. Thius option returns
--enable-email-encrypt=[0\|1] Email encryption with 0 the default for no encryption.
--alert-auto-failover-node Node was failed over via autofailover.
--alert-auto-failover-max-reached Maximum number of auto failover nodes reached.
--alert-auto-failover-node-down Node not auto failed-over as other nodes are down at the same time.
--alert-auto-failover-cluster-small Node not auto failed-over as cluster was too small.
--alert-ip-changed Node ip address changed unexpectedly.
--alert-disk-space Disk space used for persistent storage has reached at least 90% capacity.
--alert-meta-overhead Metadata overhead is more than 50% of RAM for node
--alert-meta-oom Bucket memory on a node is entirely used for metadata
--alert-write-failed Writing data to disk for a specific bucket has failed
setting-notification option Description
--enable-notification=[0\|1] Allow notifications

setting-autofailover options

setting-autofailover options Description
--enable-auto-failover=[0\|1] Allow auto failover
--auto-failover-timeout=TIMEOUT (>=30) Specify amount of node timeout that triggers auto failover

setting-cluster options

setting-cluster options Description
--cluster-name=[CLUSTERNAME] Specify a cluster name.
--cluster-ramsize=[RAMSIZEMB] Specify the per node RAM quota in MB.

setting-xdcr options

setting-xdcr options Description
--max-concurrent-reps=[32] Maximum concurrent replicators per bucket, 8 to 256.
--checkpoint-interval=[1800] Intervals between checkpoints, 60 to 14400 seconds.
--worker-batch-size=[500] Doc batch size, 500 to 10000.
--doc-batch-size=[2048]kilobytes Document batching size, 10 to 100000 kilobytes
--failure-restart-interval=[30] Interval for restarting failed xdcr, 1 to 300 seconds
--optimistic-replication-threshold=[256] Document body size threshold (bytes) to trigger optimistic replication

xdcr-setup options

xdcr-setup options Description
--create Creates a new XDCR configuration.
--edit Modifies an existing XDCR configuration.
--delete Deletes an existing XDCR configuration.
--list Lists all XDCR configurations.
--xdcr-cluster-name=[clustername] Cluster name.
--xdcr-hostname=[hostname] Remote host name to connect to.
--xdcr-username=[username] Remote cluster administrator username.
--xdcr-password=[password Remote cluster administrator password.
--xdcr-demand-encryption=[0 | 1] Enables and disables data encrypted using ssl. True is 1 and enables data encryption. False is 0 and disables data encryption. Default: 0 (Enterprise Edition only)
--xdcr-certificate=[certificate] Specifies the pem-encoded certificate. The certificate is required for XDCR data encryption. Specify the full path for the location of the pem-encoded certificate file on the source cluster. (Enterprise Edition only)

xdcr-replicate options

xdcr-replicate options Description
--create Create and start a new replication
--delete Stop and cancel a replication
--list List all XDCR replications
--pause Pause the replication
--resume Resume the replication
--settings Update settings for the replication
--xdcr-replicator=REPLICATOR Replication ID
--xdcr-from-bucket=BUCKET Local bucket name to replicate from
--xdcr-cluster-name=CLUSTERNAME Remote cluster to replicate to
--xdcr-to-bucket=BUCKETNAME Remote bucket to replicate to
--max-concurrent-reps =[ 16 ] Maximum concurrent replications per bucket, 8 to 256. Default: 16
--checkpoint-interval =[ 1800 ] Intervals between checkpoints , 60 to 14400 seconds
--worker-batch-size =[ 500 ] Document batch size, 500 to 10000
--doc-batch size =[ 2048 ] kilobytes Document batch size, 10 to 100000 kilobytes
--failure-restart-interval =[ 30 ] Interval for restarting failed XDCR, 1 to 300 seconds
--optimistic-replication-threshold =[ 256 ] Document body size threshold (bytes) to trigger optimistic replication
--xdcr-replication-mode=[xmem | capi] Replication protocol, either capi or xmem. xmem indicates memcached while capi indicates REST protocol.

ssl-manage options (Enterprise Edition only)

ssl-manage options Description
--regenerate-cert=[certificate] Regenerates a self-signed certificate on the destination cluster. Specify the full path for the location of the pem-encoded certificate file. For example, --regenerate-cert=./new.pem . (Enterprise Edition only)
--retrieve-cert=[certificate] Retrieves the self-signed certificate from the destination cluster to the source cluster. Specify a local location (full path) and file name for the pem-encoded certificate. For example, --retrieve-cert=./newCert.pem . (Enterprise Edition only)