Files
3engines_doc/docs/datavolume/How-to-export-a-volume-over-NFS-outside-of-a-project-on-3Engines-Cloud.html.md
2025-06-19 20:19:21 +05:30

101 lines
2.0 KiB
Markdown

How to export a volume over NFS outside of a project on 3Engines Cloud[🔗](#how-to-export-a-volume-over-nfs-outside-of-a-project-on-brand-name "Permalink to this headline")
=============================================================================================================================================================================
**Prerequisites**
Two Ubuntu servers in various projects (not in a private network) which all have a floating IP assigned.
```
Host: 64.225.128.1
Client: 64.225.128.2
```
On both servers we will create a directory /xdata, which will be shared.
**On the host**
```
eouser@host:~$ sudo apt-get update
eouser@host:~$ sudo apt-get install nfs-kernel-server
eouser@host:~$ sudo mkdir /xdata
eouser@host:~$ sudo chown nobody:nogroup /xdata
eouser@host:~$ sudo nano /etc/exports
```
Add the line:
```
/xdata 64.225.128.2(rw,sync,no_subtree_check)
```
Save the file.
Start the server:
```
eouser@host:~$ sudo systemctl restart nfs-kernel-server
```
For Ubuntu, start the server with this command:
```
eouser@host:~$ sudo service nfs-kernel-server start
```
Now go to <https://horizon.3Engines.com/project/security_groups/>
Create new security group.
Give it a name (eg. allow\_nfs) and save by clicking “Create security group” button.
Click “manage rules”.
Click “add rule”
Choose:
Rule: Custom TCP Rule
Direction: Ingress
Openport: Port
Port: 2049
Remote: CIDR
CIDR: 64.225.128.2
Click “Add”
Go to <https://horizon.3Engines.com/project/instances/>
From the drop-down menu on the right of the “Host” instance, choose “Edit Security Groups”.
Click on the “plus” sign on the “allow\_nfs” group.
This will move the group from “All Security Groups” to “Instance Security Groups”.
Click “Save”.
**On the Client**
```
eouser@client:~$ sudo apt-get update
eouser@client:~$ sudo apt-get install nfs-common
eouser@client:~$ sudo mkdir /xdata
eouser@client:~$ sudo mount 64.225.128.1:/xdata /xdata
```
You can check if the directory is mounted:
```
eouser@client:~$ df -h
```