You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/configure-a-tidb-cluster.md
+61-1Lines changed: 61 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -347,13 +347,18 @@ spec:
347
347
[storage]
348
348
[storage.block-cache]
349
349
capacity = "16GB"
350
+
[log.file]
351
+
max-days = 30
352
+
max-backups = 30
350
353
```
351
354
352
355
For all the configurable parameters of TiKV, refer to [TiKV Configuration File](https://docs.pingcap.com/tidb/stable/tikv-configuration-file).
353
356
354
357
> **Note:**
355
358
>
356
-
> 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.
359
+
> - 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.
360
+
> - 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.
361
+
> - 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).
357
362
358
363
#### Configure PD parameters
359
364
@@ -376,6 +381,61 @@ For all the configurable parameters of PD, refer to [PD Configuration File](http
376
381
> - If you deploy your TiDB cluster using CR, make sure that `Config: {}` is set, no matter you want to modify `config` or not. Otherwise, PD components might not be started successfully. This step is meant to be compatible with `Helm` deployment.
377
382
> - After the cluster is started for the first time, some PD configuration items are persisted in etcd. The persisted configuration in etcd takes precedence over that in PD. Therefore, after the first start, you cannot modify some PD configuration using parameters. You need to dynamically modify the configuration using SQL statements, pd-ctl, or PD server API. Currently, among all the configuration items listed in [Modify PD configuration online](https://docs.pingcap.com/tidb/stable/dynamic-config#modify-pd-configuration-online), except `log.level`, all the other configuration items cannot be modified using parameters after the first start.
378
383
384
+
<<<<<<< HEAD
385
+
=======
386
+
##### Configure PD microservices
387
+
388
+
> **Note:**
389
+
>
390
+
> Starting from v8.0.0, PD supports the [microservice mode](https://docs.pingcap.com/tidb/dev/pd-microservices) (experimental).
391
+
392
+
You can configure PD microservice using the `spec.pd.mode` and `spec.pdms` parameters of the TidbCluster CR. Currently, PD supports two microservices: the `tso` microservice and the `scheduling` microservice. The configuration example is as follows:
393
+
394
+
```yaml
395
+
spec:
396
+
pd:
397
+
mode: "ms"
398
+
pdms:
399
+
- name: "tso"
400
+
baseImage: pingcap/pd
401
+
replicas: 2
402
+
config: |
403
+
[log.file]
404
+
filename = "/pdms/log/tso.log"
405
+
- name: "scheduling"
406
+
baseImage: pingcap/pd
407
+
replicas: 1
408
+
config: |
409
+
[log.file]
410
+
filename = "/pdms/log/scheduling.log"
411
+
```
412
+
413
+
In the preceding configuration, `spec.pdms` is used to configure PD microservices, and the specific configuration parameters are the same as `spec.pd.config`. To get all the parameters that can be configured for PD microservices, see the [PD configuration file](https://docs.pingcap.com/tidb/stable/pd-configuration-file).
414
+
415
+
> **Note:**
416
+
>
417
+
> - If you deploy your TiDB cluster using CR, make sure that `config: {}` is set, no matter you want to modify `config` or not. Otherwise, PD microservice components might fail to start. This step is meant to be compatible with `Helm` deployment.
418
+
> - If you enable the PD microservice mode when you deploy a TiDB cluster, some configuration items of PD microservices are persisted in etcd. The persisted configuration in etcd takes precedence over that in PD.
419
+
> - If you enable the PD microservice mode for an existing TiDB cluster, some configuration items of PD microservices adopt the same values in PD configuration and are persisted in etcd. The persisted configuration in etcd takes precedence over that in PD.
420
+
> - Hence, after the first startup of PD microservices, you cannot modify these configuration items using parameters. Instead, you can modify them dynamically using [SQL statements](https://docs.pingcap.com/tidb/stable/dynamic-config#modify-pd-configuration-dynamically), [pd-ctl](https://docs.pingcap.com/tidb/stable/pd-control#config-show--set-option-value--placement-rules), or PD server API. Currently, among all the configuration items listed in [Modify PD configuration dynamically](https://docs.pingcap.com/tidb/stable/dynamic-config#modify-pd-configuration-dynamically), except `log.level`, all the other configuration items cannot be modified using parameters after the first startup of PD microservices.
421
+
422
+
#### Configure TiProxy parameters
423
+
424
+
TiProxy parameters can be configured by `spec.tiproxy.config` in TidbCluster Custom Resource.
425
+
426
+
For example:
427
+
428
+
```yaml
429
+
spec:
430
+
tiproxy:
431
+
config: |
432
+
[log]
433
+
level = "info"
434
+
```
435
+
436
+
For all the configurable parameters of TiProxy, refer to [TiProxy Configuration File](https://docs.pingcap.com/tidb/stable/tiproxy-configuration).
437
+
438
+
>>>>>>> c0cb1959 (add-tikv-config: add `max-days` and `max-backups` (#2777))
379
439
#### Configure TiFlash parameters
380
440
381
441
TiFlash parameters can be configured by `spec.tiflash.config` in TidbCluster Custom Resource.
0 commit comments