Enabling and Disabling Auto-Failover

  • reference
Send a POST message to the /settings/autoFailover endpoint to change auto-failover settings.

HTTP Method and URI

POST /settings/autoFailover

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 is true. This parameter is required. If you set enabled to true, you must also supply a value for the timeout parameter.

    When you set enabled to false, Operational Insights ignores any values you supply for additional parameters including maxCount and canAbortRebalance.
  • timeout: Sets the number of seconds Operational Insights waits before performing an auto-failover on an unresponsive node. Default setting is 120. The timeout parameter can only be specified when enabled is set to true. This parameter and its values are ignored if the value for the enabled parameter is false.

    You can set the value of timeout to 1 second. 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 timeout to 1 in 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 the enabled parameter is false.

  • 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 either true (the default) or false. Operational Insights ignores this setting if you set enabled to false.

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