Is there a solution for batch modifying TiKV configurations?

This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 有没有批量修改tikv配置的方案

| username: 月明星稀

Excuse me, community experts, is there a solution for batch modifying TiKV configurations?
Directly modifying the configuration file on the disk: /usr/local/tikv-8888/conf/tikv.toml, after reloading, it will be restored to the old configuration.
If using tiup cluster edit-config, it requires operating on each cluster one by one. There are many clusters, is there a way to modify them in batch?

| username: huanglao2002 | Original post link

You can check the information under the tiup directory
TABLET-PBTEB744:~/.tiup/storage/cluster/clusters/tidbtest$ ls -l
total 16
drwxr-xr-x 2 jin jin 4096 Dec 10 11:51 backup
drwxr-xr-x 2 jin jin 4096 Dec 10 11:51 config-cache
-rw-r–r-- 1 jin jin 1656 Dec 10 11:51 meta.yaml
drwx------ 2 jin jin 4096 Dec 10 11:50 ssh

Modify the meta.yaml file under each cluster, check and verify that there are no issues, then apply.

| username: 月明星稀 | Original post link

After making the changes, can I just execute the reload operation?

| username: Kongdom | Original post link

:thinking: I don’t quite understand, but it seems that using tiup cluster edit-config is the fastest.

| username: 小龙虾爱大龙虾 | Original post link

Are you looking to perform batch operations on multiple clusters?

| username: TIDB-Learner | Original post link

With the help of automated operation and maintenance tools like Ansible, a batch of scripts might solve the problem. If you only have one control host and have configured password-free SSH login, you can save a lot of preparation work. It is not recommended to modify the instance’s meta-configuration files in a production environment. Use TiUP. Of course, for experts, I might be stating the obvious.

| username: 月明星稀 | Original post link

Yes, batch operations on multiple clusters.

| username: 像风一样的男子 | Original post link

It is not recommended to batch modify the configurations of multiple clusters. A slip of the hand could be disastrous. It is better to change one and observe it before proceeding to the next.

| username: Jolyne | Original post link

Install Ansible to manage each control machine. If the configurations are different, you can write a playbook to modify them. :face_with_raised_eyebrow:

| username: 随缘天空 | Original post link

There should be no corresponding solution, and your operation is too risky. It is better to modify a single cluster and observe the cluster situation before adjusting the configuration of other clusters.

| username: 江湖故人 | Original post link

What industry is this? Do you have more than 10 clusters? The primary goal of database maintenance personnel is stability, and batch operations are too risky.

| username: 小龙虾爱大龙虾 | Original post link

It’s still more stable to modify one set at a time.

| username: 春风十里 | Original post link

Use automation tools.

| username: Fly-bird | Original post link

Modifying the YAML and then reloading should work, right?

| username: Jellybean | Original post link

  1. Tiup is the official tool for managing TiDB clusters. For modifying the configuration of each cluster, it is strongly recommended to use the following method:
tiup cluster edit-config {cluster-name}

After adjustments, refresh and restart the specified role nodes as needed with reload -R {tidb/pd/tikv/cdc/tiflah}.

  1. If you use other methods to modify, even if the modification is successful this time, using tiup to modify next time and reloading may overwrite the original content, which can easily lead to various uncontrollable issues.

  2. Moreover, from the perspective of production operation safety, handle one cluster at a time. Even if you have 100 TiDB clusters, I still recommend you operate one by one. This disperses the risk, and even if there is an issue, the impact is limited, giving you a buffer to fix the problem.

| username: Jellybean | Original post link

For the testing environment, TiKV requires 8 cores and 32 GB+ of memory, while for the production environment, it requires 16 cores and 64 GB+ of memory.

| username: 有猫万事足 | Original post link

The text opened by this command already has a place for unified settings.

storage.block-cache.capacity: 2GB

In combination with your previous question, if you need to set the block-cache uniformly, this is how you set it.

Note that the indentation is lost after replying in this forum. The indentation in the YAML format is very strict. Direct copying may cause errors in your YAML format. There should be 2 spaces before the tikv line and 4 spaces before the line under tikv.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.