Configuring DR for SFS General-Purpose File Systems
Solution Overview
To quickly recover service data (such as production execution files and team collaboration documents) and reduce downtime, or to build basic disaster recovery (DR) capabilities at a low cost and deploy hierarchical protection through remote backup, you are advised to use the SFS intra-AZ backup solution. This solution requires two SFS general-purpose file systems. One is used for daily services, and the other is for DR. You can manually or periodically back up data of the service file system to the DR file system. The entire process includes a full migration (no impact on services), an incremental migration (no impact on services), scheduled migration task configuration (no impact on services), and migration result check (no impact on services).
Constraints
- This solution is only applicable for the data migration of Linux ECSs.
- The Linux ECS and the two SFS general-purpose file systems must be in the same VPC.
- The general-purpose file systems use the NFS protocol.
Preparations
- Create a VPC endpoint by referring to Configure a VPC Endpoint.
- Create an NFS general-purpose file system and select the same VPC as that of the existing general-purpose file system.
- For how to create a general-purpose file system, see Creating a General-Purpose File System.
- If no VPC is available, create one in the same region and then create the general-purpose file system.
- Prepare a Linux ECS. The ECS must be in the same VPC as the two general-purpose file systems, so that it can communicate with both file systems.
If no ECS is available, buy one by referring to Purchasing and Using a Linux ECS.
Resource Planning
|
Resource |
Example Configuration |
Description |
|---|---|---|
|
ECS |
Specifications: 8 vCPUs | 16 GiB | c7.2xlarge.2 OS: Linux Region: CN-Hong Kong VPC: VPC1 |
Ensure that the /mnt/src and /mnt/dst directories have been created. |
Procedure
- Mount two general-purpose file systems by referring to Mounting an NFS File System to ECSs (Linux). Mount the service file system on /mnt/src and mount the DR file system on /mnt/dst.
- Run the following command to install the migration tool:
sudo yum install -y rsync
- Full migration: Migrate all files from the service file system to the DR file system.
- Create a directory in the DR file system for storing the migrated data, for example, dst/backup.
mkdir /mnt/dst/backup
- Migrate data in the service file system to the backup directory in the DR file system.
rsync -avP /mnt/src/ /mnt/dst/backup/
- Create a directory in the DR file system for storing the migrated data, for example, dst/backup.
- Incremental migration: Synchronize the incremental data generated after the full migration to the DR file system.
rsync -avP --delete /mnt/src/ /mnt/dst/backup/
- Use crontab to configure scheduled tasks to migrate incremental data.
- Run the following command to access crontab:
crontab -e
- Configure scheduled incremental migration.
Add the following information to crontab: (00 indicates the minute, and 02 indicates the hour. In this example, incremental migration will be performed at 02:00 every day. Change the values as required.)
00 02 * * * rsync -avP --delete /mnt/src/ /mnt/dst/backup/ > /tmp/last_rsync_result.log 2>&1 &
- Run the following command: (If information configured in 5.b is returned, the configuration is successful.)
crontab -l
- Run the following command to access crontab:
- Verify the migration results.
Run the following command to check the latest incremental migration data:
cat /tmp/last_rsync_result.log
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot