vtctl Generic Command Reference

The following generic vtctl commands are available for administering Vitess.

Commands

Validate

Validates that all nodes reachable from the global replication graph and that all tablets in all discoverable cells are consistent.

Example

  1. Validate -- [--ping-tablets]

Flags

NameTypeDefinition
ping-tabletsBooleanIndicates whether all tablets should be pinged during the validation process

ListAllTablets

Lists all tablets in an awk-friendly way.

Example

  1. ListAllTablets -- [--keyspace=''] [--tablet_type=<primary,replica,rdonly,spare>] [<cell_name1>,<cell_name2>,...]

Arguments

  • <cell_name> – Optional. A cell is a location for a service. Generally, a cell resides in only one cluster. In Vitess, the terms “cell” and “data center” are interchangeable. The argument value is a string that does not contain whitespace. This allows you to request server side filtering to exlude tablets in cells not explicitly specified.

Flags

NameTypeDefinition
keyspacestring(Optional) A keyspace is a logical database. This allows you to request server side filtering to exlude tablets not in this keyspace.
tablet_typestring(Optional) A tablet type is one of PRIMARY,REPLICA,RDONLY,SPARE. This allows you to request server side filtering to exlude tablets not of this type.

Errors

  • An error will be returned if you specify a non-existent cell or an invalid tablet type.

ListTablets

Lists specified tablets in an awk-friendly way.

Example

  1. ListTablets <tablet alias> ...

Arguments

  • <tablet alias> – Required. A Tablet Alias uniquely identifies a vttablet. The argument value is in the format <cell name>-<uid>. To specify multiple values for this argument, separate individual values with a space.

Errors

  • the <tablet alias> argument is required for the <ListTablets> command This error occurs if the command is not called with at least one argument.

GenerateShardRanges

Generates shard ranges assuming a keyspace with N shards.

Example

  1. GenerateShardRanges -- [--num_shards 2]

Flags

NameTypeDefinition
num_shardsIntegerNumber of shards to generate shard ranges for. (default 2)

Help

Provides help for a command.

Example

  1. Help [command name]

See Also