To start a rebalance process through the REST API you must supply two arguments containing the list of nodes that have been marked to be ejected, and the list of nodes that are known within the cluster. You can obtain this information by getting the current node configuration as reported by Section 8.6, “Getting Information on Nodes”. This is to ensure that the client making the REST API request is aeare of the current cluster configuration. Nodes should have been previously added or marked for removal as appropriate.
The information must be supplied via the
parameters as a
POST operation to the
/controller/rebalance endpoint. For example:
> curl -v -u Administrator:password -X POST 'http://172.23.121.11:8091/controller/rebalance' -d 'ejectedNodes=&knownNodesemail@example.com,firstname.lastname@example.org'
The corresponding raw HTTP request:
POST /controller/rebalance HTTP/1.1 Authorization: Basic QWRtaW5pc3RyYXRvcjpUYW1zaW4= User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5 Host: 192.168.0.77:8091 Accept: */* Content-Length: 63 Content-Type: application/x-www-form-urlencoded
The response will be 200 (OK) if the operation was successfully submitted.
If the wrong node information has been submitted, JSON with the mismatch error will be returned:
Progress of the rebalance operation can be obtained by using Section 8.33, “Getting Rebalance Progress”.