A newer version of this documentation is available.

View Latest

Enabling and Disabling Auto-Failover

  • reference
    +
    Auto-failover is enabled and disabled by means of the POST /settings/autoFailover HTTP method and URI.

    HTTP method and URI

    The auto-failover setting is global, and therefore applies to all nodes in the cluster. Setting-changes require authentication.

    POST /settings/autoFailover

    The following parameters are used:

    • enabled=[true|false]. Enables or disables automatic failover. Default setting is false.

    • `timeout=`number-of-seconds. Integer between 5 and 3600. Specifies the number of seconds that must elapse, with a node unavailable, before automatic failover is triggered. Default setting is 120.

    • `maxCount=`number-of-events. Specifies the maximum number of sequential auto-failover events to be handled before administrator-intervention is required. An event might consist of one node failing over; or alternatively, of an entire server group failing over. The maximum allowed value is 3. The default value is 1. This parameter is only supported by Couchbase Server Enterprise Edition.

    • failoverServerGroup=[true|false]. Enables or disables automatic failover for server groups. Do not enable failover for server groups unless you have set up three or more server groups, and have the capacity to absorb the load of any failed-over group. This parameter is ignored if the value of the enabled parameter for automatic failover is false. Default setting is false. This parameter is only supported by Couchbase Server Enterprise Edition.

    • failoverOnDataDiskIssues[enabled]=[true|false]&failoverOnDataDiskIssues[timePeriod]=`number-of-seconds. When `enabled is true, timePeriod is an integer between 5 and 3600: such settings allow automatic failover to be triggered when disk read-write attempts have failed continuously throughout at least 60% of the specied time-period. The default for enabled is false. If enabled is true, the default timePeriod is 120 seconds. If enabled is false and the timePeriod is explicitly specified, an error is returned. This parameter and its values are ignored if the value of the enabled parameter for automatic failover is false. This parameter is only supported by Couchbase Server Enterprise Edition.

    Syntax

    Curl request syntax:

    curl -u [admin]:[password] http://[localhost]:8091/settings/autoFailover -d [parameter]

    Example

    Curl request example:

    curl -i -X POST -u Administrator:password http://10.142.180.103:8091/settings/autoFailover \
      -d 'enabled=true&timeout=72' \
      -d 'failoverServerGroup=true&maxCount=2' \
      -d 'failoverOnDataDiskIssues[enabled]=true&failoverOnDataDiskIssues[timePeriod]=89'

    Raw HTTP request example:

    POST /settings/autoFailover HTTP/1.1
    Host: 10.5.2.54:8091
    Content-Type: application/x-www-form-urlencoded
    Authorization: Basic YWRtaW46YWRtaW4=
    Content-Length: 14
    enabled=true&timeout=600

    Response codes

    HTTP/1.1 200 OK
    Server: Couchbase Server
    Pragma: no-cache
    Date: Sat, 18 Oct 2014 00:26:28 GMT
    Content-Length: 0
    Cache-Control: no-cache

    Possible errors include:

    400 Bad Request, The value of "enabled" must be true or false
    400 Bad Request, The value of "timeout" must be a positive integer in a range from 5 to 3600
    400 Bad Request, The value of "failoverOnDataDiskIssues[timePeriod]" must be a positive integer in a range from 5 to 3600
    401 Unauthorized
    This endpoint isn't available yet.