Changing the Deployment Directory with TiUP

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

Original topic: tiup更改部署目录

| username: 18515065291

【TiDB Usage Environment】: Production
【TiDB Version】: 5.0-5.2.3
【Architecture Consultation】:
Question: How to change the deployment directory?
Existing cluster, expanding an instance with a new directory, such as tidb, pd, tikv, etc., how to configure it to the new directory?
Tiup configuration:
global:
user: tidb
ssh_port: 22
ssh_type: builtin
deploy_dir: /opt/soft/tidb666/
data_dir: data
os: linux
monitored:
node_exporter_port: 6661
blackbox_exporter_port: 6662
deploy_dir: /opt/soft/tidb37022/monitor-6661
data_dir: /opt/soft/tidb37022/monitor-6661/data/monitor-6661
log_dir: /opt/soft/tidb37022/monitor-6661/log

Want to change /opt/soft to /opt/dba
Directly edit-config:
New topology could not be saved: immutable field changed: global.DeployDir changed from ‘/opt/soft/tidb666/’ to ‘/opt/dba/tidb666/’

| username: Ming | Original post link

Check out this article: 【SOP 系列 12】TiUP 修改集群 IP 、Port 和目录 - TiDB 的问答社区

| username: 18515065291 | Original post link

Yes, I saw this. I am performing node migration by scaling out and scaling in. This way, there is no need to shut down the cluster, just scale out and scale in directly, right?

| username: srstack | Original post link

Yes, in order to prevent non-standard operations from causing cluster anomalies, you can adjust the deployment path by scaling in and out.

| username: 18515065291 | Original post link

Okay, I’ll test it, thanks~

| username: 18515065291 | Original post link

Thank you~

| username: wisdom | Original post link

Modulate the deployment path by scaling in and out.

| username: 18515065291 | Original post link

Well~ testing is possible.

| username: wisdom | Original post link

Okay.

| username: tidb狂热爱好者 | Original post link

I suggest you don’t make changes. Expanding and shrinking will cause data to move around, resulting in degraded performance.

| username: 18515065291 | Original post link

There is a strong demand now to adjust and relocate machines…