vttestserver

vttestserver #

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

vttestserver [flags]

Options #

      --alsologtostderr                                                  log to standard error as well as files
      --app-idle-timeout duration                                        Idle timeout for app connections (default 1m0s)
      --app-pool-size int                                                Size of the connection pool for app connections (default 40)
      --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")
      --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)
      --backup-storage-compress                                          if set, the backup files will be compressed. (default true)
      --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)
      --builtinbackup-file-read-buffer-size uint                         read files using an IO buffer of this many bytes. Golang defaults are used when set to 0.
      --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)
      --builtinbackup-incremental-restore-path string                    the directory where incremental restore files, namely binlog files, are extracted to. In k8s environments, this should be set to a directory that is shared between the vttablet and mysqld pods. The path should exist. When empty, the default OS temp dir is assumed.
      --builtinbackup-mysqld-timeout duration                            how long to wait for mysqld to shutdown at the start of the backup. (default 10m0s)
      --builtinbackup-progress duration                                  how often to send progress updates when backing up large files. (default 5s)
      --catch-sigpipe                                                    catch and ignore SIGPIPE on stdout and stderr if specified
      --cells strings                                                    Comma separated list of cells (default [test])
      --charset string                                                   MySQL charset (default "utf8mb4")
      --compression-engine-name string                                   compressor engine used for compression. (default "pargzip")
      --compression-level int                                            what level to pass to the compressor. (default 1)
      --config-file string                                               Full path of the config file (with extension) to use. If set, --config-path, --config-type, and --config-name are ignored.
      --config-file-not-found-handling ConfigFileNotFoundHandling        Behavior when a config file is not found. (Options: error, exit, ignore, warn) (default warn)
      --config-name string                                               Name of the config file (without extension) to search for. (default "vtconfig")
      --config-path strings                                              Paths to search for config files in. (default [<WORKDIR>])
      --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)
      --config-type string                                               Config file type (omit to infer config type from file extension).
      --consul-auth-static-file string                                   JSON File to read the topos/tokens from.
      --data-dir string                                                  Directory where the data files will be placed, defaults to a random directory under /vt/vtdataroot
      --dba-idle-timeout duration                                        Idle timeout for dba connections (default 1m0s)
      --dba-pool-size int                                                Size of the connection pool for dba connections (default 20)
      --default-schema-dir string                                        Default directory for initial schema files. If no schema is found in schema-dir, default to this location.
      --enable-direct-ddl                                                Allow users to submit direct DDL statements (default true)
      --enable-online-ddl                                                Allow users to submit, review and control Online DDL (default true)
      --enable-system-settings                                           This will enable the system settings to be changed per session at the database connection level (default true)
      --external-compressor string                                       command with arguments to use when compressing a backup.
      --external-compressor-extension string                             extension to use when using an external compressor.
      --external-decompressor string                                     command with arguments to use when decompressing a backup.
      --external-topo-global-root string                                 the path of the global topology data in the global topology server for vtcombo process
      --external-topo-global-server-address string                       the address of the global topology server for vtcombo process
      --external-topo-implementation string                              the topology implementation to use for vtcombo process
      --extra-my-cnf string                                              extra files to add to the config, separated by ':'
      --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")
      --grpc-auth-mode string                                            Which auth plugin implementation to use (eg: static)
      --grpc-auth-mtls-allowed-substrings string                         List of substrings of at least one of the client certificate names (separated by colon).
      --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.
      --grpc-auth-static-password-file string                            JSON File to read the users/passwords from.
      --grpc-bind-address string                                         Bind address for gRPC calls. If empty, listen on all addresses.
      --grpc-ca string                                                   server CA to use for gRPC connections, requires TLS, and enforces client certificate check
      --grpc-cert string                                                 server certificate to use for gRPC connections, requires grpc-key, enables TLS
      --grpc-compression string                                          Which protocol to use for compressing gRPC. Default: nothing. Supported: snappy
      --grpc-crl string                                                  path to a certificate revocation list in PEM format, client certificates will be further verified against this file during TLS handshake
      --grpc-dial-concurrency-limit int                                  Maximum concurrency of grpc dial operations. This should be less than the golang max thread limit of 10000. (default 1024)
      --grpc-enable-optional-tls                                         enable optional TLS mode when a server accepts both TLS and plain-text connections on the same port
      --grpc-enable-orca-metrics                                         gRPC server option to enable sending ORCA metrics to clients for load balancing
      --grpc-enable-tracing                                              Enable gRPC tracing.
      --grpc-initial-conn-window-size int                                gRPC initial connection window size
      --grpc-initial-window-size int                                     gRPC initial window size
      --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)
      --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)
      --grpc-key string                                                  server private key to use for gRPC connections, requires grpc-cert, enables TLS
      --grpc-max-connection-age duration                                 Maximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s)
      --grpc-max-connection-age-grace duration                           Additional grace period after grpc-max-connection-age, after which connections are forcibly closed. (default 2562047h47m16.854775807s)
      --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)
      --grpc-port int                                                    Port to listen on for gRPC calls. If zero, do not listen.
      --grpc-prometheus                                                  Enable gRPC monitoring with Prometheus.
      --grpc-server-ca string                                            path to server CA in PEM format, which will be combine with server cert, return full certificate chain to clients
      --grpc-server-initial-conn-window-size int                         gRPC server initial connection window size
      --grpc-server-initial-window-size int                              gRPC server initial window size
      --grpc-server-keepalive-enforcement-policy-min-time duration       gRPC server minimum keepalive time (default 10s)
      --grpc-server-keepalive-enforcement-policy-permit-without-stream   gRPC server permit client keepalive pings even when there are no active streams (RPCs)
      --grpc-server-keepalive-time duration                              After a duration of this time, if the server doesn't see any activity, it pings the client to see if the transport is still alive. (default 10s)
      --grpc-server-keepalive-timeout duration                           After having pinged for keepalive check, the server waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s)
  -h, --help                                                             help for vttestserver
      --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.
      --initialize-with-vt-dba-tcp                                       If this flag is enabled, MySQL will be initialized with an additional user named vt_dba_tcp, who will have access via TCP/IP connection.
      --keep-logs duration                                               keep logs for this long (using ctime) (zero to keep forever)
      --keep-logs-by-mtime duration                                      keep logs for this long (using mtime) (zero to keep forever)
      --keyspaces strings                                                Comma separated list of keyspaces (default [test_keyspace])
      --lameduck-period duration                                         keep running at least this long after SIGTERM before stopping (default 50ms)
      --log-err-stacks                                                   log stack traces for errors
      --log-rotate-max-size uint                                         size in bytes at which logs are rotated (glog.MaxSize) (default 1887436800)
      --log_backtrace_at traceLocations                                  when logging hits line file:N, emit a stack trace
      --log_dir string                                                   If non-empty, write log files in this directory
      --logtostderr                                                      log to standard error instead of files
      --manifest-external-decompressor string                            command with arguments to store in the backup manifest when compressing a backup with an external compression engine.
      --max-stack-size int                                               configure the maximum stack size in bytes (default 67108864)
      --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)
      --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)
      --mysql-bind-host string                                           which host to bind vtgate mysql listener to (default "localhost")
      --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.
      --mysql-server-version string                                      MySQL server version to advertise. (default "8.4.6-Vitess")
      --mysql-shell-backup-location string                               location where the backup will be stored
      --mysql-shell-dump-flags string                                    flags to pass to mysql shell dump utility. This should be a JSON string and will be saved in the MANIFEST (default "{\"threads\": 4}")
      --mysql-shell-flags string                                         execution flags to pass to mysqlsh binary to be used during dump/load (default "--defaults-file=/dev/null --js -h localhost")
      --mysql-shell-load-flags string                                    flags to pass to mysql shell load utility. This should be a JSON string (default "{\"threads\": 4, \"loadUsers\": true, \"updateGtidSet\": \"replace\", \"skipBinlog\": true, \"progressFile\": \"\"}")
      --mysql-shell-should-drain                                         decide if we should drain while taking a backup or continue to serving traffic
      --mysql-shell-speedup-restore                                      speed up restore by disabling redo logging and double write buffer during the restore process
      --mysqlctl-mycnf-template string                                   template file to use for generating the my.cnf file during server init
      --mysqlctl-socket string                                           socket file to use for remote mysqlctl actions (empty for local actions)
      --no-scatter                                                       when set to true, the planner will fail instead of producing a plan that includes scatter queries
      --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)
      --num-shards strings                                               Comma separated shard count (one per keyspace) (default [2])
      --onclose-timeout duration                                         wait no more than this for OnClose handlers before stopping (default 10s)
      --onterm-timeout duration                                          wait no more than this for OnTermSync handlers before stopping (default 10s)
      --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.
      --pid-file string                                                  If set, the process will write its pid to the named file, and delete it on graceful shutdown.
      --planner-version string                                           Sets the default planner to use when the session has not changed it. Valid values are: Gen4, Gen4Greedy, Gen4Left2Right
      --pool-hostname-resolve-interval duration                          if set force an update to all hostnames and reconnect if changed, defaults to 0 (disabled)
      --port int                                                         Port to use for vtcombo. If this is 0, a random port will be chosen.
      --pprof strings                                                    enable profiling
      --pprof-http                                                       enable pprof http endpoints
      --proto-topo string                                                Define the fake cluster topology as a compact text format encoded vttest proto. See vttest.proto for more information.
      --purge-logs-interval duration                                     how often try to remove old logs (default 1h0m0s)
      --queryserver-config-transaction-timeout duration                  query server transaction timeout, a transaction will be killed if it takes longer than this value (default 30s)
      --rdonly-count int                                                 Rdonly tablets per shard (default 1)
      --replica-count int                                                Replica tablets per shard (includes primary) (default 2)
      --replication-connect-retry duration                               how long to wait in between replica reconnect attempts. Only precise to the second. (default 10s)
      --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)
      --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.
      --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)
      --service-map strings                                              comma separated list of services to enable (or disable if prefixed with '-') Example: grpc-queryservice
      --snapshot-file string                                             A MySQL DB snapshot file
      --sql-max-length-errors int                                        truncate queries in error logs to the given length (default unlimited)
      --sql-max-length-ui int                                            truncate queries in debug UIs to the given length (default 512) (default 512)
      --stderrthreshold severityFlag                                     logs at or above this threshold go to stderr (default 1)
      --table-refresh-interval int                                       interval in milliseconds to refresh tables in status page with refreshRequired class
      --tablet-dir string                                                The directory within the vtdataroot to store vttablet/mysql files. Defaults to being generated by the tablet uid.
      --tablet-hostname string                                           The hostname to use for the tablet otherwise it will be derived from OS' hostname (default "localhost")
      --tablet-manager-grpc-ca string                                    the server ca to use to validate servers when connecting
      --tablet-manager-grpc-cert string                                  the cert to use to connect
      --tablet-manager-grpc-concurrency int                              concurrency to use to talk to a vttablet server for performance-sensitive RPCs (like ExecuteFetchAs{Dba,App}, CheckThrottler and FullStatus) (default 8)
      --tablet-manager-grpc-connpool-size int                            number of tablets to keep tmclient connections open to (default 100)
      --tablet-manager-grpc-crl string                                   the server crl to use to validate server certificates when connecting
      --tablet-manager-grpc-key string                                   the key to use to connect
      --tablet-manager-grpc-server-name string                           the server name to use to validate server certificate
      --tablet-manager-protocol string                                   Protocol to use to make tabletmanager RPCs to vttablets. (default "grpc")
      --tablet-refresh-interval duration                                 Interval at which vtgate refreshes tablet information from topology server. (default 10s)
      --topo-consul-lock-delay duration                                  LockDelay for consul session. (default 15s)
      --topo-consul-lock-session-checks string                           List of checks for consul session. (default "serfHealth")
      --topo-consul-lock-session-ttl string                              TTL for consul session.
      --topo-consul-watch-poll-duration duration                         time of the long poll for watch queries. (default 30s)
      --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
      --topo-zk-base-timeout duration                                    zk base timeout (see zk.Connect) (default 30s)
      --topo-zk-max-concurrency int                                      maximum number of pending requests to send to a Zookeeper server. (default 64)
      --topo-zk-tls-ca string                                            the server ca to use to validate servers when connecting to the zk topo server
      --topo-zk-tls-cert string                                          the cert to use to connect to the zk topo server, requires topo-zk-tls-key, enables TLS
      --topo-zk-tls-key string                                           the key to use to connect to the zk topo server, enables TLS
      --transaction-mode string                                          Transaction mode MULTI (default), SINGLE or TWOPC  (default "MULTI")
      --v Level                                                          log level for V logs
  -v, --version                                                          print binary version
      --vmodule vModuleFlag                                              comma-separated list of pattern=N settings for file-filtered logging
      --vschema-ddl-authorized-users string                              Comma separated list of users authorized to execute vschema ddl operations via vtgate
      --vtcombo-bind-host string                                         which host to bind vtcombo servenv listener to (default "localhost")
      --vtctl-client-protocol string                                     Protocol to use to talk to the vtctl server. (default "grpc")
      --vtctld-grpc-ca string                                            the server ca to use to validate servers when connecting
      --vtctld-grpc-cert string                                          the cert to use to connect
      --vtctld-grpc-crl string                                           the server crl to use to validate server certificates when connecting
      --vtctld-grpc-key string                                           the key to use to connect
      --vtctld-grpc-server-name string                                   the server name to use to validate server certificate
      --vtgate-grpc-ca string                                            the server ca to use to validate servers when connecting
      --vtgate-grpc-cert string                                          the cert to use to connect
      --vtgate-grpc-crl string                                           the server crl to use to validate server certificates when connecting
      --vtgate-grpc-fail-fast                                            whether to enable grpc fail fast when connecting
      --vtgate-grpc-key string                                           the key to use to connect
      --vtgate-grpc-server-name string                                   the server name to use to validate server certificate
      --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
      --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
      --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
      --xtrabackup-root-path string                                      Directory location of the xtrabackup and xbstream executables, e.g., /usr/bin
      --xtrabackup-should-drain                                          Decide if we should drain while taking a backup or continue to serving traffic
      --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")
      --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)
      --xtrabackup-stripes uint                                          If greater than 0, use data striping across this many destination files to parallelize data transfer and decompression
      --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.