A newer version of this documentation is available.

View Latest

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

--conflict-resolution

The conflict resolution: timestamp or sequence.

--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 new dedicated port Couchbase bucket:

couchbase-cli bucket-create -c 192.168.0.1:8091 \
       --bucket=test_bucket \
       --bucket-type=couchbase \
       --bucket-port=11222 \
       --bucket-ramsize=200 \
       --bucket-replica=1 \
       --bucket-priority=high \
       --bucket-eviction-policy=valueOnly \
       --conflict-resolution=timestamp \
       -u Administrator -p password

To create a Couchbase bucket and wait for bucket ready:

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

To create a new SASL memcached bucket:

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

To create a new Couchbase bucket with a high priority:

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