vtctl

vtctl Command Index

vtctl is a command-line tool used to administer a Vitess cluster. It is available as both a standalone tool (vtctl) and client-server (vtctlclient in combination with vtctld). Using client-server is recommended, as it provides an additional layer of security when using the client remotely.

Commands #

Tablets #

NameExample Usage
InitTabletInitTablet [-allow_update] [-allow_different_shard] [-allow_master_override] [-parent] [-db_name_override=<db name>] [-hostname=<hostname>] [-mysql_port=<port>] [-port=<port>] [-grpc_port=<port>] [-tags=tag1:value1,tag2:value2] -keyspace=<keyspace> -shard=<shard> <tablet alias> <tablet type>
GetTabletGetTablet <tablet alias>
UpdateTabletAddrsUpdateTabletAddrs [-hostname <hostname>] [-ip-addr <ip addr>] [-mysql-port <mysql port>] [-vt-port <vt port>] [-grpc-port <grpc port>] <tablet alias>
DeleteTabletDeleteTablet [-allow_master] <tablet alias> ...
SetReadOnlySetReadOnly <tablet alias>
SetReadWriteSetReadWrite <tablet alias>
StartReplicationStartReplication <tablet alias>
StopReplicationStopReplication <tablet alias>
ChangeTabletTypeChangeTabletType [-dry-run] <tablet alias> <tablet type>
PingPing <tablet alias>
RefreshStateRefreshState <tablet alias>
RefreshStateByShardRefreshStateByShard [-cells=c1,c2,...] <keyspace/shard>
RunHealthCheckRunHealthCheck <tablet alias>
IgnoreHealthErrorIgnoreHealthError <tablet alias> <ignore regexp>
SleepSleep <tablet alias> <duration>
ExecuteHookExecuteHook <tablet alias> <hook name> [<param1=value1> <param2=value2> ...]
ExecuteFetchAsAppExecuteFetchAsApp [-max_rows=10000] [-json] [-use_pool] <tablet alias> <sql command>
ExecuteFetchAsDbaExecuteFetchAsDba [-max_rows=10000] [-disable_binlogs] [-json] <tablet alias> <sql command>
VReplicationExecVReplicationExec [-json] <tablet alias> <sql command>
BackupBackup [-concurrency=4] [-allow_master=false] <tablet alias>
RestoreFromBackupRestoreFromBackup <tablet alias>
ReparentTabletReparentTablet <tablet alias>

Shards #

NameExample Usage
CreateShardCreateShard [-force] [-parent] <keyspace/shard>
GetShardGetShard <keyspace/shard>
ValidateShardValidateShard [-ping-tablets] <keyspace/shard>
ShardReplicationPositionsShardReplicationPositions <keyspace/shard>
ListShardTabletsListShardTablets <keyspace/shard>
SetShardIsMasterServingSetShardIsMasterServing <keyspace/shard> <is_master_serving>
SetShardTabletControlSetShardTabletControl [--cells=c1,c2,...] [--blacklisted_tables=t1,t2,...] [--remove] [--disable_query_service] <keyspace/shard> <tablet type>
UpdateSrvKeyspacePartitionUpdateSrvKeyspacePartition [--cells=c1,c2,...] [--remove] <keyspace/shard> <tablet type>
SourceShardDeleteSourceShardDelete <keyspace/shard> <uid>
SourceShardAddSourceShardAdd [--key_range=<keyrange>] [--tables=<table1,table2,...>] <keyspace/shard> <uid> <source keyspace/shard>
ShardReplicationFixShardReplicationFix <cell> <keyspace/shard>
WaitForFilteredReplicationWaitForFilteredReplication [-max_delay <max_delay, default 30s>] <keyspace/shard>
RemoveShardCellRemoveShardCell [-force] [-recursive] <keyspace/shard> <cell>
DeleteShardDeleteShard [-recursive] [-even_if_serving] <keyspace/shard> ...
ListBackupsListBackups <keyspace/shard>
BackupShardBackupShard [-allow_master=false] <keyspace/shard>
RemoveBackupRemoveBackup <keyspace/shard> <backup name>
InitShardMasterInitShardMaster [-force] [-wait_replicas_timeout=<duration>] <keyspace/shard> <tablet alias>
PlannedReparentShardPlannedReparentShard -keyspace_shard=<keyspace/shard> [-new_master=<tablet alias>] [-avoid_master=<tablet alias>] [-wait_replicas_timeout=<duration>]
EmergencyReparentShardEmergencyReparentShard -keyspace_shard=<keyspace/shard> -new_master=<tablet alias>
TabletExternallyReparentedTabletExternallyReparented <tablet alias>

Keyspaces #

