Module cartridge.lua-api.failover
Administration functions (failover related).
Configure automatic failover.
(Added in v2.0.2-2)
Parameters:
- opts:
- mode: (optional string)
- state_provider: (optional string)
- failover_timeout: (optional number) (added in v2.3.0-52)
- tarantool_params: (optional table)
- etcd2_params: (optional table) (added in v2.1.2-26)
- fencing_enabled: (optional boolean) (added in v2.3.0-57)
- fencing_timeout: (optional number) (added in v2.3.0-57)
- fencing_pause: (optional number) (added in v2.3.0-57)
- leader_autoreturn: (optional boolean) (added in v2.7.7)
- autoreturn_delay: (optional number) (added in v2.7.7)
- check_cookie_hash: (optional boolean) (added in v2.7.8)
Returns:
(boolean) true
if config applied successfully
Or
(nil)
(table) Error description
Enable or disable automatic failover.
(Deprecated since v2.0.2-2)
Parameters:
- enabled: (boolean)
Returns:
(boolean) New failover state
Or
(nil)
(table) Error description
Promote leaders in replicasets.
Parameters:
- replicaset_uuid: (table) ] = leader_uuid }
- opts:
- force_inconsistency: (optional boolean) (default: false)
- skip_error_on_change: (optional boolean) Skip etcd error if vclockkeeper was changed between calls (default: false)
Returns:
(boolean) true On success
Or
(nil)
(table) Error description
Stops failover across cluster at runtime. Will be useful in case of “failover storms” when failover triggers too many times in minute.
Returns:
(boolean) true On success
Or
(nil)
(table) Error description
Starts failover across cluster at runtime after pause
.
Don’t forget to resume your failover after pausing it.
Returns:
(boolean) true On success
Or
(nil)
(table) Error description
Failover parameters.
(Added in v2.0.2-2)
Fields:
- mode: (string) Supported modes are “disabled”, “eventual”, “stateful” or “raft”
- state_provider: (optional string) Supported state providers are “tarantool” and “etcd2”.
- failover_timeout: (number) (added in v2.3.0-52)Timeout (in seconds), used by membership tomark
suspect
members asdead
(default: 20) - tarantool_params: (added in v2.0.2-2)
- etcd2_params: (added in v2.1.2-26)
- prefix: (string) Prefix used for etcd keys:
<prefix>/lock
and`<prefix>/leaders` - lock_delay: (optional number) Timeout (in seconds), determines lock’s time-to-live (default: 10)
- endpoints: (optional table) URIs that are used to discover and to access etcd cluster instances.(default:
{'http://localhost:2379', 'http://localhost:4001'}
) - username: (optional string) (default: “”)
- password: (optional string) (default: “”)
- prefix: (string) Prefix used for etcd keys:
- fencing_enabled: (boolean) (added in v2.3.0-57)Abandon leadership when both the state provider quorum and atleast one replica are lost (suitable in stateful mode only,default: false)
- fencing_timeout: (number) (added in v2.3.0-57)Time (in seconds) to actuate fencing after the check fails(default: 10)
- fencing_pause: (number) (added in v2.3.0-57)The period (in seconds) of performing the check(default: 2)
- leader_autoreturn: (boolean) (added in v2.7.7)If enabled, then switched leader will return after `
autoreturn_delay
`(default: false) - autoreturn_delay: (number) (added in v2.7.7)Time (in seconds) until failover try to return leader to the first nodein `
failover_priority
`(default: 300) - check_cookie_hash: (boolean) (added in v2.7.8)If enabled, then check that nobody else uses this stateboard(default: true)