Module cartridge.admin
Administration functions.
Functions
get_servers ([uuid]) | Get servers list. |
get_replicasets ([uuid]) | Get replicasets list. |
probe_server (uri) | Discover an instance. |
enable_servers (uuids) | Enable nodes after they were disabled. |
disable_servers (uuids) | Temporarily diable nodes. |
get_failover_enabled () | Get current failover state. |
set_failover_enabled (enabled) | Enable or disable automatic failover. |
bootstrap () | Call vshard.router.bootstrap() . |
Tables
ServerInfo | Instance general information. |
ReplicasetInfo | Replicaset general information. |
Local Functions
get_stat (uri) | Retrieve box.slab.info of a remote server. |
get_info (uri) | Retrieve box.cfg and box.info of a remote server. |
get_self () | Get alias, uri and uuid of current instance. |
Editing topology
edit_topology (args) | Edit cluster topology. |
EditReplicasetParams | Replicatets modifications. |
JoinServerParams | Parameters required for joining a new server. |
EditServerParams | Servers modifications. |
Deprecated functions
join_server (args) | Join an instance to the cluster (deprecated). |
edit_server (args) | Edit an instance (deprecated). |
expel_server (uuid) | Expel an instance (deprecated). |
edit_replicaset (args) | Edit replicaset parameters (deprecated). |
Functions
- get_servers ([uuid])
-
Get servers list.
Optionally filter out the server with the given uuid.
Parameters:
- uuid string (optional)
Returns:
Or
- nil
- table Error description
- get_replicasets ([uuid])
-
Get replicasets list.
Optionally filter out the replicaset with given uuid.
Parameters:
- uuid string (optional)
Returns:
Or
- nil
- table Error description
- probe_server (uri)
-
Discover an instance.
Parameters:
- uri string
- enable_servers (uuids)
-
Enable nodes after they were disabled.
Parameters:
- uuids {string,...}
Returns:
Or
- nil
- table Error description
- disable_servers (uuids)
-
Temporarily diable nodes.
Parameters:
- uuids {string,...}
Returns:
Or
- nil
- table Error description
- get_failover_enabled ()
- Get current failover state.
- set_failover_enabled (enabled)
-
Enable or disable automatic failover.
Parameters:
- enabled boolean
Returns:
-
boolean
New failover state
Or
- nil
- table Error description
- bootstrap ()
-
Call
vshard.router.bootstrap()
. This function distributes all buckets across the replica sets.Returns:
-
boolean
true
Or
- nil
- table Error description
Tables
- ServerInfo
-
Instance general information.
Fields:
- alias string Human-readable instance name.
- uri string
- uuid string
- disabled boolean
- status string Instance health.
- message string Auxilary health status.
- replicaset ReplicasetInfo Circular reference to a replicaset.
- priority number Leadership priority for automatic failover.
- clock_delta number Difference between remote clock and the current one (in seconds), obtained from the membership module (SWIM protocol). Positive values mean remote clock are ahead of local, and vice versa.
- ReplicasetInfo
-
Replicaset general information.
Fields:
- uuid string The replicaset UUID.
- roles {string,...} Roles enabled on the replicaset.
- status string Replicaset health.
- master ServerInfo Replicaset leader according to configuration.
- active_master ServerInfo Active leader.
- weight number Vshard replicaset weight. Matters only if vshard-storage role is enabled.
- vshard_group string Name of vshard group the replicaset belongs to.
- all_rw boolean A flag indicating that all servers in the replicaset should be read-write.
- alias string Human-readable replicaset name.
- servers {ServerInfo,...} Circular reference to all instances in the replicaset.
Local Functions
- get_stat (uri)
-
Retrieve
box.slab.info
of a remote server.Parameters:
- uri string
Returns:
Or
- nil
- table Error description
- get_info (uri)
-
Retrieve
box.cfg
andbox.info
of a remote server.Parameters:
- uri string
Returns:
Or
- nil
- table Error description
- get_self ()
-
Get alias, uri and uuid of current instance.
Returns:
Editing topology
- edit_topology (args)
-
Edit cluster topology.
This function can be used for:
- bootstrapping cluster from scratch
- joining a server to an existing replicaset
- creating new replicaset with one or more servers
- editing uri/labels of servers
- disabling and expelling servers
(Added in v1.0.0-17)
Parameters:
- args
- servers optional {EditServerParams,..}
- replicasets optional {EditReplicasetParams,..}
- EditReplicasetParams
-
Replicatets modifications.
Fields:
- uuid optional string
- alias optional string
- roles optional {string,...}
- all_rw optional boolean
- weight optional number
- failover_priority optional {string,...} array of uuids specifying servers failover priority
- vshard_group optional string
- join_servers optional {JoinServerParams,...}
- JoinServerParams
-
Parameters required for joining a new server.
Fields:
- EditServerParams
-
Servers modifications.
Fields:
Deprecated functions
- join_server (args)
-
Join an instance to the cluster (deprecated).
(Deprecated since v1.0.0-17 in favor of cartridge.admin_edit_topology)
Parameters:
- args
- uri string
- instance_uuid optional string
- replicaset_uuid optional string
- roles optional {string,...}
- timeout optional number
- labels optional {[string]=string,...}
- vshard_group optional string
- replicaset_alias optional string
- replicaset_weight optional number
Returns:
-
boolean
true
Or
- nil
- table Error description
- args
- edit_server (args)
-
Edit an instance (deprecated).
(Deprecated since v1.0.0-17 in favor of cartridge.admin_edit_topology)
Parameters:
- args
- uuid string
- uri optional string
- labels optional {[string]=string,...}
Returns:
-
boolean
true
Or
- nil
- table Error description
- args
- expel_server (uuid)
-
Expel an instance (deprecated).
Forever.
(Deprecated since v1.0.0-17 in favor of cartridge.admin_edit_topology)
Parameters:
- uuid string
Returns:
-
boolean
true
Or
- nil
- table Error description
- edit_replicaset (args)
-
Edit replicaset parameters (deprecated).
(Deprecated since v1.0.0-17 in favor of cartridge.admin_edit_topology)
Parameters:
- args
- uuid string
- alias string
- roles optional {string,...}
- master optional {string,...} Failover order
- weight optional number
- vshard_group optional string
- all_rw optional boolean
Returns:
-
boolean
true
Or
- nil
- table Error description
- args