title | category |
---|---|
Configuration Flags |
operations |
TiDB, TiKV and PD are configurable using command-line flags and environment variables.
The default TiDB ports are 4000 for client requests and 10080 for status report.
- The TiDB services use the unix socket file for internal connections, such as the PUMP service
- Default: ``
- You can use "/tmp/pump.sock" to accept the communication of PUMP unix socket file.
- To enable (true) or disable (false) the cross join without any equal conditions
- Default: true
- The value can be
true
orfalse
. By default,true
is to enablejoin
without any equal conditions (theWhere
field). If you set the value tofalse
, the server refuses to run thejoin
statement.
- The host address that the TiDB server monitors
- Default: "0.0.0.0"
- The TiDB server monitors this address.
- The "0.0.0.0" monitors all network cards. If you have multiple network cards, specify the network card that provides service, such as 192.168.100.113.
- The number of goroutine when
join-concurrency
executesjoin
concurrently - Default: 5
- The number depends on the amount of data and data distribution, usually the larger the better, and a larger number means a larger CPU overhead.
- The log level
- Default: "info"
- You can choose from debug, info, warn, error, or fatal.
- The schema lease time in seconds
- Default: "10"
- This is the schema lease time that is used in online schema changes. The value will affect the DDL statement running time. Do not change it unless you understand the internal mechanism.
- The log file
- Default: ""
- If this flag is not set, logs will be written to stderr. Otherwise, logs will be stored in the log file which will be automatically rotated every day.
-
The Prometheus pushgateway address
-
Default: ""
-
Leaving it empty stops the Prometheus client from pushing.
-
The format is:
--metrics-addr=192.168.100.115:9091
- The Prometheus client push interval in seconds
- Default: 0
- Setting the value to 0 stops the Prometheus client from pushing.
- The monitoring port of TiDB services
- Default: "4000"
- The TiDB server accepts MySQL client requests from this port.
- The path to the data directory for local storage engines like "goleveldb" and "BoltDB"
- Do not set
--path
for the "memory" storage engine. - For the distributed storage engine like TiKV,
--path
specifies the actual PD address. Assuming that you deploy the PD server on 192.168.100.113:2379, 192.168.100.114:2379 and 192.168.100.115:2379, the value of--path
is "192.168.100.113:2379, 192.168.100.114:2379, 192.168.100.115:2379". - Default: "/tmp/tidb"
- To enable(true) or disable(false) the performance schema
- Default: false
- The value can be (true) or (false). (true) is to enable and (false) is to disable. The Performance Schema provides a way to inspect internal execution of the server at runtime. See performance schema for more information. If you enable the performance schema, the performance is affected.
- To enable(true) or disable(false) the privilege check(for debugging)
- Default: true
- The value can be (true) or (false). (true) is to enable and (false) is to disable. This option is deprecated and will be removed.
- The proxy server's IP addresses that allowed by PROXY Protocol.
- Default: "" (empty string)
- The value can be IP address (192.168.1.50) or CIDR (192.168.1.0/24), if more than one address (or CIDR) required, use
,
to split.*
means any IP addresses. Leaving it empty disable PROXY Protocol.
- PROXY Protocol header read timeout.
- Default: 5 (seconds)
- The value set timeout for the PROXY protocol header read. The unit is second. You should not set this value to 0.
- The maximum length of SQL statements recorded in the log
- Default: 2048
- Overlong requests are truncated when output to the log.
- To enable(true) or disable(false) the status report and pprof tool
- Default: true
- The value can be (true) or (false). (true) is to enable metrics and pprof. (false) is to disable metrics and pprof.
- The maximum number of retries when a transaction meets conflicts
- Default: 10
- A large number of retries affects the TiDB cluster performance.
- To see whether the
tidb-server
runs DDL statements, and set when the number oftidb-server
is over two in the cluster - Default: true
- The value can be (true) or (false). (true) indicates the
tidb-server
runs DDL itself. (false) indicates thetidb-server
does not run DDL itself.
- To enable anyone to connect without a password and with all privileges
- Default: false
- The value can be (true) or (false). This option is usually used to reset password, and enabling it requires the root privileges.
- The SQL statements with a larger value of this parameter are recorded.
- Default: 300
- The value can only be an integer (int), and the unit is millisecond.
- The TiDB services use the unix socket file for external connections.
- Default: ""
- You can use "/tmp/tidb.sock" to open the unix socket file.
- The path to a file in PEM format that contains a list of trusted SSL certificate authorities.
- Default: ""
- When this option is specified along with
--ssl-cert
and--ssl-key
, the server verifies the client's certificate via this CA list if the client provides its certificate accordingly. - The secure connection will be established without client verification if the client does not provide a certificate even when this option is set.
- The path to an SSL certificate file in PEM format to use for establishing a secure connection.
- Default: ""
- When this option is specified along with
--ssl-key
, the server permits but does not require secure connections. - If the specified certificate or key is not valid, the server still starts normally but does not permit secure connections.
- The path to an SSL key file in PEM format to use for establishing a secure connection, namely the private key of the certificate you specified by
--ssl-cert
. - Default: ""
- Currently TiDB does not support keys protected by a passphrase.
- The status report port for TiDB server
- Default: "10080"
- This is used to get server internal data. The data includes prometheus metrics and pprof.
- Prometheus metrics can be got through "http://host:status_port/metrics".
- Pprof data can be got through "http://host:status_port/debug/pprof".
- Scan the full table incrementally, and analyze information like the data amount and index of the table
- Default: 3s
- Before you use
--statsLease string
, runanalyze table name
manually. The statistics are updated automatically and stored in TiKV, taking up some memory.
- The storage engine type
- Human-readable name for this member.
- Default: "goleveldb"
- You can choose from "memory", "goleveldb", "BoltDB" or "TiKV". The first three are all local storage engines. TiKV is a distributed storage engine.
keepalive
is enabled in the tcp layer of TiDB.- Default: false
- The advertise URL list for client traffic from outside
- Default: ${client-urls}
- If the client cannot connect to PD through the default listening client URLs, you must manually set the advertise client URLs explicitly.
- For example, the internal IP address of Docker is 172.17.0.1, while the IP address of the host is 192.168.100.113 and the port mapping is set to
-p 2379:2379
. In this case, you can set--advertise-client-urls
to "http://192.168.100.113:2379". The client can find this service through "http://192.168.100.113:2379".
- The advertise URL list for peer traffic from outside
- Default: ${peer-urls}
- If the peer cannot connect to PD through the default listening peer URLs, you must manually set the advertise peer URLs explicitly.
- For example, the internal IP address of Docker is 172.17.0.1, while the IP address of the host is 192.168.100.113 and the port mapping is set to
-p 2380:2380
. In this case, you can set--advertise-peer-urls
to "http://192.168.100.113:2380". The other PD nodes can find this service through "http://192.168.100.113:2380".
- The listening URL list for client traffic
- Default: "http://127.0.0.1:2379"
- To deploy a cluster, you must use
--client-urls
to specify the IP address of the current host, such as "http://192.168.100.113:2379". If the cluster is run on Docker, specify the IP address of Docker as "http://0.0.0.0:2379".
- The config file
- Default: ""
- If you set the configuration using the command line, the same setting in the config file will be overwritten.
- The path to the data directory
- Default: "default.${name}"
-
The initial cluster configuration for bootstrapping
-
Default: "{name}=http://{advertise-peer-url}"
-
For example, if
name
is "pd", andadvertise-peer-urls
is "http://192.168.100.113:2380", theinitial-cluster
is "pd=http://192.168.100.113:2380". -
If you need to start three PD servers, the
initial-cluster
might be:pd1=http://192.168.100.113:2380, pd2=http://192.168.100.114:2380, pd3=192.168.100.115:2380
- Join the cluster dynamically
- Default: ""
- If you want to join an existing cluster, you can use
--join="${advertise-client-urls}"
, theadvertise-client-url
is any existing PD's, multiply advertise client urls are separated by comma.
- The log level
- Default: "info"
- You can choose from debug, info, warn, error, or fatal.
- The log file
- Default: ""
- If this flag is not set, logs will be written to stderr. Otherwise, logs will be stored in the log file which will be automatically rotated every day.
- To enable or disable log rotation
- Default: true
- When the value is true, follow the
[log.file]
in PD configuration files.
- The human-readable unique name for this PD member
- Default: "pd"
- If you want to start multiply PDs, you must use different name for each one.
- The listening URL list for peer traffic
- Default: "http://127.0.0.1:2380"
- To deploy a cluster, you must use
--peer-urls
to specify the IP address of the current host, such as "http://192.168.100.113:2380". If the cluster is run on Docker, specify the IP address of Docker as "http://0.0.0.0:2380".
TiKV supports some readable unit conversions for command line parameters.
- File size (based on byte): KB, MB, GB, TB, PB (or lowercase)
- Time (based on ms): ms, s, m, h
- The address that the TiKV server monitors
- Default: "127.0.0.1:20160"
- To deploy a cluster, you must use
--addr
to specify the IP address of the current host, such as "192.168.100.113:20160". If the cluster is run on Docker, specify the IP address of Docker as "0.0.0.0:20160".
- The server advertise address for client traffic from outside
- Default: ${addr}
- If the client cannot connect to TiKV through the default monitoring address because of Docker or NAT network, you must manually set the advertise address explicitly.
- For example, the internal IP address of Docker is 172.17.0.1, while the IP address of the host is 192.168.100.113 and the port mapping is set to
-p 20160:20160
. In this case, you can set--advertise-addr
to "192.168.100.113:20160". The client can find this service through 192.168.100.113:20160.
- The config file
- Default: ""
- If you set the configuration using the command line, the same setting in the config file will be overwritten.
- The store capacity
- Default: 0 (unlimited)
- PD uses this flag to determine how to balance the TiKV servers. (Tip: you can use 10GB instead of 1073741824)
- The path to the data directory
- Default: "/tmp/tikv/store"
- The log level
- Default: "info"
- You can choose from trace, debug, info, warn, error, or off.
- The log file
- Default: ""
- If this flag is not set, logs will be written to stderr. Otherwise, logs will be stored in the log file which will be automatically rotated every day.
- The address list of PD servers
- Default: ""
- To make TiKV work, you must use the value of
--pd
to connect the TiKV server to the PD server. Separate multiple PD addresses using comma, for example "192.168.100.113:2379, 192.168.100.114:2379, 192.168.100.115:2379".