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:

Returns:

    {ServerInfo,...}

Or

  1. nil
  2. table Error description
get_replicasets ([uuid])
Get replicasets list. Optionally filter out the replicaset with given uuid.

Parameters:

Returns:

    {ReplicasetInfo,...}

Or

  1. nil
  2. table Error description
probe_server (uri)
Discover an instance.

Parameters:

enable_servers (uuids)
Enable nodes after they were disabled.

Parameters:

Returns:

    {ServerInfo,...}

Or

  1. nil
  2. table Error description
disable_servers (uuids)
Temporarily diable nodes.

Parameters:

Returns:

    {ServerInfo,...}

Or

  1. nil
  2. 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

  1. nil
  2. table Error description
bootstrap ()
Call vshard.router.bootstrap(). This function distributes all buckets across the replica sets.

Returns:

    boolean true

Or

  1. nil
  2. 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:

Returns:

    table

Or

  1. nil
  2. table Error description
get_info (uri)
Retrieve box.cfg and box.info of a remote server.

Parameters:

Returns:

    table

Or

  1. nil
  2. table Error description
get_self ()
Get alias, uri and uuid of current instance.

Returns:

    table

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:

EditReplicasetParams
Replicatets modifications.

Fields:

JoinServerParams
Parameters required for joining a new server.

Fields:

EditServerParams
Servers modifications.

Fields:

  • uri optional string
  • uuid string
  • labels optional table
  • disabled optional boolean
  • expelled optional boolean Expelling an instance is permanent and can't be undone. It's suitable for situations when the hardware is destroyed, snapshots are lost and there is no hope to bring it back to life.

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:

Returns:

    boolean true

Or

  1. nil
  2. table Error description
edit_server (args)
Edit an instance (deprecated).

(Deprecated since v1.0.0-17 in favor of cartridge.admin_edit_topology)

Parameters:

Returns:

    boolean true

Or

  1. nil
  2. table Error description
expel_server (uuid)
Expel an instance (deprecated). Forever.

(Deprecated since v1.0.0-17 in favor of cartridge.admin_edit_topology)

Parameters:

Returns:

    boolean true

Or

  1. nil
  2. table Error description
edit_replicaset (args)
Edit replicaset parameters (deprecated).

(Deprecated since v1.0.0-17 in favor of cartridge.admin_edit_topology)

Parameters:

Returns:

    boolean true

Or

  1. nil
  2. table Error description
generated by LDoc 1.4.6 Last updated 2019-12-27 18:00:49