bucket-flush

bucket-flush

Flushes all data from the disk for a given bucket.

Syntax

The basic syntax is:

couchbase-cli bucket-flush -c [host]:8091 -u [admin] -p [password] [options]

Description

Flushing will work only if this option was configured either during the initial bucket setup or after the bucket settings have been changed.

Flushing a bucket involves:

  1. Enable the flush bucket option.
  2. Flush the bucket.

By default, the bucket-flush command confirms whether or not you truly want to flush the bucket.

During a flush, any client operations will receive a temporary failure. Once the flush is completed all operations will work as normal.

Warning: It is recommended that the flush capability is not used in production systems as it irreversibly deletes every document in the bucket. Even for use cases where this is the desired behaviour, flushing is not recommended as it is a very disruptive process. You can control and limit the ability to flush individual buckets by setting the flushEnabled parameter on a bucket in the Couchbase Web Console.

Options

The following are the command options:

Table 1. bucket-flush options
Option Description
--bucket=BUCKETNAME Named bucket to act on.
--force Force command execution without asking for confirmation.

Examples

Request:
couchbase-cli bucket-flush -c 192.168.0.1:8091 -u Administrator -p password \ 
--bucket=testBucket 

Response:

This will flush the test bucket.