Creating buckets

Creating buckets

Buckets are created with the couchbase-cli bucket-create command.

CLI command and parameter

Buckets are created with the couchbase-cli bucket-create command with the following parameters. bucket-create adds new buckets to clusters.

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.
Note: This option does not apply to memcached-style buckets since you cannot change the RAM quota on a memcached bucket.
--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-create -c [localhost]:8091 -u [Administrator] -p [password] 
       --bucket=[bucket-name]
       --bucket-type=[type]
       --bucket-port=[port]
       --bucket-ramsize=[size]
       --bucket-replica=[replicas]

Example

To create a new dedicated port couchbase bucket:


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

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-port=11222 
       --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