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]
--bucket=[bucket-name]
--bucket-eviction-policy=[valueOnly | fullEviction]
--bucket-type=[type]
--bucket-port=[port]
--bucket-ramsize=[size]
--bucket-priority=high
--bucket-replica=[replicas]
--enable-flush=[0 | 1]
--wait
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:
| Option | Description |
|---|---|
|
Named bucket to act on. |
|
Bucket RAM quota in MB. |
|
Replication count. |
|
Bucket type, either memcached or Couchbase. |
|
Bucket priority compared to other buckets. |
|
Depends on the selected port.* |
|
Define the eviction policy: |
|
Enables and disables flush (yes=1, no=0). |
|
Enables a defined number of replicas (yes=1, no=0).. |
|
TCP port 11211 with SASL authentication, or a dedicated port with no password. * |
|
Wait for the creation of the bucket to be completed before returning. |
-
If you use a standard port, it will be the TCP port
11211which requires SASL authentication. Therefore, a bucket password will be a bucket-specific SASL password. The SASL user will be the bucket name itself.
On the other hand, if you choose to select 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 -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
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-port=11222 \ --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