bucket-create

bucket-create

Adds a new bucket to a cluster.

Syntax

The basic syntax is:

couchbase-cli bucket-create -c [host]:8091 -u [admin] -p [password] [options]

Description

This command adds a new bucket to a cluster. It has most of the options available for the other bucket-* commands.

Options

The following are the command options:

Table 1. bucket-create options
Option Description
--bucket=BUCKETNAME Named bucket to act on.
--bucket-ramsize=RAMSIZEMB Bucket RAM quota in MB.
--bucket-replica=COUNT Replication count.
--bucket-type=[memcached|couchbase] Bucket type, either memcached or Couchbase.
--bucket-priority=[low|high] Bucket priority compared to other buckets.
--bucket-password=PASSWORD Depends on the selected port.*
--bucket-eviction-policy=[valueOnly|fullEviction] Define the eviction policy: full eviction or value-only eviction.
--enable-flush=[0|1] Enables and disables flush (yes=1, no=0).
--enable-index-replica=[0|1] Enables a defined number of replicas (yes=1, no=0)..
--wait Wait for the creation of the bucket to be completed before returning.

If you use a dedicated port that supports ASCII protocol and doesn't require authentication, you don’t need to specify a password.

Examples

To create a Couchbase bucket and wait for bucket ready:

couchbase-cli bucket-create -c 192.168.0.1:8091 -u Administrator -p password \ 
--bucket=test_bucket --bucket-type=couchbase \ 
--bucket-ramsize=200 --bucket-replica=1 --wait

To create a new sasl memcached bucket:

couchbase-cli bucket-create -c 192.168.0.1:8091 -u Administrator -p password \ 
--bucket=test_bucket --bucket-type=memcached --bucket-password=password \ 
--bucket-ramsize=200 --enable-flush=1 --enable-index-replica=1

To create a new couchbase bucket with a high priority:

couchbase-cli bucket-create -c 192.168.0.1:8091 -u Administrator -p password \
--bucket=test_bucket --bucket-type=couchbase \ 
--bucket-ramsize=200 --bucket-replica=1 --bucket-priority=high   

To create a new sasl bucket and set the eviction policy to valueOnly:

couchbase-cli bucket-create -c 192.168.0.1:8091 -u Administrator -p password \ 
--bucket=test_bucket --bucket-password=password --bucket-ramsize=200 \
--bucket-eviction-policy=valueOnly --enable-flush=1