Performing Graceful Failover
Graceful failover can be performed by means of the REST API.
Initiates graceful failover for one or more server nodes. The Full Admin or Cluster Admin role is required.
POST /controller/startGracefulFailover [ -d <node-to-be-gracefully-failed-over> ]
Each server node to be gracefully failed over is specified with the
This must consist of the string
otpNode=ns_1@ followed by the IP address or domain-name of the node.
If multiple nodes are to be gracefully failed over, each should be specified separately, with multiple occurrences of the
Note that the progress of graceful failover can be tracked: see Getting Cluster Tasks.
Subsequent to a successful graceful failover, the cluster must be rebalanced. See Rebalance.
Failure to specify a node correctly returns
400 Bad Request, and an error message such as
Unknown server given: ["firstname.lastname@example.org"].
Failure to authenticate returns
Incorrect specification of the URI returns
404 Object Not Found.
The following example gracefully fails over two nodes from a cluster.
curl -u Administrator:password \ http://10.144.220.101:8091/controller/startGracefulFailover \ -d otpNode=ns_1%4010.144.220.103 \ -d otpNode=ns_1%4010.144.220.104
If graceful failover is successfully initiated and completed, the cluster should then be rebalanced, specifying all nodes in the cluster (including those gracefully failed over) as
knownNodes, and additionally specifying those gracefully failed over as
curl -u Administrator:password -v -X POST \ http://10.144.220.101:8091/controller/rebalance \ -d 'knownNodesemail@example.com,firstname.lastname@example.org,email@example.com,firstname.lastname@example.org&ejectedNodesemail@example.com,firstname.lastname@example.org'