NameExample Usage
CreateKeyspaceCreateKeyspace [-sharding_column_name=name] [-sharding_column_type=type] [-served_from=tablettype1:ks1,tablettype2:ks2,...] [-force] [-keyspace_type=type] [-base_keyspace=base_keyspace] [-snapshot_time=time] <keyspace name>
DeleteKeyspaceDeleteKeyspace [-recursive] <keyspace>
RemoveKeyspaceCellRemoveKeyspaceCell [-force] [-recursive] <keyspace> <cell>
GetKeyspaceGetKeyspace <keyspace>
GetKeyspacesGetKeyspaces
SetKeyspaceShardingInfoSetKeyspaceShardingInfo [-force] <keyspace name> [<column name>] [<column type>]
SetKeyspaceServedFromSetKeyspaceServedFrom [-source=<source keyspace name>] [-remove] [-cells=c1,c2,...] <keyspace name> <tablet type>
RebuildKeyspaceGraphRebuildKeyspaceGraph [-cells=c1,c2,...] <keyspace> ...
ValidateKeyspaceValidateKeyspace [-ping-tablets] <keyspace name>
ReshardReshard [-skip_schema_copy] <keyspace.workflow> <source_shards> <target_shards>
MoveTablesMoveTables [-cell=<cell>] [-tablet_types=<source_tablet_types>] -workflow=<workflow> <source_keyspace> <target_keyspace> <table_specs>
DropSourcesDropSources [-dry_run] <keyspace.workflow>
CreateLookupVindexCreateLookupVindex [-cell=<cell>] [-tablet_types=<source_tablet_types>] <keyspace> <json_spec>
ExternalizeVindexExternalizeVindex <keyspace>.<vindex>
MaterializeMaterialize <json_spec>, example : '{"workflow": "aaa", "source_keyspace": "source", "target_keyspace": "target", "table_settings": [{"target_table": "customer", "source_expression": "select * from customer", "create_ddl": "copy"}]}'
SplitCloneSplitClone <keyspace> <from_shards> <to_shards>
VerticalSplitCloneVerticalSplitClone <from_keyspace> <to_keyspace> <tables>
VDiffVDiff [-source_cell=<cell>] [-target_cell=<cell>] [-tablet_types=replica] [-filtered_replication_wait_time=30s] <keyspace.workflow>
MigrateServedTypesMigrateServedTypes [-cells=c1,c2,...] [-reverse] [-skip-refresh-state] <keyspace/shard> <served tablet type>
MigrateServedFromMigrateServedFrom [-cells=c1,c2,...] [-reverse] <destination keyspace/shard> <served tablet type>
SwitchReadsSwitchReads [-cells=c1,c2,...] [-reverse] -tablet_type={replica|rdonly} [-dry-run] <keyspace.workflow>
SwitchWritesSwitchWrites [-filtered_replication_wait_time=30s] [-cancel] [-reverse_replication=false] [-dry-run] <keyspace.workflow>
CancelReshardingCancelResharding <keyspace/shard>
ShowReshardingShowResharding <keyspace/shard>
FindAllShardsInKeyspaceFindAllShardsInKeyspace <keyspace>
WaitForDrainWaitForDrain [-timeout <duration>] [-retry_delay <duration>] [-initial_wait <duration>] <keyspace/shard> <served tablet type>

Generic #

NameExample Usage
ValidateValidate [-ping-tablets]
ListAllTabletsListAllTablets <cell name1>, <cell name2>, ...
ListTabletsListTablets <tablet alias> ...
HelpHelp [command name]

Schema, Version, Permissions #

NameExample Usage
GetSchemaGetSchema [-tables=<table1>,<table2>,...] [-exclude_tables=<table1>,<table2>,...] [-include-views] <tablet alias>
ReloadSchemaReloadSchema <tablet alias>
ReloadSchemaShardReloadSchemaShard [-concurrency=10] [-include_master=false] <keyspace/shard>
ReloadSchemaKeyspaceReloadSchemaKeyspace [-concurrency=10] [-include_master=false] <keyspace>
ValidateSchemaShardValidateSchemaShard [-exclude_tables=''] [-include-views] <keyspace/shard>
ValidateSchemaKeyspaceValidateSchemaKeyspace [-exclude_tables=''] [-include-views] <keyspace name>
ApplySchemaApplySchema [-allow_long_unavailability] [-wait_replicas_timeout=10s] {-sql=<sql> || -sql-file=<filename>} <keyspace>
CopySchemaShardCopySchemaShard [-tables=<table1>,<table2>,...] [-exclude_tables=<table1>,<table2>,...] [-include-views] [-skip-verify] [-wait_replicas_timeout=10s] {<source keyspace/shard> || <source tablet alias>} <destination keyspace/shard>
ValidateVersionShardValidateVersionShard <keyspace/shard>
ValidateVersionKeyspaceValidateVersionKeyspace <keyspace name>
GetPermissionsGetPermissions <tablet alias>
ValidatePermissionsShardValidatePermissionsShard <keyspace/shard>
ValidatePermissionsKeyspaceValidatePermissionsKeyspace <keyspace name>
GetVSchemaGetVSchema <keyspace>
ApplyVSchemaApplyVSchema {-vschema=<vschema> || -vschema_file=<vschema file> || -sql=<sql> || -sql_file=<sql file>} [-cells=c1,c2,...] [-skip_rebuild] [-dry-run] <keyspace>
GetRoutingRulesGetRoutingRules
ApplyRoutingRulesApplyRoutingRules {-rules=<rules> || -rules_file=<rules_file>} [-cells=c1,c2,...] [-skip_rebuild] [-dry-run]
RebuildVSchemaGraphRebuildVSchemaGraph [-cells=c1,c2,...]

