Class cartridge.test-helpers.cluster
Class to run and manage multiple tarantool instances.
Functions
Cluster:new (object) | Build cluster object. |
Cluster:server (alias) | Find server by alias. |
Cluster:start () | Bootstraps cluster if it wasn't bootstrapped before. |
Cluster:stop () | Stop all servers. |
Cluster:join_server (server) | Register running server in the cluster. |
Cluster:wait_until_healthy (server) | Blocks fiber until cartridge.is_healthy() returns true on main_server. |
Cluster:upload_config (config) | Upload application config, shortcut for cluster.main_server:upload_config(config) . |
Cluster:download_config () | Download application config, shortcut for cluster.main_server:download_config() . |
Cluster:retrying (config, fn[, ...]) | Keeps calling fn until it returns without error. |
Tables
cartridge.test-helpers.cluster.replicaset_config | Replicaset config. |
Functions
- Cluster:new (object)
-
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
Returns:
-
object
- object
- Cluster:server (alias)
-
Find server by alias.
Parameters:
- alias string
Returns:
- Cluster:start ()
- Bootstraps cluster if it wasn't bootstrapped before. Otherwise starts servers.
- Cluster:stop ()
- Stop all servers.
- Cluster:join_server (server)
-
Register running server in the cluster.
Parameters:
- server Server Server to be registered.
- Cluster:wait_until_healthy (server)
-
Blocks fiber until
cartridge.is_healthy()
returns true on main_server.Parameters:
- server
- Cluster:upload_config (config)
-
Upload application config, shortcut for
cluster.main_server:upload_config(config)
.Parameters:
- config
See also:
- Cluster:download_config ()
-
Download application config, shortcut for
cluster.main_server:download_config()
.See also:
- Cluster:retrying (config, fn[, ...])
-
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)
- config
tab
Options for