Set GSI Settings

To set the global secondary index settings use POST /settings/indexes.

Description

This endpoint is used to update the global secondary index settings for the cluster. The request is handled and validated by the cluster manager and then delegated to all relevant index nodes automatically. All changes to the index settings via this method apply to all index nodes in the cluster. Parameters which are not specified are left unchanged, it is not necessary to specify all parameters in the body.

HTTP Method and URI

POST http://<host>:8091/settings/indexes

Body Parameters

All of the following parameters are passed in the request body as application/x-www-form-urlencoded data. The parameters are specified as key-value pairs (e.g key=value).

Optional

Name Description Type

indexerThreads

Number of threads for the indexer process to use, this applies equally to all index nodes in the cluster regardless of the number of cores on each node. A value of 0 causes the indexer process to use one thread per CPU core on each individual node.

integer

logLevel

Indexer logging level.

Possible values are:

  • silent

  • fatal

  • error

  • warn

  • info

  • verbose

  • timing

  • debug

  • trace

maxRollbackPoints

Maximum number of committed rollback points.

integer

memorySnapshotInterval

InMemory snapshotting interval in milliseconds.

integer

stableSnapshotInterval

Persisted snapshotting interval in milliseconds.

integer

storageMode

The storage mode to be used for all global secondary indexes in the cluster.* A value of plasma sets the cluster-wide index storage mode to use the Plasma storeage engine, which can utilize both memory and persistent storage for index maintenance and index scans. A value of memory_optimized sets the cluster-wide index storage mode to use memory optimized global secondary indexes which can perform index maintenance and index scan faster at in-memory speeds. This setting can only be changed while there are no index nodes in the cluster. To change from standard GSI to memory optimized GSI or vice versa, you need to remove all the index service nodes in the cluster.

Possible values are:

  • plasma

  • memory_optimized

  • Plasma and memory_optimized are options in the Enterprise Edition of Couchbase Server 5.5. If you are using the Community Edition, the default (and only) value is forestdb.

Response Codes

Response Code Description

200

Success. Settings are updated and the new settings are returned in the response.

401

Unauthorized.

Sample Curl Command

The following example sets the global secondary index settings.

curl -X POST -u 'Administrator:password' 'http://localhost:8091/settings/indexes' -d 'indexerThreads=0' -d 'logLevel=info' -d 'maxRollbackPoints=5' -d 'memorySnapshotInterval=200' -d 'stableSnapshotInterval=5000' -d 'storageMode=forestdb'

Sample Response

200
{
    "indexerThreads": 0,
    "logLevel": "info",
    "maxRollbackPoints": 5,
    "memorySnapshotInterval": 200,
    "stableSnapshotInterval": 5000,
    "storageMode": "forestdb"
}
401

This response code returns an empty body.