couchbase-cli commands

Commands used with the CLI couchbase-cli tool.

Command Description
server-list List all servers in a cluster.
server-info Show details on one server.
server-add Add one or more servers to the cluster.
server-readd Readds a server that was failed over.
group-manage Manages server groups (Enterprise Edition only).
rebalance Start a cluster rebalancing.
rebalance-stop Stop current cluster rebalancing.
rebalance-status Show status of current cluster rebalancing.
failover Failover one or more servers. Default: Graceful failover

Hard failover is implemented with the --force option.

cluster-init Set the username,password and port of the cluster.
cluster-edit Modify cluster settings.
node-init Set node specific parameters.
bucket-list List all buckets in a cluster.
bucket-create Add a new bucket to the cluster.
bucket-edit Modify an existing bucket.
bucket-delete Delete an existing bucket.
bucket-flush Flush all data from disk for a given bucket.
bucket-compact Compact database and index data.
setting-compaction Set auto compaction settings.
setting-notification Set notifications.
setting-alert Email alert settings.
setting-autofailover Set auto failover settings.
setting-xdcr Set XDCR-related configuration which affect behavior.
xdcr-setup Set up XDCR replication.
xdcr-replicate Create and run replication via XDCR.
help show longer Syntax, usage, and examples.

couchbase-cli command options

The following are options which can be used with their respective commands. Administration — couchbase-cli Tool commands options:

server-list option

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 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)

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 Supports ASCII protocol and does not require authentication
--bucket-password=PASSWORD Standard port, exclusive with bucket-port
--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
--email-host=HOST Email server hostname
--email-port=PORT Email server port
--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-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]KB Document batching size, 10 to 100000 KB
--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 Create a new xdcr configuration
--edit Modify existed xdcr configuration
--delete Delete existing xdcr configuration
--xdcr-cluster-name=CLUSTERNAME Remote cluster name
--xdcr-hostname=HOSTNAME Remote host name to connect to
--xdcr-username=USERNAME Remote cluster admin username
--xdcr-password=PASSWORD Remote cluster admin password
--xdcr-demand-encryption=[0\|1] Enables data encryption using Secure Socket Layer (SSL). 1 (one) enables 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
--xdcr-from-bucket=BUCKET Source bucket name to replicate from
--xdcr-clucter-name=CLUSTERNAME Remote cluster to replicate to
--xdcr-to-bucket=BUCKETNAME Remote bucket to replicate to
--xdcr-replication-mode= PROTOCOL Select REST protocol or memcached for replication. xmem indicates memcached while capi indicates REST protocol.

ssl-manage options

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)