Configure External NFS Server on AccuWeb.Cloud dashboard

Configure External NFS Server on AccuWeb.Cloud dashboard

The platform supports sharing data between servers (where files are physically stored) and clients (which access remote data as if it were local). The configuration process depends on the following conditions:

  • Both Instances within the Same PaaS Account: You can export data from the storage or mount data on the clients (the platform automatically manages the mounting operation).
  • One Instance Outside the Platform: You need to export data from the external storage (as outlined in this guide) and mount the external data on the clients.

Below, we will cover the steps to export data from the platform’s Shared Storage Container to an external instance. This process applies to any NFS-based storage server.

To enable data sharing over the Internet, you first need to attach a public IP address to your server.

Below, we’ll outline the configurations needed to export data from the platform’s Shared Storage Container to an external instance. This procedure applies to any NFS-based storage server.

Step 1. To share data over the Internet, you first need to assign a public IP address to your server:

Public IP

Step 2. Next, specify the directories you want to share in the etc/exports file. On the platform, you can easily access this file by clicking the Configuration button in the Exports section of the built-in Configuration File Manager.

Use the following format for this configuration:


{directory} {server}([option],[option],..)

Configuration File Manager

{directory} – the path to the folder (relative to the Root folder) that needs to be exported

{NFS_client} – the custom domain name or public IP address of the client node where the exported files will be mounted

Note: If your instance does not have an external address, you can use the IP of the appropriate host instead. To find this, connect to the container via SSH and run the following command:


curl ifconfig.co

Use IP if you does not have external address

[option] – additional parameters to define access permissions, with the main ones being:

  • async: Allows NFS clients to receive a response from the storage as soon as a request to add content is processed. The data is in the cache but not yet written to storage. This provides a performance boost compared to the sync option but carries a slight risk of data loss if the system stops or crashes while data is still in the cache.
  • ro (or rw): Specifies read-only (or read & write) permissions for the client node, allowing it to view (or view and edit) the shared data.
  • no_root_squash: Grants the root user on the client’s server the same level of access as the root user on the storage container.
  • no_subtree_check: Enables access to the entire directory, which improves performance but limits the ability to set individual rules for files within the directory.

Step 3. When using the Shared Storage Auto-Cluster based on GlusterFS, remember that only the /data folder is replicated between instances. Therefore, the directory to be exported must be located inside this folder.

Additionally, you must include the fsid option in the export configuration string. For example, you can randomly generate the value for this parameter with the following command:


cat /proc/sys/kernel/random/uuid

Random parameter
Remember to save the changes you’ve made.

Step 4. To apply the new export settings, use the appropriate exportfs command (e.g., via Web SSH):


exportfs -ra

exportfs

Step 5. Next, open the NFS server ports (111, 2049, and 20048) for the NFS client IP address (the one specified in the second step). Go to the storage environment’s Settings > Firewall section and add the necessary rules using the intuitive UI:

Firewall

Tip: You can also accomplish this through the console:


Iptables -I INPUT -p tcp -m multiport --dports 111,2049,20048 -s {NFS_client} -j ACCEPT
Iptables -I INPUT -p udp -m multiport --dports 111,2049,20048 -s {NFS_client} -j ACCEPT

NFS Server Ports Through Console

Step 6. When granting RW rights, ensure the same users have identical access permissions to the NFS client and server shared folder.

For instance, different stacks might use different default users (e.g., root)
If necessary, run the following command on your storage server to adjust the permissions:


chown {uid}:{gid} {path}

Here

  • {uid} – the username or ID, which can be found in the /etc/passwd file of your platform container
  • {gid} – the group name or ID, listed in the /etc/group file of your node
  • {path} – the path to the directory for which you want to change the permissions

data storage server

That’s it! Your data storage server is now configured and ready. You can return to the client instance and begin the mounting process.

Save $100 in the next
5:00 minutes?

Register Here