You control Data Service File-Based Rebalance (FBR) using the /internalSettings REST API endpoint.
The file-based rebalance option for the Data Service directly copies vBucket data files between nodes during rebalance. This usually improves rebalance speed compared to DCP-based backfill method. See File-Based Rebalance for more information about file-based rebalance and how it compares to DCP-based rebalance.
This API endpoint supports the following methods:
Get the current values of the FBR settings. The FBR settings are part of the internal settings, so this API returns all internal settings.
GET /internalSettings
curl -u ${USER}:${PASSWORD} -X GET \
http[s]://${HOST}:${PORT}/internalSettings \
| jq 'with_entries(select(.key | startswith("dataService")))'You must have at least 1 of the following roles to get the FBR settings:
-
Full Admin
-
Cluster Admin
-
Read-Only Security Admin
-
Security Admin
-
Local User Admin
200 OK-
Returns the internal settings. See examples for an example of the settings.
401 Unauthorized-
Returned when authentication fails, such as when the password is incorrect.
403 Forbidden-
Returned if you do not have 1 of the roles listed in Required Privileges.
The following example gets the current values of the FBR settings.
It filters the internal settings using the jq command to show only the FBR settings.
curl -s -u Administrator:password \
-X GET http://node1.example.com:8091/internalSettings \
| jq 'with_entries(select(.key | startswith("dataService")))'Running the example returns a JSON object containing the current FBR settings, such as the following:
{
"dataServiceFileBasedRebalanceEnabled": true,
"dataServiceFileBasedRebalanceMovesPerNode": 4
}The keys returned by the previous example are the FBR settings you can use to control FBR behavior:
- dataServiceFileBasedRebalanceEnabled
-
When
true, eligible vBucket moves use FBR; whenfalse, all vBucket moves use DCP. - dataServiceFileBasedRebalanceMovesPerNode
-
The maximum number of concurrent file-based vBucket moves per node during rebalance.
You can change the FBR settings using the REST API.
POST /internalSettings
curl -sS -u ${USER}:${PASSWORD} \
-X POST http[s]://${HOST}:${PORT}/internalSettings \
[-d dataServiceFileBasedRebalanceEnabled={true|false}] \
[-d dataServiceFileBasedRebalanceMovesPerNode=<integer>]dataServiceFileBasedRebalanceEnabled-
Set to
true(the default) to allow the Data Service to use FBR when rebalancing data in eligible vBuckets. Set tofalseto force the Data Service to use DCP when rebalancing data.NoteThis setting can be overridden on a per-bucket basis using the bucket’s dataServiceRebalanceTypesetting. See Bucket-Level Rebalance Type for more information. dataServiceFileBasedRebalanceMovesPerNode-
Integer value that sets the maximum number of concurrent file-based vBucket moves per node during rebalance. Valid range of values is from
1to1024. The default value is4. Increase this value when you perform a rebalance when your cluster has low loads. For example, consider increasing this value during scheduled maintenance windows. Decrease this value to reduce the overhead of rebalance on running workloads.NoteThis setting is independent of rebalanceMovesPerNode, which applies to DCP rebalance.
You must have 1 of the following roles to change the FBR settings:
-
Full Admin
-
Cluster Admin
200 OK-
Updating the value or values succeeded.
400 Bad Request-
Returned if you specify an invalid value for either setting or an out-of-range value for
dataServiceFileBasedRebalanceMovesPerNode.Also returns a JSON object that describes the error, such as the following:
{ "errors": [ "dataServiceFileBasedRebalanceMovesPerNode - The value must be between 1 and 1024." ] } 401 Unauthorized-
Returned when authentication fails, such as when the password is incorrect.
403 Forbidden-
Returned if you do not have the proper roles to call this API. See Required Privileges.
The following example prevents the Data Service from using FBR cluster-wide:
curl -s -u Administrator:password \
-X POST http://node1.example.com:8091/internalSettings \
-d dataServiceFileBasedRebalanceEnabled=falseThe following example sets the maximum number of concurrent file-based vBucket moves per node to 8:
curl -s -u Administrator:password \
-X POST http://node1.example.com:8091/internalSettings \
-d dataServiceFileBasedRebalanceMovesPerNode=8