Skip to content

Commit 9646c01

Browse files
authored
add-tikv-config: add max-days and max-backups (#2777) (#2781)
1 parent 4e72494 commit 9646c01

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

en/configure-a-tidb-cluster.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,13 +407,18 @@ spec:
407407
[storage]
408408
[storage.block-cache]
409409
capacity = "16GB"
410+
[log.file]
411+
max-days = 30
412+
max-backups = 30
410413
```
411414

412415
For all the configurable parameters of TiKV, refer to [TiKV Configuration File](https://docs.pingcap.com/tidb/stable/tikv-configuration-file).
413416

414417
> **Note:**
415418
>
416-
> If you deploy your TiDB cluster using CR, make sure that `Config: {}` is set, no matter you want to modify `config` or not. Otherwise, TiKV components might not be started successfully. This step is meant to be compatible with `Helm` deployment.
419+
> - If you deploy your TiDB cluster using CR, make sure that `Config: {}` is set, no matter you want to modify `config` or not. Otherwise, TiKV components might not be started successfully. This step is meant to be compatible with `Helm` deployment.
420+
> - TiKV RocksDB logs are stored in the `/var/lib/tikv` data directory by default. It is recommended that you configure `max-days` and `max-backups` to automatically clean log files.
421+
> - You can also use the `separateRocksDBLog` configuration item to configure TiKV to output RocksDB logs to stdout through a sidecar container. For more information, see the [TiDB Cluster example](https://github.com/pingcap/tidb-operator/blob/master/examples/advanced/tidb-cluster.yaml).
417422

418423
#### Configure PD parameters
419424

@@ -486,7 +491,7 @@ spec:
486491
level = "info"
487492
```
488493

489-
For all the configurable parameters of TiProxy, refer to [TiProxy Configuration File](https://docs.pingcap.com/tidb/v7.6/tiproxy-configuration).
494+
For all the configurable parameters of TiProxy, refer to [TiProxy Configuration File](https://docs.pingcap.com/tidb/stable/tiproxy-configuration).
490495

491496
#### Configure TiFlash parameters
492497

zh/configure-a-tidb-cluster.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,13 +401,18 @@ spec:
401401
[storage]
402402
[storage.block-cache]
403403
capacity = "16GB"
404+
[log.file]
405+
max-days = 30
406+
max-backups = 30
404407
```
405408

406409
获取所有可以配置的 TiKV 配置参数,请参考 [TiKV 配置文档](https://docs.pingcap.com/zh/tidb/stable/tikv-configuration-file)
407410

408411
> **注意:**
409412
>
410-
> 为了兼容 `helm` 部署,如果你是通过 CR 文件部署 TiDB 集群,即使你不设置 Config 配置,也需要保证 `Config: {}` 的设置,从而避免 TiKV 组件无法正常启动。
413+
> - 为了兼容 `helm` 部署,如果你是通过 CR 文件部署 TiDB 集群,即使你不设置 Config 配置,也需要保证 `Config: {}` 的设置,从而避免 TiKV 组件无法正常启动。
414+
> - TiKV 的 RocksDB 日志默认存储在 `/var/lib/tikv` 数据目录,建议配置 `max-days` 和 `max-backups` 来自动清理日志文件。
415+
> - 你也可通过配置 `separateRocksDBLog` 将 RocksDB 日志通过单独的 sidecar 容器输出到 stdout。完整配置项请参考 [TiDB Cluster 示例](https://github.com/pingcap/tidb-operator/blob/master/examples/advanced/tidb-cluster.yaml)。
411416

412417
#### 配置 PD 配置参数
413418

@@ -476,7 +481,7 @@ spec:
476481
level = "info"
477482
```
478483

479-
获取所有可以配置的 TiProxy 配置参数,请参考 [TiProxy 配置文档](https://docs.pingcap.com/zh/tidb/v7.6/tiproxy-configuration)。
484+
获取所有可以配置的 TiProxy 配置参数,请参考 [TiProxy 配置文档](https://docs.pingcap.com/zh/tidb/stable/tiproxy-configuration)。
480485

481486
#### 配置 TiFlash 配置参数
482487

0 commit comments

Comments
 (0)