Edit a bucket
couchbase-cli bucket-edit [--cluster <url>] [--username <user>]
[--password <password>] [--bucket <name>] [--bucket-ramsize <size>]
[--bucket-replica <num>] [--bucket-priority <priority>]
[--bucket-eviction-policy <policy>] [--enable-flush <num>]
[--max-ttl <seconds>] [--compression-mode <mode>]
[--remove-bucket-port <num>]
[--database-fragmentation-threshold-percentage <perc>]
[--database-fragmentation-threshold-size <megabytes>]
[--view-fragmentation-threshold-percentage <perc>]
[--view-fragmentation-threshold-size <megabytes>] [--from-hour <hour>]
[--from-minute <min>] [--to-hour <hour>] [--to-minute <min>]
[--abort-outside <0|1>] [--parallel-db-view-compaction <0|1>]
[--purge-interval <int>]
Modifies the settings of the bucket specified. Note that some settings can be applied immediately, while other settings either require a rebalance, or require the bucket to be restarted; resulting in potential application downtime.
- --bucket <name>
-
The name of the bucket to edit.
- --bucket-ramsize <size>
-
The amount of memory to allocate to the cache for this bucket, in Megabytes. The memory quota of this bucket must fit into the overall cluster memory quota. The minimum cache size is 100MB.
- --bucket-replica <num>
-
The number of servers to which data is replicated. Replicas provide protection against data loss by keeping copies of a bucket’s data on multiple servers. By default, the number of replicas is one, even if there is only a single server in the cluster. The minimum number of replicas is zero, and the maximum three. This option is valid for Couchbase and Ephemeral buckets only.
- --bucket-port <num>
-
Sets the port on which the bucket listens. This parameter is deprecated, and therefore not recommended for use.
- --bucket-priority <priority>
-
Specifies the priority of this bucket’s background tasks. This option is valid for Couchbase and Ephemeral buckets only. For Couchbase buckets, background task-types include disk I/O, DCP stream-processing, and item-paging. For Ephemeral buckets, background task-types are the same as for Couchbase buckets, with the exception of disk I/O, which does not apply to Ephemeral buckets. The value of this option may be "high" or "low". The default is "low". Specifying "high" may result in faster processing; but only when more than one bucket is defined for the cluster, and when different priority settings have been established among the buckets. When Couchbase and Ephemeral buckets have different priority settings, this affects the prioritization only of task-types other than disk I/O.
- --bucket-eviction-policy <policy>
-
The memory-cache eviction policy for this bucket. This option is valid for Couchbase and Ephemeral buckets only.
Couchbase buckets support either "valueOnly" or "fullEviction". Specifying the "valueOnly" policy means that each key stored in this bucket must be kept in memory. This is the default policy: using this policy improves performance of key-value operations, but limits the maximum size of the bucket. Specifying the "fullEviction" policy means that performance is impacted for key-value operations, but the maximum size of the bucket is unbounded.
Ephemeral buckets support either "noEviction" or "nruEviction". Specifying "noEviction" means that the bucket will not evict items from the cache if the cache is full: this type of eviction policy should be used for in-memory database use-cases. Specifying "nruEviction" means that items not recently used will be evicted from memory, when all memory in the bucket is used: this type of eviction policy should be used for caching use-cases.
- --enable-flush <num>
-
Specifies whether or not the flush operation is allowed for this bucket. To enable flushing, set this option to "1". To disable flushing, set this option to "0". By default, flushing is disabled.
- --enable-index-replica <num>
-
Enables view index replication for the current bucket. This option is valid for Couchbase buckets only. To enable, set the value of this option to "1". To disable, set the value of this option to "0". By default, view index replication is disabled. There may be at most one replica view index.
- --max-ttl <seconds>
-
Specifies the maximum TTL (time-to-live) for all documents in bucket in seconds. If enabled and a document is mutated with no TTL or a TTL greater than than the maximum, its TTL will be set to the maximum TTL. Setting this option to 0 disables the use of max-TTL and the largest TTL that is allowed is 2147483647. This option is only available for Couchbase and Ephemeral buckets in Couchbase Enterprise Edition.
- --compression-mode <mode>
-
Specifies the compression-mode of the bucket. There are three options; off, passive and active. All three modes are backwards compatible with older SDKs, where Couchbase Server will automatically uncompress documents for clients that do not understand the compression being used. This option is only available for Couchbase and Ephemeral buckets in Couchbase Enterprise Edition.
Off: Couchbase Server will only compress document values when persisting to disk. This is suitable for use cases where compression could have a negative impact on performance. Please note it is expected that compression in most use cases will improve performance.
Passive: Documents which were compressed by a client, or read compressed from disk will be stored compress in-memory. Couchbase Server will make no additional attempt to compress documents that are not already compressed.
Active: Couchbase Server will actively and aggressively attempt to compress documents, even if they have not been received in a compressed format. This provides the benefits of compression even when the SDK clients are not complicit.
- --remove-bucket-port <num>
-
Removes the bucket-port setting that might have been set in previous versions of Couchbase Server. The bucket-port also knows as the dedicated port and server side moxi has been deprecated. In later versions of Couchbase Server a cluster will not be able to upgrade if a bucket has the dedicated port set. This option allows removal of that setting by setting it to 1.
- --database-fragmentation-threshold-percentage <perc>
-
Sets the database fragmentation trigger threshold as a percentage. Can be set to values between 2 and 100.
- --database-fragmentation-threshold-size <megabytes>
-
Sets the database fragmentation trigger threshold as a number of megabytes. It accepts integers greater than 1.
- --view-fragmentation-threshold-percentage <perc>
-
Sets the view fragmentation trigger threshold as a percentage. Can be set to values between 2 and 100.
- --view-fragmentation-threshold-size <megabytes>
-
Sets the view fragmentation trigger threshold as a number of megabytes. It accepts integers greater than 1.
- --from-hour <hour>
-
Sets the hour of the start time. Used together with \-\-from\-minutes to set the start time of the interval in which compaction is allowed to run. To set the interval ensure both start and end time are set.
- --from-minute <min>
-
Sets the minute of the start time. Used together with \-\-from\-hour to set the start time of the interval in which compaction is allowed to run. To set the interval ensure both start and end time are set.
- --to-hour <hour>
-
Sets the hour of the end time. Used together with \-\-to\-minute to set the end time of the interval in which compaction is allowed to run. To set the interval ensure both start and end time are set.
- --to-minute <min>
-
Sets the minute of the end time. Used together with \-\-to\-hour to set the end time of the interval in which compaction is allowed to run. To set the interval ensure both start and end time are set.
- --abort-outside <0|1>
-
Will set the option that terminate compaction if the process takes longer than the allowed time. Options are [1, 0].
- --parallel-db-view-compaction <0|1>
-
Run index and data compaction in parallel. Global setting only.
- --purge-interval <int>
-
Sets the frequency of the tombstone (metadata) purge interval. The default value is three days.
To change the memory quota of the travel-data bucket, run the following command:
$ couchbase-cli bucket-edit -c 192.168.1.5:8091 --username Administrator \ --password password --bucket travel-data --bucket-ramsize 1024
To change the number of replicas for the travel-data bucket to "2", run the following command. (Note that this requires a subsequent rebalance, by means of man:couchbase-cli-rebalance[1], to ensure that the replicas are created.)
$ couchbase-cli bucket-edit -c 192.168.1.5:8091 --username Administrator \ --password password --bucket travel-data --bucket-ramsize 1024 \ --bucket-replicas 2
To remove the bucket-port from the test bucket
$ couchbase-cli bucket-edit -c 192.168.1.5:8091 --username Administrator \ --password password --bucket test --remove-bucket-port 1
man:couchbase-cli-bucket-compact[1], man:couchbase-cli-bucket-create[1], man:couchbase-cli-bucket-delete[1], man:couchbase-cli-bucket-flush[1], man:couchbase-cli-bucket-list[1]