Class cartridge.test-helpers.cluster | Tarantool
Документация на русском языке
поддерживается сообществом
Tarantool Cartridge Table of contents Class cartridge.test-helpers.cluster

Class cartridge.test-helpers.cluster

Class to run and manage multiple tarantool instances.

Build cluster object.

Parameters:

  • object:
    • datadir: (string) Data directory for all cluster servers.
    • server_command: (string) Command to run server.
    • cookie: (string) Cluster cookie.
    • base_http_port: (int) Value to calculate server’s http_port. (optional)
    • base_advertise_port: (int) Value to calculate server’s advertise_port. (optional)
    • use_vshard: (bool) bootstrap vshard after server is started. (optional)
    • replicasets: (tab) Replicasets configuration. List of replicaset_config
    • failover: (string) Failover mode: disabled, eventual, or stateful. (optional)
    • stateboard_entrypoint: (string) Command to run stateboard. (optional)
    • zone_distances: (tab) Vshard distances between zones. (optional)
    • swim_period: (number) SWIM protocol period in seconds. (optional)
    • auth_enabled: (bool) Enable authentication. (optional)

Returns:

object

Find server by alias.

Parameters:

Returns:

cartridge.test-helpers.server

Find server by role name.

Parameters:

Returns:

cartridge.test-helpers.server

Return list of servers with enabled role by role name

Parameters:

Returns:

cartridge.test-helpers.server

Execute edit_topology GraphQL request to setup replicasets, apply roles join servers to replicasets.

Configure replicasets and bootstrap vshard if required.

Parameters:

  • timeout: HTTP request timeout in seconds, forwarded to:ref:Cluster:bootstrap_vshard <cartridge.test-helpers.cluster.Cluster:bootstrap_vshard>. (optional)

Bootstrap vshard in the cluster.

Parameters:

  • timeout: HTTP request timeout in seconds. Distributing bucketsacross the storages may take a while, so a greater timeout may be neededon slow CI runners. (optional)

Bootstraps cluster if it wasn’t bootstrapped before. Otherwise starts servers.

Parameters:

  • timeout: HTTP request timeout in seconds, forwarded to:ref:Cluster:bootstrap <cartridge.test-helpers.cluster.Cluster:bootstrap> and then to Cluster:bootstrap_vshard. (optional)

Stop all servers.

Register running server in the cluster.

Parameters:

  • server: (Server) Server to be registered.

Blocks fiber until cartridge.is_healthy() returns true on main_server.

Parameters:

  • server:
  • opts:

Upload application config, shortcut for cluster.main_server:upload_config(config) .

Parameters:

  • config:
  • opts:

See also:

  • cartridge.test-helpers.server.Server:upload_config

Download application config, shortcut for cluster.main_server:download_config() .

See also:

  • cartridge.test-helpers.server.Server:download_config

Keeps calling fn until it returns without error. Throws last error if config.timeout is elapsed.

Parameters:

  • config: (tab) Options for luatest.helpers.retrying .
  • fn: (func) Function to call
  • …: Args to run fn with. (optional)

Replicaset config.

Fields:

  • alias: (string) Prefix to generate server alias automatically. (optional)
  • uuid: (string) Replicaset uuid. (optional)
  • roles: ({string}) List of roles for servers in the replicaset.
  • vshard_group: (optional string) Name of vshard group.
  • weight: (optional number) Vshard group weight.
  • all_rw: (optional boolean) Make all replicas writable.
  • servers: (table or number) List of objects to build Server s with or.. code-block:: lua number of servers in replicaset.

Return iterator for cluster server’s with enabled role

Parameters:

  • cluster:
  • role_name:
Нашли ответ на свой вопрос?
Обратная связь