Serving Graph #

NameExample Usage
GetSrvKeyspaceNamesGetSrvKeyspaceNames <cell>
GetSrvKeyspaceGetSrvKeyspace <cell> <keyspace>
GetSrvVSchemaGetSrvVSchema <cell>
DeleteSrvVSchemaDeleteSrvVSchema <cell>

Replication Graph #

NameExample Usage
GetShardReplicationGetShardReplication <cell> <keyspace/shard>

Cells #

NameExample Usage
AddCellInfoAddCellInfo [-server_address <addr>] [-root <root>] <cell>
UpdateCellInfoUpdateCellInfo [-server_address <addr>] [-root <root>] <cell>
DeleteCellInfoDeleteCellInfo [-force] <cell>
GetCellInfoNamesGetCellInfoNames
GetCellInfoGetCellInfo <cell>

CellsAliases #

NameExample Usage
AddCellsAliasAddCellsAlias [-cells <cell,cell2...>] <alias>
UpdateCellsAliasUpdateCellsAlias [-cells <cell,cell2,...>] <alias>
DeleteCellsAliasDeleteCellsAlias <alias>
GetCellsAliasesGetCellsAliases

Queries #

NameExample Usage
VtGateExecuteVtGateExecute -server <vtgate> [-bind_variables <JSON map>] [-keyspace <default keyspace>] [-tablet_type <tablet type>] [-options <proto text options>] [-json] <sql>
VtTabletExecuteVtTabletExecute [-username <TableACL user>] [-transaction_id <transaction_id>] [-options <proto text options>] [-json] <tablet alias> <sql>
VtTabletBeginVtTabletBegin [-username <TableACL user>] <tablet alias>
VtTabletCommitVtTabletCommit [-username <TableACL user>] <transaction_id>
VtTabletRollbackVtTabletRollback [-username <TableACL user>] <tablet alias> <transaction_id>
VtTabletStreamHealthVtTabletStreamHealth [-count <count, default 1>] <tablet alias>

Resharding Throttler #

NameExample Usage
ThrottlerMaxRatesThrottlerMaxRates -server <vtworker or vttablet>
ThrottlerSetMaxRateThrottlerSetMaxRate -server <vtworker or vttablet> <rate>
GetThrottlerConfigurationGetThrottlerConfiguration -server <vtworker or vttablet> [<throttler name>]
UpdateThrottlerConfigurationUpdateThrottlerConfiguration -server <vtworker or vttablet> [-copy_zero_values] "<configuration protobuf text>" [<throttler name>]
ResetThrottlerConfigurationResetThrottlerConfiguration -server <vtworker or vttablet> [<throttler name>]

Topo #

NameExample Usage
TopoCatTopoCat [-cell <cell>] [-decode_proto] [-decode_proto_json] [-long] <path> [<path>...]
TopoCpTopoCp [-cell <cell>] [-to_topo] <src> <dst>

Workflows #

NameExample Usage
WorkflowCreateWorkflowCreate [-skip_start] <factoryName> [parameters...]
WorkflowStartWorkflowStart <uuid>
WorkflowStopWorkflowStop <uuid>
WorkflowDeleteWorkflowDelete <uuid>
WorkflowWaitWorkflowWait <uuid>
WorkflowTreeWorkflowTree
WorkflowActionWorkflowAction <path> <name>

Options #

The following global options apply to vtctl:

