`mysqlctld` is a gRPC server that can be used instead of the `mysqlctl` client tool.
If the target directories are empty when it is invoked, it automatically performs initialization operations to bootstrap the `mysqld` instance before starting it.
The `mysqlctld` process can subsequently receive gRPC commands from a `vttablet` to perform housekeeping operations like shutting down and restarting the `mysqld` instance as needed.
{{< warning >}}
`mysqld_safe` is not used so the `mysqld` process will not be automatically restarted in case of a failure.
{{</ warning>}}
To enable communication with a `vttablet`, the server must be configured to receive gRPC messages on a unix domain socket.
Usage:
mysqlctld [flags]
Examples:
mysqlctld \
--log_dir=${VTDATAROOT}/logs \
--tablet_uid=100 \
--mysql_port=17100 \
--socket_file=/path/to/socket_file
Flags:
--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)
--bind-address string Bind address for the server. If empty, the server will listen on all available unicast and anycast IP addresses of the local system.
--catch-sigpipe catch and ignore SIGPIPE on stdout and stderr if specified
--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 [/tmp])
--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).
--db-credentials-file string db credentials file; send SIGHUP to reload this file
--db-credentials-server string db credentials server type ('file' - file implementation; 'vault' - HashiCorp Vault implementation) (default "file")
--db-credentials-vault-addr string URL to Vault server
--db-credentials-vault-path string Vault path to credentials JSON blob, e.g.: secret/data/prod/dbcreds
--db-credentials-vault-role-mountpoint string Vault AppRole mountpoint; can also be passed using VAULT_MOUNTPOINT environment variable (default "approle")
--db-credentials-vault-role-secretidfile string Path to file containing Vault AppRole secret_id; can also be passed using VAULT_SECRETID environment variable
--db-credentials-vault-roleid string Vault AppRole id; can also be passed using VAULT_ROLEID environment variable
--db-credentials-vault-timeout duration Timeout for vault API operations (default 10s)
--db-credentials-vault-tls-ca string Path to CA PEM for validating Vault server certificate
--db-credentials-vault-tokenfile string Path to file containing Vault auth token; token can also be passed using VAULT_TOKEN environment variable
--db-credentials-vault-ttl duration How long to cache DB credentials from the Vault server (default 30m0s)
--db_charset string Character set/collation used for this tablet. Make sure to configure this to a charset/collation supported by the lowest MySQL version in your environment. (default "utf8mb4")
--db_conn_query_info enable parsing and processing of QUERY_OK info fields
--db_connect_timeout_ms int connection timeout to mysqld in milliseconds (0 for no timeout)
--db_dba_password string db dba password
--db_dba_use_ssl Set this flag to false to make the dba connection to not use ssl (default true)
--db_dba_user string db dba user userKey (default "vt_dba")
--db_flags uint Flag values as defined by MySQL.
--db_flavor string Flavor overrid. Valid value is FilePos.
--db_host string The host name for the tcp connection.
--db_port int tcp port
--db_server_name string server name of the DB we are connecting to.
--db_socket string The unix socket to connect on. If this is specified, host and port will not be used.
--db_ssl_ca string connection ssl ca
--db_ssl_ca_path string connection ssl ca path
--db_ssl_cert string connection ssl certificate
--db_ssl_key string connection ssl key
--db_ssl_mode SslMode SSL mode to connect with. One of disabled, preferred, required, verify_ca & verify_identity.
--db_tls_min_version string Configures the minimal TLS version negotiated when SSL is enabled. Defaults to TLSv1.2. Options: TLSv1.0, TLSv1.1, TLSv1.2, TLSv1.3.
--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)
--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_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_enable_optional_tls enable optional TLS mode when a server accepts both TLS and plain-text connections on the same port
--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_port int Port to listen on for gRPC calls. If zero, do not listen.
--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 mysqlctld
--init_db_sql_file string Path to .sql file to run after mysqld initialization
--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)
--lameduck-period duration keep running at least this long after SIGTERM before stopping (default 50ms)
--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
--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)
--logtostderr log to standard error instead of files
--max-stack-size int configure the maximum stack size in bytes (default 67108864)
--mysql_port int MySQL port (default 3306)
--mysql_server_version string MySQL server version to advertise. (default "8.0.40-Vitess")
--mysql_socket string Path to the mysqld socket file
--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)
--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 5m10s)
--pid_file string If set, the process will write its pid to the named file, and delete it on graceful shutdown.
--pool_hostname_resolve_interval duration if set force an update to all hostnames and reconnect if changed, defaults to 0 (disabled)
--port int port for the server
--pprof strings enable profiling
--pprof-http enable pprof http endpoints
--purge_logs_interval duration how often try to remove old logs (default 1h0m0s)
--replication_connect_retry duration how long to wait in between replica reconnect attempts. Only precise to the second. (default 10s)
--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
--shutdown-wait-time duration How long to wait for mysqld shutdown (default 5m0s)
--socket_file string Local unix socket file to listen on
--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_uid uint32 Tablet UID (default 41983)
--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
--wait_time duration How long to wait for mysqld startup (default 5m0s)
Options (105)
| Option | Description | Source |
|---|---|---|
--log_dir ${VTDATAROOT}/logs | help | |
--tablet_uid 100 | help | |
--mysql_port 17100 | help | |
--socket_file /path/to/socket_file | help | |
--alsologtostderr | log to standard error as well as files | help |
--app_idle_timeout duration | Idle timeout for app connections (default 1m0s) | help |
--app_pool_size int | Size of the connection pool for app connections (default 40) | help |
--bind-address string | Bind address for the server. | help |
--catch-sigpipe | catch and ignore SIGPIPE on stdout and stderr if specified | help |
--config-file string | Full path of the config file (with extension) to use. | help |
--config-file-not-found-handling ConfigFileNotFoundHandling | Behavior when a config file is not found. | help |
--config-name string | Name of the config file (without extension) to search for. | help |
--config-path strings | Paths to search for config files in. | help |
--config-persistence-min-interval duration | minimum interval between persisting dynamic config changes back to disk (if no change has occurred, nothing is done). | help |
--config-type string | Config file type (omit to infer config type from file extension). | help |
--db-credentials-file string | db credentials file; | help |
--db-credentials-server string | db credentials server type ('file' - file implementation; | help |
--db-credentials-vault-addr string | URL to Vault server | help |
--db-credentials-vault-path string | Vault path to credentials JSON blob, e.g.: secret/data/prod/dbcreds | help |
--db-credentials-vault-role-mountpoint string | Vault AppRole mountpoint; | help |
--db-credentials-vault-role-secretidfile string | Path to file containing Vault AppRole secret_id; | help |
--db-credentials-vault-roleid string | Vault AppRole id; | help |
--db-credentials-vault-timeout duration | Timeout for vault API operations (default 10s) | help |
--db-credentials-vault-tls-ca string | Path to CA PEM for validating Vault server certificate | help |
--db-credentials-vault-tokenfile string | Path to file containing Vault auth token; | help |
--db-credentials-vault-ttl duration | How long to cache DB credentials from the Vault server (default 30m0s) | help |
--db_charset string | Character set/collation used for this tablet. | help |
--db_conn_query_info | enable parsing and processing of QUERY_OK info fields | help |
--db_connect_timeout_ms int | connection timeout to mysqld in milliseconds (0 for no timeout) | help |
--db_dba_password string | db dba password | help |
--db_dba_use_ssl | Set this flag to false to make the dba connection to not use ssl (default true) | help |
--db_dba_user string | db dba user userKey (default "vt_dba") | help |
--db_flags uint | Flag values as defined by MySQL. | help |
--db_flavor string | Flavor overrid. | help |
--db_host string | The host name for the tcp connection. | help |
--db_port int | tcp port | help |
--db_server_name string | server name of the DB we are connecting to. | help |
--db_socket string | The unix socket to connect on. | help |
--db_ssl_ca string | connection ssl ca | help |
--db_ssl_ca_path string | connection ssl ca path | help |
--db_ssl_cert string | connection ssl certificate | help |
--db_ssl_key string | connection ssl key | help |
--db_ssl_mode SslMode | SSL mode to connect with. | help |
--db_tls_min_version string | Configures the minimal TLS version negotiated when SSL is enabled. | help |
--dba_idle_timeout duration | Idle timeout for dba connections (default 1m0s) | help |
--dba_pool_size int | Size of the connection pool for dba connections (default 20) | help |
--grpc-dial-concurrency-limit int | Maximum concurrency of grpc dial operations. | help |
--grpc_auth_mode string | Which auth plugin implementation to use (eg: static) | help |
--grpc_auth_mtls_allowed_substrings string | List of substrings of at least one of the client certificate names (separated by colon). | help |
--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. | help |
--grpc_auth_static_password_file string | JSON File to read the users/passwords from. | help |
--grpc_bind_address string | Bind address for gRPC calls. | help |
--grpc_ca string | server CA to use for gRPC connections, requires TLS, and enforces client certificate check | help |
--grpc_cert string | server certificate to use for gRPC connections, requires grpc_key, enables TLS | help |
--grpc_compression string | Which protocol to use for compressing gRPC. | help |
--grpc_crl string | path to a certificate revocation list in PEM format, client certificates will be further verified against this file during TLS handshake | help |
--grpc_enable_optional_tls | enable optional TLS mode when a server accepts both TLS and plain-text connections on the same port | help |
--grpc_initial_conn_window_size int | gRPC initial connection window size | help |
--grpc_initial_window_size int | gRPC initial window size | help |
--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. | help |
--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. | help |
--grpc_key string | server private key to use for gRPC connections, requires grpc_cert, enables TLS | help |
--grpc_max_connection_age duration | Maximum age of a client connection before GoAway is sent. | help |
--grpc_max_connection_age_grace duration | Additional grace period after grpc_max_connection_age, after which connections are forcibly closed. | help |
--grpc_port int | Port to listen on for gRPC calls. | help |
--grpc_server_ca string | path to server CA in PEM format, which will be combine with server cert, return full certificate chain to clients | help |
--grpc_server_initial_conn_window_size int | gRPC server initial connection window size | help |
--grpc_server_initial_window_size int | gRPC server initial window size | help |
--grpc_server_keepalive_enforcement_policy_min_time duration | gRPC server minimum keepalive time (default 10s) | help |
--grpc_server_keepalive_enforcement_policy_permit_without_stream | gRPC server permit client keepalive pings even when there are no active streams (RPCs) | help |
--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. | help |
--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. | help |
-h, --help | help for mysqlctld | help |
--init_db_sql_file string | Path to .sql file to run after mysqld initialization | help |
--keep_logs duration | keep logs for this long (using ctime) (zero to keep forever) | help |
--keep_logs_by_mtime duration | keep logs for this long (using mtime) (zero to keep forever) | help |
--lameduck-period duration | keep running at least this long after SIGTERM before stopping (default 50ms) | help |
--log_backtrace_at traceLocations | when logging hits line file:N, emit a stack trace | help |
--log_err_stacks | log stack traces for errors | help |
--log_rotate_max_size uint | size in bytes at which logs are rotated (glog.MaxSize) (default 1887436800) | help |
--logtostderr | log to standard error instead of files | help |
--max-stack-size int | configure the maximum stack size in bytes (default 67108864) | help |
--mysql_server_version string | MySQL server version to advertise. | help |
--mysql_socket string | Path to the mysqld socket file | help |
--mysqlctl_mycnf_template string | template file to use for generating the my.cnf file during server init | help |
--mysqlctl_socket string | socket file to use for remote mysqlctl actions (empty for local actions) | help |
--onclose_timeout duration | wait no more than this for OnClose handlers before stopping (default 10s) | help |
--onterm_timeout duration | wait no more than this for OnTermSync handlers before stopping (default 5m10s) | help |
--pid_file string | If set, the process will write its pid to the named file, and delete it on graceful shutdown. | help |
--pool_hostname_resolve_interval duration | if set force an update to all hostnames and reconnect if changed, defaults to 0 (disabled) | help |
--port int | port for the server | help |
--pprof strings | enable profiling | help |
--pprof-http | enable pprof http endpoints | help |
--purge_logs_interval duration | how often try to remove old logs (default 1h0m0s) | help |
--replication_connect_retry duration | how long to wait in between replica reconnect attempts. | help |
--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) | help |
--service_map strings | comma separated list of services to enable (or disable if prefixed with '-') Example: grpc-queryservice | help |
--shutdown-wait-time duration | How long to wait for mysqld shutdown (default 5m0s) | help |
--stderrthreshold severityFlag | logs at or above this threshold go to stderr (default 1) | help |
--table-refresh-interval int | interval in milliseconds to refresh tables in status page with refreshRequired class | help |
--tablet_dir string | The directory within the vtdataroot to store vttablet/mysql files. | help |
--v Level | log level for V logs | help |
-v, --version | print binary version | help |
--vmodule vModuleFlag | comma-separated list of pattern=N settings for file-filtered logging | help |
--wait_time duration | How long to wait for mysqld startup (default 5m0s) | help |