vttestserver

vttestserver

vttestserver allows users to spawn a self-contained Vitess server for local testing/CI.

  1. vttestserver [flags]

Options

  1. --alsologtostderr log to standard error as well as files
  2. --app_idle_timeout duration Idle timeout for app connections (default 1m0s)
  3. --app_pool_size int Size of the connection pool for app connections (default 40)
  4. --backup_engine_implementation string Specifies 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")
  5. --backup_storage_block_size int if backup_storage_compress is true, backup_storage_block_size sets the byte size for each block while compressing (default is 250000). (default 250000)
  6. --backup_storage_compress if set, the backup files will be compressed. (default true)
  7. --backup_storage_number_blocks int if backup_storage_compress is true, backup_storage_number_blocks sets the number of blocks that can be processed, in parallel, before the writer blocks, during compression (default is 2). It should be equal to the number of CPUs available for compression. (default 2)
  8. --builtinbackup-file-read-buffer-size uint read files using an IO buffer of this many bytes. Golang defaults are used when set to 0.
  9. --builtinbackup-file-write-buffer-size uint write files using an IO buffer of this many bytes. Golang defaults are used when set to 0. (default 2097152)
  10. --builtinbackup_mysqld_timeout duration how long to wait for mysqld to shutdown at the start of the backup. (default 10m0s)
  11. --builtinbackup_progress duration how often to send progress updates when backing up large files. (default 5s)
  12. --catch-sigpipe catch and ignore SIGPIPE on stdout and stderr if specified
  13. --cells strings Comma separated list of cells (default [test])
  14. --charset string MySQL charset (default "utf8mb4")
  15. --compression-engine-name string compressor engine used for compression. (default "pargzip")
  16. --compression-level int what level to pass to the compressor. (default 1)
  17. --config-file string Full path of the config file (with extension) to use. If set, --config-path, --config-type, and --config-name are ignored.
  18. --config-file-not-found-handling ConfigFileNotFoundHandling Behavior when a config file is not found. (Options: error, exit, ignore, warn) (default warn)
  19. --config-name string Name of the config file (without extension) to search for. (default "vtconfig")
  20. --config-path strings Paths to search for config files in. (default [$WORKDIR])
  21. --config-persistence-min-interval duration minimum interval between persisting dynamic config changes back to disk (if no change has occurred, nothing is done). (default 1s)
  22. --config-type string Config file type (omit to infer config type from file extension).
  23. --consul_auth_static_file string JSON File to read the topos/tokens from.
  24. --data_dir string Directory where the data files will be placed, defaults to a random directory under /vt/vtdataroot
  25. --dba_idle_timeout duration Idle timeout for dba connections (default 1m0s)
  26. --dba_pool_size int Size of the connection pool for dba connections (default 20)
  27. --default_schema_dir string Default directory for initial schema files. If no schema is found in schema_dir, default to this location.
  28. --disable_active_reparents if set, do not allow active reparents. Use this to protect a cluster using external reparents.
  29. --enable_direct_ddl Allow users to submit direct DDL statements (default true)
  30. --enable_online_ddl Allow users to submit, review and control Online DDL (default true)
  31. --enable_system_settings This will enable the system settings to be changed per session at the database connection level (default true)
  32. --external-compressor string command with arguments to use when compressing a backup.
  33. --external-compressor-extension string extension to use when using an external compressor.
  34. --external-decompressor string command with arguments to use when decompressing a backup.
  35. --external_topo_global_root string the path of the global topology data in the global topology server for vtcombo process
  36. --external_topo_global_server_address string the address of the global topology server for vtcombo process
  37. --external_topo_implementation string the topology implementation to use for vtcombo process
  38. --extra_my_cnf string extra files to add to the config, separated by ':'
  39. --foreign_key_mode string This is to provide how to handle foreign key constraint in create/alter table. Valid values are: allow, disallow (default "allow")
  40. --grpc_auth_mode string Which auth plugin implementation to use (eg: static)
  41. --grpc_auth_mtls_allowed_substrings string List of substrings of at least one of the client certificate names (separated by colon).
  42. --grpc_auth_static_client_creds string When using grpc_static_auth in the server, this file provides the credentials to use to authenticate with server.
  43. --grpc_auth_static_password_file string JSON File to read the users/passwords from.
  44. --grpc_bind_address string Bind address for gRPC calls. If empty, listen on all addresses.
  45. --grpc_ca string server CA to use for gRPC connections, requires TLS, and enforces client certificate check
  46. --grpc_cert string server certificate to use for gRPC connections, requires grpc_key, enables TLS
  47. --grpc_compression string Which protocol to use for compressing gRPC. Default: nothing. Supported: snappy
  48. --grpc_crl string path to a certificate revocation list in PEM format, client certificates will be further verified against this file during TLS handshake
  49. --grpc_enable_optional_tls enable optional TLS mode when a server accepts both TLS and plain-text connections on the same port
  50. --grpc_enable_tracing Enable gRPC tracing.
  51. --grpc_initial_conn_window_size int gRPC initial connection window size
  52. --grpc_initial_window_size int gRPC initial window size
  53. --grpc_keepalive_time duration After 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)
  54. --grpc_keepalive_timeout duration After 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)
  55. --grpc_key string server private key to use for gRPC connections, requires grpc_cert, enables TLS
  56. --grpc_max_connection_age duration Maximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s)
  57. --grpc_max_connection_age_grace duration Additional grace period after grpc_max_connection_age, after which connections are forcibly closed. (default 2562047h47m16.854775807s)
  58. --grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216)
  59. --grpc_port int Port to listen on for gRPC calls. If zero, do not listen.
  60. --grpc_prometheus Enable gRPC monitoring with Prometheus.
  61. --grpc_server_ca string path to server CA in PEM format, which will be combine with server cert, return full certificate chain to clients
  62. --grpc_server_initial_conn_window_size int gRPC server initial connection window size
  63. --grpc_server_initial_window_size int gRPC server initial window size
  64. --grpc_server_keepalive_enforcement_policy_min_time duration gRPC server minimum keepalive time (default 10s)
  65. --grpc_server_keepalive_enforcement_policy_permit_without_stream gRPC server permit client keepalive pings even when there are no active streams (RPCs)
  66. -h, --help help for vttestserver
  67. --initialize_with_random_data If this flag is each table-shard will be initialized with random data. See also the 'rng_seed' and 'min_shard_size' and 'max_shard_size' flags.
  68. --keep_logs duration keep logs for this long (using ctime) (zero to keep forever)
  69. --keep_logs_by_mtime duration keep logs for this long (using mtime) (zero to keep forever)
  70. --keyspaces strings Comma separated list of keyspaces (default [test_keyspace])
  71. --lameduck-period duration keep running at least this long after SIGTERM before stopping (default 50ms)
  72. --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
  73. --log_dir string If non-empty, write log files in this directory
  74. --log_err_stacks log stack traces for errors
  75. --log_rotate_max_size uint size in bytes at which logs are rotated (glog.MaxSize) (default 1887436800)
  76. --logtostderr log to standard error instead of files
  77. --manifest-external-decompressor string command with arguments to store in the backup manifest when compressing a backup with an external compression engine.
  78. --max-stack-size int configure the maximum stack size in bytes (default 67108864)
  79. --max_table_shard_size int The maximum number of initial rows in a table shard. Ignored if--initialize_with_random_data is false. The actual number is chosen randomly (default 10000)
  80. --min_table_shard_size int The minimum number of initial rows in a table shard. Ignored if--initialize_with_random_data is false. The actual number is chosen randomly. (default 1000)
  81. --mysql_bind_host string which host to bind vtgate mysql listener to (default "localhost")
  82. --mysql_only If this flag is set only mysql is initialized. The rest of the vitess components are not started. Also, the output specifies the mysql unix socket instead of the vtgate port.
  83. --mysql_server_version string MySQL server version to advertise. (default "8.0.30-Vitess")
  84. --mysqlctl_mycnf_template string template file to use for generating the my.cnf file during server init
  85. --mysqlctl_socket string socket file to use for remote mysqlctl actions (empty for local actions)
  86. --null_probability float The probability to initialize a field with 'NULL' if --initialize_with_random_data is true. Only applies to fields that can contain NULL values. (default 0.1)
  87. --num_shards strings Comma separated shard count (one per keyspace) (default [2])
  88. --onclose_timeout duration wait no more than this for OnClose handlers before stopping (default 10s)
  89. --onterm_timeout duration wait no more than this for OnTermSync handlers before stopping (default 10s)
  90. --persistent_mode If this flag is set, the MySQL data directory is not cleaned up when LocalCluster.TearDown() is called. This is useful for running vttestserver as a database container in local developer environments. Note that db migration files (--schema_dir option) and seeding of random data (--initialize_with_random_data option) will only run during cluster startup if the data directory does not already exist. Changes to VSchema are persisted across cluster restarts using a simple watcher if the --data_dir argument is specified.
  91. --pid_file string If set, the process will write its pid to the named file, and delete it on graceful shutdown.
  92. --planner-version string Sets the default planner to use when the session has not changed it. Valid values are: Gen4, Gen4Greedy, Gen4Left2Right
  93. --pool_hostname_resolve_interval duration if set force an update to all hostnames and reconnect if changed, defaults to 0 (disabled)
  94. --port int Port to use for vtcombo. If this is 0, a random port will be chosen.
  95. --pprof strings enable profiling
  96. --proto_topo string Define the fake cluster topology as a compact text format encoded vttest proto. See vttest.proto for more information.
  97. --purge_logs_interval duration how often try to remove old logs (default 1h0m0s)
  98. --queryserver-config-transaction-timeout float query server transaction timeout (in seconds), a transaction will be killed if it takes longer than this value
  99. --rdonly_count int Rdonly tablets per shard (default 1)
  100. --replica_count int Replica tablets per shard (includes primary) (default 2)
  101. --replication_connect_retry duration how long to wait in between replica reconnect attempts. Only precise to the second. (default 10s)
  102. --rng_seed int The random number generator seed to use when initializing with random data (see also --initialize_with_random_data). Multiple runs with the same seed will result with the same initial data. (default 123)
  103. --schema_dir string Directory for initial schema files. Within this dir, there should be a subdir for each keyspace. Within each keyspace dir, each file is executed as SQL after the database is created on each shard. If the directory contains a vschema.json file, it will be used as the vschema for the V3 API.
  104. --security_policy string the 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)
  105. --service_map strings comma separated list of services to enable (or disable if prefixed with '-') Example: grpc-queryservice
  106. --snapshot_file string A MySQL DB snapshot file
  107. --sql-max-length-errors int truncate queries in error logs to the given length (default unlimited)
  108. --sql-max-length-ui int truncate queries in debug UIs to the given length (default 512) (default 512)
  109. --stderrthreshold severity logs at or above this threshold go to stderr (default 1)
  110. --table-refresh-interval int interval in milliseconds to refresh tables in status page with refreshRequired class
  111. --tablet_dir string The directory within the vtdataroot to store vttablet/mysql files. Defaults to being generated by the tablet uid.
  112. --tablet_hostname string The hostname to use for the tablet otherwise it will be derived from OS' hostname (default "localhost")
  113. --tablet_manager_grpc_ca string the server ca to use to validate servers when connecting
  114. --tablet_manager_grpc_cert string the cert to use to connect
  115. --tablet_manager_grpc_concurrency int concurrency to use to talk to a vttablet server for performance-sensitive RPCs (like ExecuteFetchAs{Dba,AllPrivs,App}) (default 8)
  116. --tablet_manager_grpc_connpool_size int number of tablets to keep tmclient connections open to (default 100)
  117. --tablet_manager_grpc_crl string the server crl to use to validate server certificates when connecting
  118. --tablet_manager_grpc_key string the key to use to connect
  119. --tablet_manager_grpc_server_name string the server name to use to validate server certificate
  120. --tablet_manager_protocol string Protocol to use to make tabletmanager RPCs to vttablets. (default "grpc")
  121. --tablet_refresh_interval duration Interval at which vtgate refreshes tablet information from topology server. (default 10s)
  122. --topo_consul_lock_delay duration LockDelay for consul session. (default 15s)
  123. --topo_consul_lock_session_checks string List of checks for consul session. (default "serfHealth")
  124. --topo_consul_lock_session_ttl string TTL for consul session.
  125. --topo_consul_watch_poll_duration duration time of the long poll for watch queries. (default 30s)
  126. --topo_zk_auth_file string auth to use when connecting to the zk topo server, file contents should be <scheme>:<auth>, e.g., digest:user:pass
  127. --topo_zk_base_timeout duration zk base timeout (see zk.Connect) (default 30s)
  128. --topo_zk_max_concurrency int maximum number of pending requests to send to a Zookeeper server. (default 64)
  129. --topo_zk_tls_ca string the server ca to use to validate servers when connecting to the zk topo server
  130. --topo_zk_tls_cert string the cert to use to connect to the zk topo server, requires topo_zk_tls_key, enables TLS
  131. --topo_zk_tls_key string the key to use to connect to the zk topo server, enables TLS
  132. --transaction_mode string Transaction mode MULTI (default), SINGLE or TWOPC (default "MULTI")
  133. --v Level log level for V logs
  134. -v, --version print binary version
  135. --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
  136. --vschema_ddl_authorized_users string Comma separated list of users authorized to execute vschema ddl operations via vtgate
  137. --vtctl_client_protocol string Protocol to use to talk to the vtctl server. (default "grpc")
  138. --vtctld_grpc_ca string the server ca to use to validate servers when connecting
  139. --vtctld_grpc_cert string the cert to use to connect
  140. --vtctld_grpc_crl string the server crl to use to validate server certificates when connecting
  141. --vtctld_grpc_key string the key to use to connect
  142. --vtctld_grpc_server_name string the server name to use to validate server certificate
  143. --vtgate_grpc_ca string the server ca to use to validate servers when connecting
  144. --vtgate_grpc_cert string the cert to use to connect
  145. --vtgate_grpc_crl string the server crl to use to validate server certificates when connecting
  146. --vtgate_grpc_key string the key to use to connect
  147. --vtgate_grpc_server_name string the server name to use to validate server certificate
  148. --xbstream_restore_flags string Flags 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
  149. --xtrabackup_backup_flags string Flags to pass to backup command. These should be space separated and will be added to the end of the command
  150. --xtrabackup_prepare_flags string Flags to pass to prepare command. These should be space separated and will be added to the end of the command
  151. --xtrabackup_root_path string Directory location of the xtrabackup and xbstream executables, e.g., /usr/bin
  152. --xtrabackup_stream_mode string Which mode to use if streaming, valid values are tar and xbstream. Please note that tar is not supported in XtraBackup 8.0 (default "tar")
  153. --xtrabackup_stripe_block_size uint Size in bytes of each block that gets sent to a given stripe before rotating to the next stripe (default 102400)
  154. --xtrabackup_stripes uint If greater than 0, use data striping across this many destination files to parallelize data transfer and decompression
  155. --xtrabackup_user string User that xtrabackup will use to connect to the database server. This user must have all necessary privileges. For details, please refer to xtrabackup documentation.