Set GSI Settings
- reference
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.
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 | ||
---|---|---|---|---|
|
Selects the index rebalance method:
|
boolean |
||
|
Number of threads for the |
integer |
||
|
Indexer logging level. |
Possible values are:
|
||
|
Maximum number of committed rollback points. |
integer |
||
|
In-memory snapshotting interval in milliseconds. |
integer |
||
|
The default number of index replicas to be created by the Index Service whenever |
integer |
||
|
When |
boolean |
||
|
Persisted snapshotting interval in milliseconds. |
integer |
||
|
Whether Bloom filters are enabled for memory management. The default is that they are disabled. See Per Page Bloom Filters. |
boolean |
||
|
The storage mode to be used for all global secondary indexes in the cluster. In the Enterprise Edition of Couchbase Server, the options are 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. If you are using the Community Edition, the default (and only) value is |
Possible values are:
|
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.
# tag::gsi-settings[]
curl -v -X POST http://127.0.0.1:8091/settings/indexes \
-u Administrator:password \
-d indexerThreads=4 \
-d logLevel=verbose \
-d maxRollbackPoints=2 \
-d storageMode=plasma \
-d redistributeIndexes=false \
-d numReplica=0 \
-d enablePageBloomFilter=false
# end::gsi-settings[]
# tag::disable-ftb-rebalance[]
curl -X POST http://<host>:8091/settings/indexes -d enableShardAffinity=false -u Administrator:<password>
# end::disable-ftb-rebalance[]
Sample Response
- 200
-
{ "redistributeIndexes": false, "numReplica": 0, "enablePageBloomFilter": false, "enableShardAffinity": false, "indexerThreads": 4, "memorySnapshotInterval": 200, "stableSnapshotInterval": 5000, "maxRollbackPoints": 2, "logLevel": "verbose", "storageMode": "plasma" }
- 401
-
This response code returns an empty body.
Curl Command to Disable the File Transfer Based Rebalance
The following command disables the File Transfer Based Rebalance (enableShardAffinity
) feature in the Index Storage Mode.
curl -X POST http://<host>:8091/settings/indexes -d enableShardAffinity=false -u Administrator:<password>