Enabling and Disabling Auto-Failover
- reference
Send a POST message to the /settings/autoFailover endpoint to change auto-failover settings.
Description
You can use the POST /settings/autoFailover HTTP method and URI to enable, turn off, and change auto-failover settings.
Auto-failover settings are global, applying to all nodes in the cluster.
Syntax
curl -X POST http://<ip-address-or-hostname>:8091/settings/autoFailover
-u <username>:<password>
-d 'enabled=[true|false]'
-d 'timeout=<number-of-seconds>'
-d 'maxCount=<number-of-nodes>'
-d 'canAbortRebalance=[true|false]'
The parameters are as follows:
-
enabled: Enables or disables automatic failover. Default setting istrue. This parameter is required. If you setenabledtotrue, you must also supply a value for thetimeoutparameter.When you set enabledtofalse, Operational Insights ignores any values you supply for additional parameters includingmaxCountandcanAbortRebalance. -
timeout: Sets the number of seconds Operational Insights waits before performing an auto-failover on an unresponsive node. Default setting is 120. Thetimeoutparameter can only be specified whenenabledis set totrue. This parameter and its values are ignored if the value for theenabledparameter isfalse.You can set the value of
timeoutto1second. A low setting, such as anything less than 5 seconds, increases the sensitivity of failure detection. This low setting can cause false positives which result in Operational Insights triggering auto-failovers unnecessarily. It also increases CPU usage.If you want to use a low setting, test a representative workload before setting the value of
timeoutto1in a production environment. Make sure to measure CPU usage. Monitor the cluster for auto-failovers caused by false positives.
-
maxCount: Sets the maximum number of nodes Operational Insights can auto-failover at a time. Once this number of nodes has been auto-failed over, Operational Insights does not auto-failover more nodes until you reset the count or resolve the auto-failovers with a rebalance to recover or remove the failed-over nodes. The maximum value can be up to the number of configured nodes. The default value is 1. This parameter is optional, and is only supported by Operational Insights. This parameter and its values are ignored if the value for theenabledparameter isfalse. -
canAbortRebalance. Sets whether Operational Insights can perform an auto-failover while a rebalance is taking place. This parameter is optional, and is only available in Operational Insights. The value can be eithertrue(the default) orfalse. Operational Insights ignores this setting if you setenabledtofalse.
Required Permissions
You must have one of the following roles to make changes to the auto-failover settings:
-
Cluster Admin
-
Full Admin
For information about roles, see Role Based Access Control (RBAC).
Responses
- 200 OK
-
The call succeeded, and the auto-failover settings were changed.
- 400 Bad Request
-
The call failed because the request was malformed or lacked required settings.
- 401 Unauthorized
-
The call failed because the user did not have the proper permissions to change the auto-failover settings.
Example
The following example enables auto-failover for the cluster, with a timeout of 72 seconds, and a maxCount of 2.
curl -X POST -u Administrator:password \
http://10.144.231.101:8091/settings/autoFailover \
-d 'enabled=true' \
-d 'timeout=72' \
-d 'maxCount=2'
This example disables auto-failover for the cluster:
curl -X POST -u Administrator:password \
http://localhost:8091/settings/autoFailover \
-d 'enabled=false'
See Also
-
For an overview of failover, see Failover.
-
To retrieve the current auto-failover setting using the REST API, see Retrieving Auto-Failover Settings.
-
To manage auto-failover using the command line, see setting-autofailover command.
-
To learn how to manage auto-failover with Operational Insights Web Console, see Node Availability.