How to reset the folder location for data_dir during DM deployment

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

Original topic: dm部署的时候data_dir如何重新设置文件夹位置

| username: Jjjjayson_zeng

[TiDB Usage Environment] Production Environment
[TiDB Version] DM 5.4.0
[Reproduction Path] What operations were performed when the issue occurred
[Encountered Issue: Issue Phenomenon and Impact]
[Resource Configuration]
[Attachment: Screenshot/Log/Monitoring]

image

| username: 爱白话的晓辉 | Original post link

Try editing the config.

| username: Jjjjayson_zeng | Original post link

When editing, this is displayed, and after reloading, it still hasn’t changed.

| username: Jjjjayson_zeng | Original post link

What I mean is how to save this thing.

| username: dba-kit | Original post link

Once the datadir parameter is deployed, it cannot be changed. If it hasn’t been officially activated yet, rebuilding the DM cluster is the fastest way. If it has already been activated, it is recommended to find a low-peak period and refer to this article to use a new DM cluster to replace the old one.

| username: dba-kit | Original post link

Actually, there is another troublesome method: first stop the worker node, then transfer the data in the /data directory to the correct directory, and then use the mount --bind method to mount that directory to the /data directory.

| username: dba-kit | Original post link

Alternatively, you can scale out new nodes using the tiup dm scale-out method. During the scaling out process, specify the correct data_dir, then use the dmctl transfer-source command to transfer the data source to the new worker node. After that, scale in to reduce the old worker.

| username: tidb菜鸟一只 | Original post link

The data_dir does not support online modification; it is recommended to redeploy DM.

| username: Jjjjayson_zeng | Original post link

Is there documentation for uninstalling DM? Can you help provide a link?

| username: 考试没答案 | Original post link

scale-in scale-out

| username: 考试没答案 | Original post link

Redeployment of the worker. No need to uninstall DM, right?

| username: liuis | Original post link

Just redeploy DM.

| username: Jjjjayson_zeng | Original post link

To change the Prometheus data address, it’s not just the worker.

| username: Jjjjayson_zeng | Original post link

No need to uninstall? Just redeploy directly?

| username: 考试没答案 | Original post link

Then you can uninstall Prometheus.

| username: 考试没答案 | Original post link

If you are planning everything, then proceed with uninstalling and redeploying. Worker, Prometheus, DM. Other nodes containing DM components can be different. Custom configuration files are all acceptable.

| username: 我是咖啡哥 | Original post link

I modified the DB data directory, first scaled down and then scaled up.
Since you only have one worker node, scale up first and then scale down. However, the port will be different. If you care about that, you can go through the process again.

| username: Jjjjayson_zeng | Original post link

So I want to know how to uninstall it, I didn’t see it in the documentation.

| username: 考试没答案 | Original post link

Let’s use tiup dm destroy. If this is a test environment.

| username: Jjjjayson_zeng | Original post link

Customer production environment…