Example: Mounting an NFS File System to ECSs
You can create a file system and mount it to multiple ECSs for shared access.
Before creating a file system, ensure that at least a VPC and an ECS have been created and the ECS belongs to the created VPC.
This document uses the file storage of a company as an example to describe how to implement shared file storage.
Step 1: Log In to SFS Console
1. Log in to HUAWEI CLOUD console. Choose Storage > Scalable File Service.
2. Select the region where the ECS resides in. A file system can be mounted to an ECS only when the file system and ECS belong to the same region and VPC. In this example, Hong Kong is selected.
1. The company has purchased ECSs in the Hong Kong region.
2. All ECSs of the company belong to the VPC vpc-3114.
Log in to SFS console.
Select the region.
Step 2: Create a File System
1. Click Create File System. In the Create File System dialog box, set parameters for the file system.
2. Read the service agreement and select the checkbox, click Create Now.
1. You are advised to select the same AZ as that of the ECSs.
2. Click View VPC to view detailed information about existing VPCs or apply for a new VPC.
Create a file system.
Step 3: Mount the File System
1. Log in to ECS. You can log in to a purchased ECS using the management console or a cross-platform remote access tool (such as PuTTY).
2. Check whether an NFS client is installed on the ECS by running the rpm -qa|grep nfs command.
3. Check whether the domain name of the file system can be parsed on the ECS by running the nslookup Domain name of the file system command.
4. Mount the file system. Make a local directory for mounting the file system by running the mkdir A local directory command. Run the mount -t nfs -o vers=3,timeo=600,nolock Shared path Local directory command to mount the file system. Run the mount -l command to check whether the file system is mounted successfully.
1. You can obtain the file system domain name from the file system shared path.
2. If information similar to "example.com:/share-xxx on /local_path type nfs (rw, vers=3, timeo=600, nolock, addr=)" is returned, the file system is mounted successfully.
Log in to ECS.
Check whether an NFS client is installed on the ECS.
Check whether the domain name of the file system can be parsed on the ECS.
Mount the file system.