Skip to content

Commit

Permalink
TOC, op-guide: spit configuration by component (#995)
Browse files Browse the repository at this point in the history
* Update TOC.md
* Create tikv-configuration.md
* Create pd-configuration.md
* Update configuration.md
  • Loading branch information
morgo authored Mar 29, 2019
1 parent 6364757 commit 7af5ae9
Show file tree
Hide file tree
Showing 4 changed files with 175 additions and 164 deletions.
5 changes: 4 additions & 1 deletion TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@
- [Cross-DC Deployment Solutions](op-guide/cross-dc-deployment.md)
- [Kubernetes Deployment](op-guide/kubernetes.md)
+ Configure
- [Configuration Flags](op-guide/configuration.md)
+ By Component
- [tidb-server](op-guide/configuration.md)
- [pd-server](op-guide/pd-configuration.md)
- [tikv-server](op-guide/tikv-configuration.md)
- [Configuration File Description](op-guide/tidb-config-file.md)
- [Modify Component Configuration Using Ansible](op-guide/ansible-deployment-rolling-update.md#modify-component-configuration)
- [Enable TLS Authentication](op-guide/security.md)
Expand Down
166 changes: 3 additions & 163 deletions op-guide/configuration.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
---
title: Configuration Flags
summary: Learn some configuration flags of TiDB, TiKV and PD.
title: TIDB Configuration Flags
summary: Learn some configuration flags for TiDB
category: operations
---

# Configuration Flags

TiDB, TiKV and PD are configurable using command-line flags and environment variables.

## TiDB

The default TiDB ports are 4000 for client requests and 10080 for status report.
TiDBis configurable using command-line flags and environment variables. The default TiDB ports are 4000 for client requests and 10080 for status report.

### `--advertise-address`

Expand Down Expand Up @@ -141,159 +137,3 @@ release tokens.
- Output the version of TiDB
- Default: ""
## Placement Driver (PD)
### `--advertise-client-urls`
- 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".
### `--advertise-peer-urls`
- 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".
### `--client-urls`
- 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 runs on Docker, specify the IP address of Docker as "http://0.0.0.0:2379".
### `--peer-urls`
- 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 runs on Docker, specify the IP address of Docker as "http://0.0.0.0:2380".
### `--config`
- The configuration file
- Default: ""
- If you set the configuration using the command line, the same setting in the configuration file will be overwritten.
### `--data-dir`
- The path to the data directory
- Default: "default.${name}"
### `--initial-cluster`
- The initial cluster configuration for bootstrapping
- Default: "{name}=http://{advertise-peer-url}"
- For example, if `name` is "pd", and `advertise-peer-urls` is "http://192.168.100.113:2380", the `initial-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`
- Join the cluster dynamically
- Default: ""
- If you want to join an existing cluster, you can use `--join="${advertise-client-urls}"`, the `advertise-client-url` is any existing PD's, multiply advertise client urls are separated by comma.
### `-L`
- The log level
- Default: "info"
- You can choose from debug, info, warn, error, or fatal.
### `--log-file`
- 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.
### `--log-rotate`
- To enable or disable log rotation
- Default: true
- When the value is true, follow the `[log.file]` in PD configuration files.
### `--name`
- 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.
### `--cacert`
- The file path of CA, used to enable TLS
- Default: ""
### `--cert`
- The path of the PEM file including the X509 certificate, used to enable TLS
- Default: ""
### `--key`
- The path of the PEM file including the X509 key, used to enable TLS
- Default: ""
### `--namespace-classifier`
- To specify the namespace classifier used by PD
- Default: "table"
- If you use TiKV separately, not in the entire TiDB cluster, it is recommended to configure the value to 'default'.
## TiKV
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 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.
### `-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)
### `--data-dir`
- The path to the data directory
- Default: "/tmp/tikv/store"
### `-L, --Log`
- The log level
- Default: "info"
- You can choose from trace, debug, info, warn, error, or off.
### `--log-file`
- 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.
### `--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".
108 changes: 108 additions & 0 deletions op-guide/pd-configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
title: PD Configuration Flags
summary: Learn some configuration flags of PD.
category: operations
---

# PD Configuration Flags

PD is configurable using command-line flags and environment variables.

### `--advertise-client-urls`

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

### `--advertise-peer-urls`

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

### `--client-urls`

- 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 runs on Docker, specify the IP address of Docker as "http://0.0.0.0:2379".

### `--peer-urls`

- 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 runs on Docker, specify the IP address of Docker as "http://0.0.0.0:2380".

### `--config`

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

### `--data-dir`

- The path to the data directory
- Default: "default.${name}"

### `--initial-cluster`

- The initial cluster configuration for bootstrapping
- Default: "{name}=http://{advertise-peer-url}"
- For example, if `name` is "pd", and `advertise-peer-urls` is "http://192.168.100.113:2380", the `initial-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`
- Join the cluster dynamically
- Default: ""
- If you want to join an existing cluster, you can use `--join="${advertise-client-urls}"`, the `advertise-client-url` is any existing PD's, multiply advertise client urls are separated by comma.
### `-L`
- The log level
- Default: "info"
- You can choose from debug, info, warn, error, or fatal.
### `--log-file`
- 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.
### `--log-rotate`
- To enable or disable log rotation
- Default: true
- When the value is true, follow the `[log.file]` in PD configuration files.
### `--name`
- 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.
### `--cacert`
- The file path of CA, used to enable TLS
- Default: ""
### `--cert`
- The path of the PEM file including the X509 certificate, used to enable TLS
- Default: ""
### `--key`
- The path of the PEM file including the X509 key, used to enable TLS
- Default: ""
### `--namespace-classifier`
- To specify the namespace classifier used by PD
- Default: "table"
- If you use TiKV separately, not in the entire TiDB cluster, it is recommended to configure the value to 'default'.
60 changes: 60 additions & 0 deletions op-guide/tikv-configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
title: TiKV Configuration Flags
summary: Learn some configuration flags of TiKV.
category: operations
---

# 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 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.

### `-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)

### `--data-dir`

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

### `-L, --Log`

- The log level
- Default: "info"
- You can choose from trace, debug, info, warn, error, or off.

### `--log-file`

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

### `--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".

0 comments on commit 7af5ae9

Please sign in to comment.