Managing a Cartridge application
Важно
The Tarantool Cartridge framework is deprecated and is not compatible with Tarantool 3.0 and later. This command is added for backward compatibility with earlier versions.
$ tt cartridge COMMAND {[OPTION ...]|SUBCOMMAND}
tt cartridge manages a Cartridge application.
COMMAND is one of the following:
$ tt cartridge admin ADMIN_FUNC_NAME [ADMIN_OPTION ...]
tt cartridge admin calls admin functions provided by the application.
- 
--nameSTRING¶
- (Required) An application name. 
- 
-l,--list¶
- List the available admin functions. 
- 
--instanceSTRING¶
- A name of the instance to connect to. 
- 
--connSTRING¶
- An address to connect to. 
- 
--run-dirSTRING¶
- A directory where PID and socket files are stored. Defaults to - /var/run/tarantool.
Get a list of the available admin functions:
$ tt cartridge admin --name APPNAME --list
   • Available admin functions:
probe  Probe instance
Get help for a specific function:
$ tt cartridge admin --name APPNAME probe --help
   • Admin function "probe" usage:
Probe instance
Args:
  --uri string  Instance URI
Call a function with an argument:
$ tt cartridge admin --name APPNAME probe --uri localhost:3301
   • Probe "localhost:3301": OK
$ tt cartridge bench [BENCH_OPTION ...]
tt cartridge bench runs benchmarks for Tarantool.
- 
--urlSTRING¶
- A Tarantool instance address (the default is - 127.0.0.1:3301).
- 
--userSTRING¶
- A username used to connect to the instance (the default is - guest).
- 
--passwordSTRING¶
- A password used to connect to the instance. 
- 
--connectionsINT¶
- A number of concurrent connections (the default is - 10).
- 
--requestsINT¶
- A number of simultaneous requests per connection (the default is - 10).
- 
--durationINT¶
- The duration of a benchmark test in seconds (the default is - 10).
- 
--keysizeINT¶
- The size of a key part of benchmark data in bytes (the default is - 10).
- 
--datasizeINT¶
- The size of a value part of benchmark data in bytes (the default is - 20).
- 
--insertINT¶
- A percentage of inserts (the default is - 100).
- 
--selectINT¶
- A percentage of selects. 
- 
--updateINT¶
- A percentage of updates. 
- 
--fillINT¶
- A number of records to pre-fill the space (the default is - 1000000).
$ tt cartridge failover COMMAND [COMMAND_OPTION ...]
tt cartridge failover manages an application failover.
The following commands are available:
- set
- setup
- status
- disable
$ tt cartridge failover set MODE [FAILOVER_SET_OPTION ...]
Setup failover in the specified mode:
- stateful
- eventual
- disabled
Options:
- --state-provider STRING: A failover’s state provider. Can be- stateboardor- etcd2. Used only in the- statefulmode.
- --params STRING: Failover parameters specified in a JSON-formatted string, for example,- "{'fencing_timeout': 10', 'fencing_enabled': true}".
- --provider-params STRING: Failover provider parameters specified in a JSON-formatted string, for example,- "{'lock_delay': 14}".
$ tt cartridge failover setup --file STRING
Setup failover with parameters described in a file.
The failover configuration file defaults to failover.yml.
The failover.yml file might look as follows:
mode: stateful
state_provider: stateboard
stateboard_params:
    uri: localhost:4401
    password: passwd
failover_timeout: 15
$ tt cartridge repair COMMAND [REPAIR_OPTION ...]
tt cartridge repair repairs a running application.
The following commands are available:
- list-topology
- remove-instance
- set-advertise-uri
- set-leader
$ tt cartridge repair list-topology [REPAIR_OPTION ...]
Get a summary of the current cluster topology.
$ tt cartridge repair remove-instance UUID [REPAIR_OPTION ...]
Remove the instance with the specified UUID from the cluster. If the instance isn’t found, raise an error.
$ tt cartridge repair set-advertise-uri INSTANCE-UUID NEW-URI [REPAIR_OPTION ...]
Change the instance’s advertise URI. Raise an error if the instance isn’t found or is expelled.
$ tt cartridge repair set-leader REPLICASET-UUID INSTANCE-UUID [REPAIR_OPTION ...]
Set the instance as the leader of the replica set. Raise an error in the following cases:
- There is no replica set or instance with that UUID.
- The instance doesn’t belong to the replica set.
- The instance has been disabled or expelled.
The following options work with any repair subcommand:
- 
--name¶
- (Required) An application name. 
- 
--data-dir¶
- The directory containing the instances“ working directories. Defaults to - /var/lib/tarantool.
The following options work with any repair command, except list-topology:
- 
--run-dir¶
- The directory where PID and socket files are stored. Defaults to - /var/run/tarantool.
- 
--dry-run¶
- Launch in dry-run mode: show changes but do not apply them. 
- 
--reload¶
- Enable instance configuration to reload after the patch. 
$ tt cartridge replicasets COMMAND [COMMAND_OPTION ...]
tt cartridge replicasets manages an application’s replica sets.
The following commands are available:
- setup
- save
- list
- join
- list-roles
- list-vshard-groups
- add-roles
- remove-roles
- set-weight
- set-failover-priority
- bootstrap-vshard
- expel
$ tt cartridge replicasets setup [--file FILEPATH] [--bootstrap-vshard]
Setup replica sets using a file.
Options:
- --file: A file with a replica set configuration. Defaults to- replicasets.yml.
- --bootstrap-vshard: Bootstrap vshard upon setup.
$ tt cartridge replicasets save [--file FILEPATH]
Save the current replica set configuration to a file.
Options:
- --file: A file to save the configuration to. Defaults to- replicasets.yml.
$ tt cartridge replicasets list [--replicaset STRING]
List the current cluster topology.
Options:
- --replicaset STRING: A replica set name.
$ tt cartridge replicasets join INSTANCE_NAME ... [--replicaset STRING]
Join the instance to a cluster. If a replica set with the specified alias isn’t found in the cluster, it is created. Otherwise, instances are joined to an existing replica set.
Options:
- --replicaset STRING: A replica set name.
$ tt cartridge replicasets list-vshard-groups
List the available vshard groups.
$ tt cartridge replicasets add-roles ROLE_NAME ... [--replicaset STRING] [--vshard-group STRING]
Add roles to the replica set.
Options:
- --replicaset STRING: A replica set name.
- --vshard-group STRING: A vshard group for- vshard-storagereplica sets.
$ tt cartridge replicasets remove-roles ROLE_NAME ... [--replicaset STRING]
Remove roles from the replica set.
Options:
- --replicaset STRING: A replica set name.
$ tt cartridge replicasets set-weight WEIGHT [--replicaset STRING]
Specify replica set weight.
Options:
- --replicaset STRING: A replica set name.
$ tt cartridge replicasets set-failover-priority INSTANCE_NAME ... [--replicaset STRING]
Configure replica set failover priority.
Options:
- --replicaset STRING: A replica set name.