Cloud Storage Gateway (CSG) acts as a Network File System (NFS) server, letting clients on your local network access shared storage on the gateway like a local file. This topic explains how to create, disable, modify, and delete NFS shares on the on-premises file gateway console.
Prerequisites
-
A cache has been added. For more information, see Add a cache.
-
Cloud resources have been bound. For more information, see Manage cloud resources.
How NFS shares work
Network File System (NFS) allows computers to share files over a TCP/IP network. CSG acts as an NFS server. Before clients can access a share, you must create it on the gateway, specify which clients can connect, and configure their access permissions.
Install an NFS client
Install an NFS client on each client machine that will mount the share.
-
Log on to the client machine.
-
Run the installation command for your operating system.
-
Ubuntu:
apt-get install nfs-common -
CentOS:
yum install -y nfs-utils
For other operating systems, see the official NFS documentation.
-
Create an NFS share
In a web browser, enter
https://<IP address of the file gateway>to access the on-premises file gateway console.Enter your username and password, and click OK.
-
Select NFS and click Create.
In the Create NFS Share dialog box, configure the following parameters and click OK.
Parameter
Description
Share Name
The virtual path for the NFS share.
For NFSv4, you can mount the share directly by using this name. For NFSv3, you must run the
showmount -e <gateway IP address>command to obtain the virtual path.Read/Write Client IPs
The IP addresses or CIDR blocks of clients that are allowed to access the NFS share with read and write permissions.
Example: 192.168.10.10 or 192.168.0.0/24. You can enter multiple IP addresses or CIDR blocks.
The IP addresses or CIDR blocks of clients that are allowed to access the NFS share with read-only permissions.
Example: 192.168.10.10 or 192.168.0.0/24. You can enter multiple IP addresses or CIDR blocks.
Read-only Client IPs
User Mapping
Configures the mapping between NFS client users and NFS server users.
NoteThis parameter is available only when Protocol is set to NFS.
none: NFS client users are not mapped to the nobody user on the NFS server.
root_squash: Restricts the root user. When an NFS client accesses the share as the root user, it is mapped to the nobody user on the NFS server.
all_squash: Restricts all users. All NFS client users, regardless of their original identity, are mapped to the nobody user on the NFS server.
all_anonymous: Restricts all users. All NFS client users, regardless of their original identity, are mapped to the anonymous user on the NFS server.
Enabled
Enables the NFS share.
To disable the NFS share, select No.
Data Access Mode
Includes cache mode and replication mode.
Replication mode: Two copies of all data are saved. One copy is saved in the on-premises cache and the other is saved in OSS.
Cache mode: The on-premises cache stores all metadata and frequently accessed user data. The full dataset is stored in OSS.
Reverse Sync
Synchronizes metadata from OSS to the on-premises environment. This feature is suitable for gateway disaster recovery and data restoration or sharing scenarios.
NoteReverse sync scans all objects in the bucket. If the number of objects is large, fees are incurred for OSS API requests.
Bucket Name
Select a created bucket.
Path Prefix
Enter a path prefix within the bucket.
The path prefix defines a virtual directory within the bucket.
NoteStarting from version 1.0.38, you can map the root directory of a file system to a specific path prefix in an OSS bucket to isolate access.
The path prefix can be an existing or non-existing directory in the OSS bucket. After the share is created, this path prefix is used as the root directory, and all subsequent files and directories are created under it.
Use Metadata Disk
Separates the data disk from the metadata disk. The metadata disk is used to store the metadata of the shared folder.
If you select Yes, you must select the corresponding Metadata Disk and Data Disk.
If you select No, you must select the corresponding Cache Disk.
NoteOnly users on the whitelist can use this feature.
Ignore Delete
When enabled, file deletion operations from the client are not synchronized to OSS. This prevents accidental data loss and ensures the full dataset is retained in OSS.
NFSv4 Optimization
Improves upload performance when a share is mounted by using NFSv4. After you enable this option, you can no longer mount the share by using NFSv3.
Sync Delay
Set a sync delay. After a file is closed, the upload is delayed for a specified period. This prevents frequent on-premises modifications from creating excessive object parts in OSS. Default value: 5s. Maximum value: 120s.
Max Write Speed
The maximum write speed is 1,280 MB/s. The default value is 0, which indicates that the speed is not limited.
Max Upload Speed
The maximum upload speed is 1,280 MB/s. The default value is 0, which indicates that the speed is not limited.
NoteIf you limit the speeds, the maximum upload speed cannot be less than the maximum write speed.
Upload Optimization
Enables real-time cache reclamation. This feature is ideal for backup-only scenarios.
Click OK to create the share.
Manage existing NFS shares
On the NFS page, you can perform the following operations.
|
Actions |
Description |
|
Disable an NFS share |
To disable all NFS shares on the gateway, turn off the switch in the upper-left corner of the NFS page. You can also disable shares individually. To do so, find the share on the NFS page, click Settings, and set Enabled to No. |
|
Delete an NFS share |
On the NFS page, find the target share and click Delete. Note
If a share is mounted on a client when you delete it, there is a short delay before the mount point is unmounted. If you create a new NFS share with the same ID during this delay, the original mount point will not be unmounted. After deleting a share, run the |
|
Modify an NFS share |
On the NFS page, find the target share, and click Settings or Advanced Settings to modify it. |