Compacting buckets

Compacting buckets

Bucket compaction is initiated with the POST /pools/default/buckets/[bucket-name]/controller/compactBucket HTTP method and URI

HTTP method and URI

The following URI paths are for compacting buckets data and indexes and for cancelling bucket compaction.


// Compacting
POST /pools/default/buckets/[bucket-name]/controller/compactBucket


// Cancelling compaction
POST /pools/default/buckets/[bucket-name]/controller/cancelBucketCompaction

      
Note: Administrative credentials must be provided for the node in the cluster.

Syntax for compaction

To compact data files and indexes associated with a specific bucket, use the following curl request syntax:

curl -i -v -X POST -u [admin]:[password] 
  http://[localhost]:8091/pools/default/buckets/[bucket-name]/controller/compactBucket

Syntax for cancelling compaction

To stop bucket compaction, use the following curl request syntax:

curl -i -v -X POST -u [admin]:[password] 
  http://[localhost]:8091/pools/default/buckets/[bucket-name]/controller/cancelBucketCompaction

Example

Curl example for compacting the default bucket:

curl -i -v -X POST -u Administrator:password
  http://10.5.2.54:8091/pools/default/buckets/default/controller/compactBucket