- Introduction
- Get Started
- Deploy
- In Self-Managed Kubernetes
- In Public Cloud Kubernetes
- Deploy TiDB on ARM64 Machines
- Deploy TiFlash to Explore TiDB HTAP
- Deploy TiDB Across Multiple Kubernetes Clusters
- Deploy a Heterogeneous TiDB Cluster
- Deploy TiCDC
- Deploy TiDB Binlog
- Monitor and Alert
- Migrate
- Import Data
- Migrate from MySQL
- Migrate TiDB to Kubernetes
- Manage
- Secure
- Scale
- Upgrade
- Upgrade a TiDB Cluster
- Upgrade TiDB Operator
- Backup and Restore
- Overview
- Backup and Restore Custom Resources
- Grant Permissions to Remote Storage
- Amazon S3 Compatible Storage
- Google Cloud Storage
- Persistent Volumes
- Maintain
- Restart a TiDB Cluster
- Destroy a TiDB Cluster
- View TiDB Logs
- Modify TiDB Cluster Configuration
- Configure Automatic Failover
- Pause Sync of TiDB Cluster
- Maintain Different TiDB Clusters Separately Using Multiple TiDB Operator
- Maintain Kubernetes Nodes
- Migrate from Helm 2 to Helm 3
- Replace Nodes for a TiDB Cluster
- Disaster Recovery
- Troubleshoot
- FAQs
- Reference
- Release Notes
- v1.2
- v1.1
- v1.0
- v0
Modify TiDB Cluster Configuration
For a TiDB cluster, you can update the configuration of components online using SQL statements, including TiDB, TiKV, and PD, without restarting the cluster components. However, for TiDB clusters deployed in Kubernetes, after you upgrade or restart the cluster, the configurations updated using SQL statements will be overwritten by those in the TidbCluster
CR. This leads to the online configuration update being invalid.
This document describes how to modify the configuration of TiDB clusters deployed in Kubernetes. Due to the special nature of PD, you need to separately modify the configuration of PD and other components.
Modify configuration for TiDB, TiKV, and other components
For TiDB and TiKV, if you modify their configuration online using SQL statements, after you upgrade or restart the cluster, the configurations will be overwritten by those in the TidbCluster
CR. This leads to the online configuration update being invalid. Therefore, to persist the configuration, you must directly modify their configurations in the TidbCluster
CR.
For TiFlash, TiCDC, and Pump, you can only modify their configurations in the TidbCluster
CR.
To modify the configuration in the TidbCluster
CR, take the following steps:
Refer to the parameters in Configure TiDB components to modify the component configuration in the
TidbCluster
CR:kubectl edit tc ${cluster_name} -n ${namespace}
After the configuration is modified, view the updating progress:
watch kubectl -n ${namespace} get pod -o wide
After all the Pods are recreated and are in the
Running
state, the configuration is successfully modified.
Modify PD configuration
After PD is started for the first time, some PD configuration items are persisted in etcd. The persisted configuration in etcd takes precedence over the configuration file in PD. Therefore, after the first start, you cannot modify some PD configuration by using the TidbCluster
CR.
Among all the PD configuration items listed in Modify PD configuration online, after the first start, only log.level
can be modified by using the TidbCluster
CR. Other configurations cannot be modified by using CR.
For TiDB clusters deployed in Kubernetes, if you need to modify the PD configuration, you can modify the configuration online using SQL statements, pd-ctl, or PD server API.