Skip to content

Commit

Permalink
en: add recommended configs for cluster deployment (pingcap#692)
Browse files Browse the repository at this point in the history
Signed-off-by: Ran <[email protected]>
  • Loading branch information
ran-huang authored Sep 9, 2020
1 parent 1e6be0d commit 991b1b8
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions en/configure-a-tidb-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@ If you are using a NUMA-based CPU, you need to enable `Static`'s CPU management

## Configure TiDB deployment

To configure a TiDB deployment, you need to configure the `TiDBCluster` CR. Refer to the [TidbCluster example](https://github.com/pingcap/tidb-operator/blob/master/examples/tiflash/tidb-cluster.yaml) for an example. For the complete configurations of `TiDBCluster` CR, refer to [API documentation](https://github.com/pingcap/tidb-operator/blob/master/docs/api-references/docs.md).
To configure a TiDB deployment, you need to configure the `TiDBCluster` CR. Refer to the [TidbCluster example](https://github.com/pingcap/tidb-operator/blob/master/examples/advanced/tidb-cluster.yaml) for an example. For the complete configurations of `TiDBCluster` CR, refer to [API documentation](https://github.com/pingcap/tidb-operator/blob/master/docs/api-references/docs.md).

> **Note:**
>
> It is recommended to organize configurations for a TiDB cluster under a directory of `cluster_name` and save it as `${cluster_name}/tidb-cluster.yaml`.
The modified configuration is not automatically applied to the TiDB cluster by default. The new configuration file is loaded only when the Pod restarts.

It is recommended that you set `spec.configUpdateStrategy` to `RollingUpdate` to enable automatic update of configurations. This way, every time the configuration is updated, all components are rolling updated automatically, and the modified configuration is applied to the cluster.

### Cluster name

The cluster name can be configured by changing `metadata.name` in the `TiDBCuster` CR.
Expand All @@ -48,6 +46,25 @@ Here are the formats of the parameters:

- `spec.<pd/tidb/tikv/pump/tiflash/ticdc>.version`: the format is `imageTag`, such as `v4.0.4`

### Recommended configuration

#### configUpdateStrategy

It is recommended that you configure `spec.configUpdateStrategy: RollingUpdate` to enable automatic update of configurations. This way, every time the configuration is updated, all components are rolling updated automatically, and the modified configuration is applied to the cluster.

#### enableDynamicConfiguration

It is recommended that you configure `spec.enableDynamicConfiguration: true` to enable the dynamic configuration feature.

Versions required:

- TiDB 4.0.1 or later versions
- TiDB Operator 1.1.1 or later versions

#### pvReclaimPolicy

It is recommended that you configure `spec.pvReclaimPolicy: Retain` to ensure that the PV is retained even if the PVC is deleted. This is to ensure your data safety.

### Storage class

You can set the storage class by modifying `storageClassName` of each component in `${cluster_name}/tidb-cluster.yaml` and `${cluster_name}/tidb-monitor.yaml`. For the [storage classes](configure-storage-class.md) supported by the Kubernetes cluster, check with your system administrator.
Expand Down

0 comments on commit 991b1b8

Please sign in to comment.