Failing over Nodes

Nodes are failed over via hard failover via the POST /controller/failOver HTTP method and URI.

HTTP method and URI

Failing over a node indicates that the node is no longer available in a cluster and replicated data on another node should be made available to clients. This endpoint along with the otpNode parameter (internal node name) fails over a specific node.

POST /controller/failOver

Syntax

HTTP request syntax:

POST /controller/failOver HTTP/1.1
Authorization: Basic

Curl request syntax:

curl -v -X POST
-u admin:password http://localhost:port/controller/failOver -d otpNode=[node@hostname]

Examples

The following curl statement performs a hard failover of server node 10.142.180.102 from a cluster with localhost 10.142.180.1.

curl -v -X POST -u Administrator:password http://10.142.180.1:8091/controller/failOver \
-d 'otpNode=ns_1@10.142.180.102'

The following curl statement performs a hard failover of server nodes 10.142.180.102 and 10.142.180.103 from a cluster with localhost 10.142.180.1. Note that multi-node failover is always hard failover.

curl -v -X POST -u Administrator:password http://10.142.180.1:8091/controller/failOver \
-d 'otpNode=ns_1@10.142.180.102' -d 'otpNode=ns_1@10.142.180.103'

Response codes

Response codes Description

200

OK

400

Bad Request JSON: The RAM Quota value is too small.

401

Unauthorized

The following example is a successful response:

HTTP/1.1 200 OK

The following example is an unsuccessful response, for example, if the node does not exist in the cluster.

HTTP/1.1 400