A newer version of this documentation is available.

View Latest

setting-compaction

Set the auto compaction settings.

Syntax

The basic syntax is:

couchbase-cli setting-compaction -c [host]:8091 -u [admin] -p [password] [options]

Description

Use this command to set variuous options for auto compaction.

Options

The following are the command options:

Table 1. Data/view compaction options
Options Description

--compaction-db-percentage=PERC

Starts data compaction once data file fragmentation has reached this percentage.

--compaction-db-size=SIZE[MB]

Starts data compaction once data file fragmentation has reached this size.

--compaction-view-percentage=PERC

Starts view compaction once view file fragmentation has reached this percentage.

--compaction-view-size=SIZE[MB]

Starts view compaction once view file fragmentation has reached this size.

--compaction-period-from=HH:MM

Allow compaction to run after this time.

--compaction-period-to=HH:MM

Allow compaction to run before this time.

--enable-compaction-abort=[0|1]

Abort compaction if running outside of the accepted interval (yes=1, no=0).

--enable-compaction-parallel=[0|1]

Allow view and data file compaction at the same time (yes=1, no=0).

Table 2. Global secondary index compaction options
Options Description

--gsi-compaction-mode=[append|circular]

Sets the gsi compaction mode.

--compaction-gsi-percentage=PERC

Starts compaction once gsi file fragmentation has reached this percentage (Append mode only).

--compaction-gsi-interval

A comma separated list of days compaction can run (Circular mode only).

--compaction-gsi-period-from=HH:MM

Allow gsi compaction to run after this time (Circular mode only).

--compaction-period-from=HH:MM

Allow gsi compaction to run before this time (Circular mode only).

--compaction-gsi-period-to=HH:MM

Allow compaction to run before this time.

--enable-gsi-compaction-abort=[0|1]

Abort gsi compaction if when run outside of the accepted interaval (Circular mode only).

Examples

Enable auto compaction starting at 10:00 and finishing at 14:00.

couchbase-cli setting-cluster -c 192.168.0.1:8091 -u Administrator -p password \
--compaction-period-from=10:00 --compaction-period-to=14:00