NameTypeDefinition
-alsologtostderrlog to standard error as well as files
-app_idle_timeoutdurationIdle timeout for app connections (default 1m0s)
-app_pool_sizeintSize of the connection pool for app connections (default 40)
-azblob_backup_account_key_filestringPath to a file containing the Azure Storage account key; if this flag is unset, the environment variable VT_AZBLOB_ACCOUNT_KEY will be used as the key itself (NOT a file path)
-azblob_backup_account_namestringAzure Storage Account name for backups; if this flag is unset, the environment variable VT_AZBLOB_ACCOUNT_NAME will be used
-azblob_backup_container_namestringAzure Blob Container Name
-azblob_backup_parallelismintAzure Blob operation parallelism (requires extra memory when increased) (default 1)
-azblob_backup_storage_rootstringRoot prefix for all backup-related Azure Blobs; this should exclude both initial and trailing ‘/’ (e.g. just ‘a/b’ not ‘/a/b/')
-backup_engine_implementationstringSpecifies which implementation to use for creating new backups (builtin or xtrabackup). Restores will always be done with whichever engine created a given backup. (default “builtin”)
-backup_storage_block_sizeintif backup_storage_compress is true, backup_storage_block_size sets the byte size for each block while compressing (default is 250000). (default 250000)
-backup_storage_compressif set, the backup files will be compressed (default is true). Set to false for instance if a backup_storage_hook is specified and it compresses the data. (default true)
-backup_storage_hookstringif set, we send the contents of the backup files through this hook.
-backup_storage_implementationstringwhich implementation to use for the backup storage feature
-backup_storage_number_blocksintif backup_storage_compress is true, backup_storage_number_blocks sets the number of blocks that can be processed, at once, before the writer blocks, during compression (default is 2). It should be equal to the number of CPUs available for compression (default 2)
-binlog_player_protocolstringthe protocol to download binlogs from a vttablet (default “grpc”)
-binlog_use_v3_resharding_modeTrue iff the binlog streamer should use V3-style sharding, which doesn’t require a preset sharding key column. (default true)
-ceph_backup_storage_configstringPath to JSON config file for ceph backup storage (default “ceph_backup_config.json”)
-consul_auth_static_filestringJSON File to read the topos/tokens from.
-cpu_profilestringwrite cpu profile to file
-datadog-agent-hoststringhost to send spans to. if empty, no tracing will be done
-datadog-agent-portstringport to send spans to. if empty, no tracing will be done
-db-credentials-filestringdb credentials file; send SIGHUP to reload this file
-db-credentials-serverstringdb credentials server type (use ‘file’ for the file implementation) (default “file”)
-dba_idle_timeoutdurationIdle timeout for dba connections (default 1m0s)
-dba_pool_sizeintSize of the connection pool for dba connections (default 20)
-detachdetached mode - run vtcl detached from the terminal
-disable_active_reparentsif set, do not allow active reparents. Use this to protect a cluster using external reparents.
-discovery_high_replication_lag_minimum_servingdurationthe replication lag that is considered too high when selecting the minimum num vttablets for serving (default 2h0m0s)
-discovery_low_replication_lagdurationthe replication lag that is considered low enough to be healthy (default 30s)
-emit_statstrue iff we should emit stats to push-based monitoring/stats backends
-enable-consolidatorThis option enables the query consolidator. (default true)
-enable-consolidator-replicasThis option enables the query consolidator only on replicas.
-enable-query-plan-field-cachingThis option fetches & caches fields (columns) when storing query plans (default true)
-enable-tx-throttlerIf true replication-lag-based throttling on transactions will be enabled.
-enable_hot_row_protectionIf true, incoming transactions for the same row (range) will be queued and cannot consume all txpool slots.
-enable_hot_row_protection_dry_runIf true, hot row protection is not enforced but logs if transactions would have been queued.
-enable_queriesif set, allows vtgate and vttablet queries. May have security implications, as the queries will be run from this process.
-enable_transaction_limitIf true, limit on number of transactions open at the same time will be enforced for all users. User trying to open a new transaction after exhausting their limit will receive an error immediately, regardless of whether there are available slots or not.
-enable_transaction_limit_dry_runIf true, limit on number of transactions open at the same time will be tracked for all users, but not enforced.
-enforce_strict_trans_tablesIf true, vttablet requires MySQL to run with STRICT_TRANS_TABLES or STRICT_ALL_TABLES on. It is recommended to not turn this flag off. Otherwise MySQL may alter your supplied values before saving them to the database. (default true)
-file_backup_storage_rootstringroot directory for the file backup storage
-gcs_backup_storage_bucketstringGoogle Cloud Storage bucket to use for backups
-gcs_backup_storage_rootstringroot prefix for all backup-related object names
-grpc_auth_modestringWhich auth plugin implementation to use (eg: static)
-grpc_auth_mtls_allowed_substringsstringList of substrings of at least one of the client certificate names (separated by colon).
-grpc_auth_static_client_credsstringwhen using grpc_static_auth in the server, this file provides the credentials to use to authenticate with server
-grpc_auth_static_password_filestringJSON File to read the users/passwords from.
-grpc_castringca to use, requires TLS, and enforces client cert check
-grpc_certstringcertificate to use, requires grpc_key, enables TLS
-grpc_compressionstringhow to compress gRPC, default: nothing, supported: snappy
-grpc_enable_tracingEnable GRPC tracing
-grpc_initial_conn_window_sizeintgrpc initial connection window size
-grpc_initial_window_sizeintgrpc initial window size
-grpc_keepalive_timedurationAfter a duration of this time if the client doesn’t see any activity it pings the server to see if the transport is still alive. (default 10s)
-grpc_keepalive_timeoutdurationAfter having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s)
-grpc_keystringkey to use, requires grpc_cert, enables TLS
-grpc_max_connection_agedurationMaximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s)
-grpc_max_connection_age_gracedurationAdditional grace period after grpc_max_connection_age, after which connections are forcibly closed. (default 2562047h47m16.854775807s)
-grpc_max_message_sizeintMaximum allowed RPC message size. Larger messages will be rejected by gRPC with the error ‘exceeding the max size’. (default 16777216)
-grpc_portintPort to listen on for gRPC calls
-grpc_prometheusEnable gRPC monitoring with Prometheus
-grpc_server_initial_conn_window_sizeintgrpc server initial connection window size
-grpc_server_initial_window_sizeintgrpc server initial window size
-grpc_server_keepalive_enforcement_policy_min_timedurationgrpc server minimum keepalive time (default 5m0s)
-grpc_server_keepalive_enforcement_policy_permit_without_streamgrpc server permit client keepalive pings even when there are no active streams (RPCs)
-heartbeat_enableIf true, vttablet records (if master) or checks (if replica) the current time of a replication heartbeat in the table _vt.heartbeat. The result is used to inform the serving state of the vttablet via healthchecks.
-heartbeat_intervaldurationHow frequently to read and write replication heartbeat. (default 1s)
-hot_row_protection_concurrent_transactionsintNumber of concurrent transactions let through to the txpool/MySQL for the same hot row. Should be > 1 to have enough ‘ready’ transactions in MySQL and benefit from a pipelining effect. (default 5)
-hot_row_protection_max_global_queue_sizeintGlobal queue limit across all row (ranges). Useful to prevent that the queue can grow unbounded. (default 1000)
-hot_row_protection_max_queue_sizeintMaximum number of BeginExecute RPCs which will be queued for the same row (range). (default 20)
-jaeger-agent-hoststringhost and port to send spans to. if empty, no tracing will be done
-keep_logsdurationkeep logs for this long (using ctime) (zero to keep forever)
-keep_logs_by_mtimedurationkeep logs for this long (using mtime) (zero to keep forever)
-lameduck-perioddurationkeep running at least this long after SIGTERM before stopping (default 50ms)
-legacy_replication_lag_algorithmuse the legacy algorithm when selecting the vttablets for serving (default true)
-log_backtrace_atvaluewhen logging hits line file:N, emit a stack trace
-log_dirstringIf non-empty, write log files in this directory
-log_err_stackslog stack traces for errors
-log_rotate_max_sizeuintsize in bytes at which logs are rotated (glog.MaxSize) (default 1887436800)
-logtostderrlog to standard error instead of files
-master_connect_retrydurationhow long to wait in between replica reconnect attempts. Only precise to the second. (default 10s)
-mem-profile-rateintprofile every n bytes allocated (default 524288)
-min_number_serving_vttabletsintthe minimum number of vttablets that will be continue to be used even with low replication lag (default 2)
-mutex-profile-fractionintprofile every n mutex contention events (see runtime.SetMutexProfileFraction)
-mysql_auth_server_static_filestringJSON File to read the users/passwords from.
-mysql_auth_server_static_stringstringJSON representation of the users/passwords config.
-mysql_auth_static_reload_intervaldurationTicker to reload credentials
-mysql_clientcert_auth_methodstringclient-side authentication method to use. Supported values: mysql_clear_password, dialog. (default “mysql_clear_password”)
-mysql_server_flush_delaydurationDelay after which buffered response will flushed to client. (default 100ms)
-mysqlctl_client_protocolstringthe protocol to use to talk to the mysqlctl server (default “grpc”)
-mysqlctl_mycnf_templatestringtemplate file to use for generating the my.cnf file during server init
-mysqlctl_socketstringsocket file to use for remote mysqlctl actions (empty for local actions)
-onterm_timeoutdurationwait no more than this for OnTermSync handlers before stopping (default 10s)
-pid_filestringIf set, the process will write its pid to the named file, and delete it on graceful shutdown.
-pool_hostname_resolve_intervaldurationif set force an update to all hostnames and reconnect if changed, defaults to 0 (disabled)
-purge_logs_intervaldurationhow often try to remove old logs (default 1h0m0s)
-query-log-stream-handlerstringURL handler for streaming queries log (default “/debug/querylog”)
-querylog-filter-tagstringstring that must be present in the query as a comment for the query to be logged, works for both vtgate and vttablet
-querylog-formatstringformat for query logs (“text” or “json”) (default “text”)
-queryserver-config-acl-exempt-aclstringan acl that exempt from table acl checking (this acl is free to access any vitess tables).
-queryserver-config-enable-table-acl-dry-runIf this flag is enabled, tabletserver will emit monitoring metrics and let the request pass regardless of table acl check results
-queryserver-config-idle-timeoutintquery server idle timeout (in seconds), vttablet manages various mysql connection pools. This config means if a connection has not been used in given idle timeout, this connection will be removed from pool. This effectively manages number of connection objects and optimize the pool performance. (default 1800)
-queryserver-config-max-dml-rowsintquery server max dml rows per statement, maximum number of rows allowed to return at a time for an update or delete with either 1) an equality where clauses on primary keys, or 2) a subselect statement. For update and delete statements in above two categories, vttablet will split the original query into multiple small queries based on this configuration value.
-queryserver-config-max-result-sizeintquery server max result size, maximum number of rows allowed to return from vttablet for non-streaming queries. (default 10000)
-queryserver-config-message-conn-pool-prefill-parallelismintDEPRECATED: Unused.
-queryserver-config-message-conn-pool-sizeintDEPRECATED
-queryserver-config-message-postpone-capintquery server message postpone cap is the maximum number of messages that can be postponed at any given time. Set this number to substantially lower than transaction cap, so that the transaction pool isn’t exhausted by the message subsystem. (default 4)
-queryserver-config-passthrough-dmlsquery server pass through all dml statements without rewriting
-queryserver-config-pool-prefill-parallelismintquery server read pool prefill parallelism, a non-zero value will prefill the pool using the specified parallism.
-queryserver-config-pool-sizeintquery server read pool size, connection pool is used by regular queries (non streaming, not in a transaction) (default 16)
-queryserver-config-query-cache-sizeintquery server query cache size, maximum number of queries to be cached. vttablet analyzes every incoming query and generate a query plan, these plans are being cached in a lru cache. This config controls the capacity of the lru cache. (default 5000)
-queryserver-config-query-pool-timeoutintquery server query pool timeout (in seconds), it is how long vttablet waits for a connection from the query pool. If set to 0 (default) then the overall query timeout is used instead.
-queryserver-config-query-pool-waiter-capintquery server query pool waiter limit, this is the maximum number of queries that can be queued waiting to get a connection (default 5000)
-queryserver-config-query-timeoutintquery server query timeout (in seconds), this is the query timeout in vttablet side. If a query takes more than this timeout, it will be killed. (default 30)
-queryserver-config-schema-reload-timeintquery server schema reload time, how often vttablet reloads schemas from underlying MySQL instance in seconds. vttablet keeps table schemas in its own memory and periodically refreshes it from MySQL. This config controls the reload time. (default 1800)
-queryserver-config-stream-buffer-sizeintquery server stream buffer size, the maximum number of bytes sent from vttablet for each stream call. It’s recommended to keep this value in sync with vtgate’s stream_buffer_size. (default 32768)
-queryserver-config-stream-pool-prefill-parallelismintquery server stream pool prefill parallelism, a non-zero value will prefill the pool using the specified parallelism
-queryserver-config-stream-pool-sizeintquery server stream connection pool size, stream pool is used by stream queries: queries that return results to client in a streaming fashion (default 200)
-queryserver-config-strict-table-aclonly allow queries that pass table acl checks
-queryserver-config-terse-errorsprevent bind vars from escaping in returned errors
-queryserver-config-transaction-capintquery server transaction cap is the maximum number of transactions allowed to happen at any given point of a time for a single vttablet. E.g. by setting transaction cap to 100, there are at most 100 transactions will be processed by a vttablet and the 101th transaction will be blocked (and fail if it cannot get connection within specified timeout) (default 20)
-queryserver-config-transaction-prefill-parallelismintquery server transaction prefill parallelism, a non-zero value will prefill the pool using the specified parallism.
-queryserver-config-transaction-timeoutintquery server transaction timeout (in seconds), a transaction will be killed if it takes longer than this value (default 30)
-queryserver-config-txpool-timeoutintquery server transaction pool timeout, it is how long vttablet waits if tx pool is full (default 1)
-queryserver-config-txpool-waiter-capintquery server transaction pool waiter limit, this is the maximum number of transactions that can be queued waiting to get a connection (default 5000)
-queryserver-config-warn-result-sizeintquery server result size warning threshold, warn if number of rows returned from vttablet for non-streaming queries exceeds this
-redact-debug-ui-queriesredact full queries and bind variables from debug UI
-remote_operation_timeoutdurationtime to wait for a remote operation (default 30s)
-s3_backup_aws_endpointstringendpoint of the S3 backend (region must be provided)
-s3_backup_aws_regionstringAWS region to use (default “us-east-1”)
-s3_backup_aws_retriesintAWS request retries (default -1)
-s3_backup_force_path_styleforce the s3 path style
-s3_backup_log_levelstringdetermine the S3 loglevel to use from LogOff, LogDebug, LogDebugWithSigning, LogDebugWithHTTPBody, LogDebugWithRequestRetries, LogDebugWithRequestErrors (default “LogOff”)
-s3_backup_server_side_encryptionstringserver-side encryption algorithm (e.g., AES256, aws:kms)
-s3_backup_storage_bucketstringS3 bucket to use for backups
-s3_backup_storage_rootstringroot prefix for all backup-related object names
-s3_backup_tls_skip_verify_certskip the ‘certificate is valid’ check for SSL connections
-security_policystringthe name of a registered security policy to use for controlling access to URLs - empty means allow all for anyone (built-in policies: deny-all, read-only)
-service_mapvaluecomma separated list of services to enable (or disable if prefixed with ‘-') Example: grpc-vtworker
-sql-max-length-errorsinttruncate queries in error logs to the given length (default unlimited)
-sql-max-length-uiinttruncate queries in debug UIs to the given length (default 512) (default 512)
-srv_topo_cache_refreshdurationhow frequently to refresh the topology for cached entries (default 1s)
-srv_topo_cache_ttldurationhow long to use cached entries for topology (default 1s)
-stats_backendstringThe name of the registered push-based monitoring/stats backend to use
-stats_combine_dimensionsstringList of dimensions to be combined into a single “all” value in exported stats vars
-stats_drop_variablesstringVariables to be dropped from the list of exported variables.
-stats_emit_perioddurationInterval between emitting stats to all registered backends (default 1m0s)
-stderrthresholdvaluelogs at or above this threshold go to stderr (default 1)
-tablet_dirstringThe directory within the vtdataroot to store vttablet/mysql files. Defaults to being generated by the tablet uid.
-tablet_grpc_castringthe server ca to use to validate servers when connecting
-tablet_grpc_certstringthe cert to use to connect
-tablet_grpc_keystringthe key to use to connect
-tablet_grpc_server_namestringthe server name to use to validate server certificate
-tablet_manager_grpc_castringthe server ca to use to validate servers when connecting
-tablet_manager_grpc_certstringthe cert to use to connect
-tablet_manager_grpc_concurrencyintconcurrency to use to talk to a vttablet server for performance-sensitive RPCs (like ExecuteFetchAs{Dba,AllPrivs,App}) (default 8)
-tablet_manager_grpc_keystringthe key to use to connect
-tablet_manager_grpc_server_namestringthe server name to use to validate server certificate
-tablet_manager_protocolstringthe protocol to use to talk to vttablet (default “grpc”)
-tablet_protocolstringhow to talk to the vttablets (default “grpc”)
-tablet_url_templatestringformat string describing debug tablet url formatting. See the Go code for getTabletDebugURL() how to customize this. (default “http://{{.GetTabletHostPort}}")
-throttler_client_grpc_castringthe server ca to use to validate servers when connecting
-throttler_client_grpc_certstringthe cert to use to connect
-throttler_client_grpc_keystringthe key to use to connect
-throttler_client_grpc_server_namestringthe server name to use to validate server certificate
-throttler_client_protocolstringthe protocol to use to talk to the integrated throttler service (default “grpc”)
-topo_consul_watch_poll_durationdurationtime of the long poll for watch queries. (default 30s)
-topo_etcd_lease_ttlintLease TTL for locks and master election. The client will use KeepAlive to keep the lease going. (default 30)
-topo_etcd_tls_castringpath to the ca to use to validate the server cert when connecting to the etcd topo server
-topo_etcd_tls_certstringpath to the client cert to use to connect to the etcd topo server, requires topo_etcd_tls_key, enables TLS
-topo_etcd_tls_keystringpath to the client key to use to connect to the etcd topo server, enables TLS
-topo_global_rootstringthe path of the global topology data in the global topology server
-topo_global_server_addressstringthe address of the global topology server
-topo_implementationstringthe topology implementation to use
-topo_k8s_contextstringThe kubeconfig context to use, overrides the ‘current-context’ from the config
-topo_k8s_kubeconfigstringPath to a valid kubeconfig file.
-topo_k8s_namespacestringThe kubernetes namespace to use for all objects. Default comes from the context or in-cluster config
-topo_zk_auth_filestringauth to use when connecting to the zk topo server, file contents should be :, e.g., digest:user:pass
-topo_zk_base_timeoutdurationzk base timeout (see zk.Connect) (default 30s)
-topo_zk_max_concurrencyintmaximum number of pending requests to send to a Zookeeper server. (default 64)
-topo_zk_tls_castringthe server ca to use to validate servers when connecting to the zk topo server
-topo_zk_tls_certstringthe cert to use to connect to the zk topo server, requires topo_zk_tls_key, enables TLS
-topo_zk_tls_keystringthe key to use to connect to the zk topo server, enables TLS
-tracerstringtracing service to use (default “noop”)
-tracing-sampling-ratefloatsampling rate for the probabilistic jaeger sampler (default 0.1)
-transaction-log-stream-handlerstringURL handler for streaming transactions log (default “/debug/txlog”)
-transaction_limit_by_componentInclude CallerID.component when considering who the user is for the purpose of transaction limit.
-transaction_limit_by_principalInclude CallerID.principal when considering who the user is for the purpose of transaction limit. (default true)
-transaction_limit_by_subcomponentInclude CallerID.subcomponent when considering who the user is for the purpose of transaction limit.
-transaction_limit_by_usernameInclude VTGateCallerID.username when considering who the user is for the purpose of transaction limit. (default true)
-transaction_limit_per_userfloatMaximum number of transactions a single user is allowed to use at any time, represented as fraction of -transaction_cap. (default 0.4)
-transaction_shutdown_grace_periodinthow long to wait (in seconds) for transactions to complete during graceful shutdown.
-twopc_abandon_agefloattime in seconds. Any unresolved transaction older than this time will be sent to the coordinator to be resolved.
-twopc_coordinator_addressstringaddress of the (VTGate) process(es) that will be used to notify of abandoned transactions.
-twopc_enableif the flag is on, 2pc is enabled. Other 2pc flags must be supplied.
-tx-throttler-configstringThe configuration of the transaction throttler as a text formatted throttlerdata.Configuration protocol buffer message (default “target_replication_lag_sec: 2 max_replication_lag_sec: 10 initial_rate: 100 max_increase: 1 emergency_decrease: 0.5 min_duration_between_increases_sec: 40 max_duration_between_increases_sec: 62 min_duration_between_decreases_sec: 20 spread_backlog_across_sec: 20 age_bad_rate_after_sec: 180 bad_rate_increase: 0.1 max_rate_approach_threshold: 0.9 “)
-tx-throttler-healthcheck-cellsvalueA comma-separated list of cells. Only tabletservers running in these cells will be monitored for replication lag by the transaction throttler.
-vvaluelog level for V logs
-versionprint binary version
-vmodulevaluecomma-separated list of pattern=N settings for file-filtered logging
-vreplication_healthcheck_retry_delaydurationhealthcheck retry delay (default 5s)
-vreplication_healthcheck_timeoutdurationhealthcheck retry delay (default 1m0s)
-vreplication_healthcheck_topology_refreshdurationrefresh interval for re-reading the topology (default 30s)
-vreplication_retry_delaydurationdelay before retrying a failed binlog connection (default 5s)
-vreplication_tablet_typestringcomma separated list of tablet types used as a source (default “REPLICA”)
-vstream_packet_sizeintSuggested packet size for VReplication streamer. This is used only as a recommendation. The actual packet size may be more or less than this amount. (default 30000)
-vtctl_healthcheck_retry_delaydurationdelay before retrying a failed healthcheck (default 5s)
-vtctl_healthcheck_timeoutdurationthe health check timeout period (default 1m0s)
-vtctl_healthcheck_topology_refreshdurationrefresh interval for re-reading the topology (default 30s)
-vtgate_grpc_castringthe server ca to use to validate servers when connecting
-vtgate_grpc_certstringthe cert to use to connect
-vtgate_grpc_keystringthe key to use to connect
-vtgate_grpc_server_namestringthe server name to use to validate server certificate
-vtgate_protocolstringhow to talk to vtgate (default “grpc”)
-wait-timedurationtime to wait on an action (default 24h0m0s)
-wait_for_drain_sleep_rdonlydurationtime to wait before shutting the query service on old RDONLY tablets during MigrateServedTypes (default 5s)
-wait_for_drain_sleep_replicadurationtime to wait before shutting the query service on old REPLICA tablets during MigrateServedTypes (default 15s)
-watch_replication_streamWhen enabled, vttablet will stream the MySQL replication stream from the local server, and use it to support the include_event_token ExecuteOptions.
-xbstream_restore_flagsstringflags to pass to xbstream command during restore. These should be space separated and will be added to the end of the command. These need to match the ones used for backup e.g. –compress / –decompress, –encrypt / –decrypt
-xtrabackup_backup_flagsstringflags to pass to backup command. These should be space separated and will be added to the end of the command
-xtrabackup_prepare_flagsstringflags to pass to prepare command. These should be space separated and will be added to the end of the command
-xtrabackup_root_pathstringdirectory location of the xtrabackup executable, e.g., /usr/bin
-xtrabackup_stream_modestringwhich mode to use if streaming, valid values are tar and xbstream (default “tar”)
-xtrabackup_stripe_block_sizeuintSize in bytes of each block that gets sent to a given stripe before rotating to the next stripe (default 102400)
-xtrabackup_stripesuintIf greater than 0, use data striping across this many destination files to parallelize data transfer and decompression
-xtrabackup_userstringUser that xtrabackup will use to connect to the database server. This user must have all necessary privileges. For details, please refer to xtrabackup documentation.