Compacting buckets

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/compactBucket
      

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
Note: In this syntax example, admin, password, localhost, and bucket_name are variables to be replaced with actual values. Administrative credentials must be provided for the node in the cluster.

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
Note: In this syntax example, admin, password, localhost, and bucket_name are variables to be replaced with actual values.