Skip to content

add-tikv-config: add max-days and max-backups #2777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 4, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion en/configure-a-tidb-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,17 @@ spec:
[storage]
[storage.block-cache]
capacity = "16GB"
[log.file]
max-days = 30
max-backups = 30
```

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

> **Note:**
>
> 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.
> - 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.
> - TiKV RocksDB logs are stored in the `/var/lib/tikv` data directory. It is recommended that you configure `max-days` and `max-backups` to automatically clean log files.

#### Configure PD parameters

Expand Down
6 changes: 5 additions & 1 deletion zh/configure-a-tidb-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,13 +402,17 @@ spec:
[storage]
[storage.block-cache]
capacity = "16GB"
[log.file]
max-days = 30
max-backups = 30
```

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

> **注意:**
>
> 为了兼容 `helm` 部署,如果你是通过 CR 文件部署 TiDB 集群,即使你不设置 Config 配置,也需要保证 `Config: {}` 的设置,从而避免 TiKV 组件无法正常启动。
> - 为了兼容 `helm` 部署,如果你是通过 CR 文件部署 TiDB 集群,即使你不设置 Config 配置,也需要保证 `Config: {}` 的设置,从而避免 TiKV 组件无法正常启动。
> - TiKV 的 RocksDB 日志默认存储在 `/var/lib/tikv` 数据目录,建议配置 `max-days` 和 `max-backups` 来自动清理日志文件。

#### 配置 PD 配置参数

Expand Down
Loading