URL: http://<db.host>:<db.port>/admin/rebalance
Rebalance the data in the cluster so that all nodes contain an equal number of records approximately and/or rebalance the shards to be equally distributed (as much as possible) across all the ranks.
The database must be offline for this operation, see /admin/offline
- If /admin/rebalance is invoked after a change is made to the cluster, e.g., a host was added or removed, sharded data will be evenly redistributed across the cluster by number of shards per rank while unsharded data will be redistributed across the cluster by data size per rank
- If /admin/rebalance is invoked at some point when unsharded data (a.k.a. randomly-sharded) in the cluster is unevenly distributed over time, sharded data will not move while unsharded data will be redistributed across the cluster by data size per rank
NOTE: Replicated data will not move as a result of this call
This endpoint's processing time depends on the amount of data in the system, thus the API call may time out if run directly. It is recommended to run this endpoint asynchronously via /create/job.
Input Parameter Description
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | map of string to strings | Optional parameters. The default value is an empty map ( {} ).
|
Output Parameter Description
The GPUdb server embeds the endpoint response inside a standard response structure which contains status information and the actual response to the query. Here is a description of the various fields of the wrapper:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
status | String | 'OK' or 'ERROR' | ||||||
message | String | Empty if success or an error message | ||||||
data_type | String | 'admin_rebalance_response' or 'none' in case of an error | ||||||
data | String | Empty string | ||||||
data_str | JSON or String | This embedded JSON represents the result of the /admin/rebalance endpoint:
Empty string in case of an error. |