title | summary |
---|---|
TiProxy Command-Line Flags |
Learn the command-line startup flags of TiProxy. |
This document introduces the command-line flags that you can use when you launch TiProxy. It also introduces flags of tiproxyctl
.
This section lists the flags of the server program tiproxy
.
- Specifies the path of the TiProxy configuration file.
- Type:
string
- Default:
""
- You must specify the configuration file. For detailed configuration items, refer to Configure TiProxy. Note that TiProxy automatically reloads the configuration when the configuration file is modified. Therefore, do not directly modify the configuration file. It is recommended to modify the configuration by executing
tiup cluster edit-config
orkubectl edit tc
.
This section introduces the syntax, options, and commands of the client program tiproxyctl
.
Note:
TiProxy Control is specifically designed for debugging purposes and might not be fully compatible with future capabilities introduced in TiProxy. It's not recommended to include this tool in application or utility development to get information.
tiproxyctl [flags] [command]
For example:
tiproxyctl --curls 127.0.0.1:3080 config get
-
Specifies the log format of
tiproxyctl
. -
Type:
string
-
Default:
"tidb"
-
It defaults to the same log format of TiDB. However, you can also specify it as one of the following:
console
: a more human-readable formatjson
: a structured log format
- Specifies the log level of tiproxyctl.
- Type:
string
- Default:
"warn"
- You can specify
debug
,info
,warn
,error
,panic
.
- Specifies the server addresses. You can add multiple listening addresses.
- Type:
comma separated lists of ip:port
- Default:
localhost:3080
- Server API gateway addresses.
- Specifies whether to skip TLS CA verification when dialing to the server.
- Type:
boolean
- Default:
false
- Used for testing.
- Specifies the CA when dialing to the server.
- Type:
string
- Default:
""
- Specifies the certificate when dialing to the server.
- Type:
string
- Default:
""
The tiproxyctl config set
command reads a TOML-formatted configuration file from standard input and sets these configuration items to TiProxy. Unspecified configuration items will remain unchanged, so you only need to specify the items that you want to modify.
The following example sets log.level
as 'warning'
, while leaving other configuration items unchanged.
$ cat test.toml
[log]
level='warning'
$ cat test.toml | tiproxyctl config set
""
$ tiproxyctl config get | grep level
level = 'warning'
The tiproxyctl config get
command is used to get the current TiProxy configuration in TOML format.
The tiproxyctl health
command is used to get the health status of TiProxy and the checksum of the configuration. When TiProxy is running normally, it returns the checksum of the configuration. When TiProxy is shutting down or offline, it returns an error.
Example output:
{"config_checksum":3006078629}