Buckets

Buckets

Buckets are managed with the couchbase-cli tool and the bucket-* commands.

Description

This section provides examples for listing, creating, modifying, flushing, and compacting buckets.

CLI command and parameters

Table 1. bucket-* options
Parameter 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] Enables and disables flush
--enable-index-replica=[0 | 1] Enable and disables 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

Syntax

Request syntax:

couchbase-cli bucket-list -c [localhost]:8091 
        -u [admin] -p [password]
        [options]

Example: Listing buckets

To list buckets in a cluster:


couchbase-cli bucket-list -c 192.168.0.1:8091 -u Administrator -p password

Example: Modifying buckets

To modify a dedicated port bucket:


couchbase-cli bucket-edit -c 192.168.0.1:8091 -u Administrator -p password \
       --bucket=test_bucket \
       --bucket-port=11222 \
       --bucket-ramsize=400 \
       --enable-flush=1
       
SUCCESS: bucket-create

Example: Deleting buckets

To delete a bucket:


couchbase-cli bucket-delete -c 192.168.0.1:8091 -u Administrator -p password \
       --bucket=test_bucket