Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 想将3台tikv的磁盘换为SSD,咨询方案
[TiDB Usage Environment] Production environment 2tidb 3pd 3tikv
[TiDB Version] v5.4.0
[Reproduction Path] Now I want to replace the disks of the 3 tikv nodes with SSDs. I am seeking advice on the plan. My own planned approach is to expand with 3 new tikv nodes and then shrink the original 3 tikv nodes. I am not sure if this plan is feasible or if there is a better solution. The data volume is not large, around 60G.
[Encountered Problem: Problem Phenomenon and Impact]
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots/Logs/Monitoring]
You can consider using TiDB’s online disk replacement feature to achieve this. The specific steps are as follows:
- Expand 3 TiKV nodes, using new SSD disks as storage media.
- After the cluster is balanced, execute the scale-down command to take the original 3 TiKV nodes offline.
- Clean up the data and directories of the original 3 TiKV nodes to ensure that all TiKV nodes in the cluster use the new SSD disks to provide services.
It should be noted that before executing the scale-down command, you need to ensure that the cluster is fully balanced, otherwise it may lead to data loss or cluster unavailability. In addition, to ensure data security, it is recommended to back up the data before executing the scale-down command.
Are you adding the SSDs to these three TiKV nodes? And then using the scaling method to add these SSDs?
It should be like this, I think we should expand one at a time, then shrink one at a time, and take it slowly.
You can directly mount SSD disks on the 3 TiKV nodes, then expand the capacity of three different ports one by one, specifying the SSD disks as the data directory for the TiKV nodes. After that, gradually scale down the original TiKV nodes with data directories mounted on mechanical disks. This way, you don’t need additional machines, and the impact on the business is minimal.
May I ask, does using mechanical disks and SSD disks in the same database affect the read and write performance of the cluster?
It is recommended to add machines first in the production environment, and then expand TiKV on the new machines.
Creating a new cluster to migrate 60GB of data will be more efficient.
Expanding by 3 and shrinking by 3 is possible, but with only 60GB of data, wouldn’t it be faster to just shut down for a short while, copy the corresponding directories over, and start up the new machines?
Shutdown method and non-shutdown method
Non-shutdown:
Shutdown:
- Backup the data, then restore it.
60GB on SSD is a bit of a waste
If the data volume were larger, the cost-effectiveness of the upgrade would be higher.
Please check this out, it’s very detailed: 专栏 - 百TB级TiDB集群在线更换NVME磁盘优化实践 | TiDB 社区
Scaling up, deleting, scaling up, deleting, scaling up, deleting
The server is not enough.
It’s probably better than what you have now, isn’t it? Aren’t you currently using a pure mechanical hard drive? The only downside to this method is that the CPU and memory might affect each other. If you have an idle machine, it’s definitely better to use that. This is just a compromise when there’s no idle machine available. But even if you use another machine, you still need to follow the same process, which involves moving data from the pure mechanical hard drive to the SSD. The read/write pressure on the cluster remains the same.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.