How to export a volume over NFS on 3Engines Cloud🔗¶
Server configuration
Update your system:
Install necessary packages:
Create a new folder, which will be exported by NFS, e.g.:
Delete all access restrictions in the folder:
You can also replace permisssions of files in the folder with your own preferences.
e.g.
Defining access permisions to NFS Server.
In the file /etc/exports add the following line:
where
e.g.
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
#
/mnt/<name of your folder> <IP address of NFS server>(rw,sync,no_subtree_check)
You can also share your folder to more IP addresses:
/mnt/<name of your folder> <IP address 1>(rw,sync,no_subtree_check)
/mnt/<name of your folder> <IP address 2>(rw,sync,no_subtree_check)
/mnt/<name of your folder> <IP address 3>(rw,sync,no_subtree_check)
You can also share the folder to all servers in a Subnet (instead of adding every IP address separately) by adding following line to /etc/exports (e.g. servers in 192.168.0.0/24):
When the configuration file /etc/exports is saved, invoke the following commands:
IT IS NECESSARY TO OPEN THE PORT 2049 IN A SECURITY GROUP!
(The FAQ about opening ports in a security group is available at How can I open new ports for http for my service or instance on 3Engines Cloud)
Client Configuration
Install required packages:
Mount the NFS folder: