Skip to content

Latest commit

 

History

History
99 lines (73 loc) · 4.02 KB

command-line-flags-for-tikv-configuration.md

File metadata and controls

99 lines (73 loc) · 4.02 KB
title summary aliases
TiKV Configuration Flags
Learn some configuration flags of TiKV.
/docs/dev/command-line-flags-for-tikv-configuration/
/docs/dev/reference/configuration/tikv-server/configuration/

TiKV Configuration Flags

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

-A, --addr

  • 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".

--advertise-addr

  • The server advertise address for client traffic from outside
  • Default: ${addr}
  • If the client cannot connect to TiKV through the --addr address because of Docker or NAT network, you must manually set the --advertise-addr address.
  • 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.

--status-addr

  • The port through which the TiKV service status is listened
  • Default: "20180"
  • The Prometheus can access this status information via http://host:status_port/metrics.
  • The Profile can access this status information via http://host:status_port/debug/pprof/profile.

--advertise-status-addr

  • The address through which TiKV accesses service status from outside.
  • Default: The value of --status-addr is used.
  • If the client cannot connect to TiKV through the --status-addr address because of Docker or NAT network, you must manually set the --advertise-status-addr address.
  • 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 20180:20180. In this case, set --advertise-status-addr="192.168.100.113:20180". The client can find this service through 192.168.100.113:20180.

-C, --config

  • The config file
  • Default: ""
  • If you set the configuration using the command line, the same setting in the config file will be overwritten.

--capacity

  • 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)

--config-info <FORMAT>

  • When this flag is used, available configuration values are listed according to FORMAT and then exit.

  • Value option for FORMAT: json. Currently, only JSON format is supported.

  • Only the configuration name (Name), default value (DefaultValue) and current value (ValueInFile) are listed in the output JSON. If the -C or --config is specified, the current value and the default value of configuration items in the file are listed together, and other items without -C or --config specified only have default values. The following is an example:

    {
    "Component": "TiKV Server",
    "Version": "6.2.0",
    "Parameters": [
        {
        "Name": "log-level",
        "DefaultValue": "info",
        "ValueInFile": "warn"
        },
        {
        "Name": "log-file",
        "DefaultValue": ""
        },
        ...
    ]
    }

--data-dir

  • The path to the data directory
  • Default: "/tmp/tikv/store"

-L

  • The log level
  • Default: "info"
  • Optional values: "debug", "info", "warn", "error", "fatal"

--log-file

  • The log file
  • Default: ""
  • If this flag is not set, logs will be written to "stderr". If this flag is set, logs are output to the corresponding file.

--pd

  • 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".