How To Set Up A NFS Share For An HA Environment On CentOS 7


CloudBolt is able to use a number of different network storage protocols supported by the underlying CentOS 7. We recommend using NFS as your network storage protocol, as it is widely supported and highly available solutions are often in place that CloudBolt can leverage. This article will show you one way of setting up a NFS share between servers.


Setting up the NFS Server

In order to setup NFS mounts, you will need at least 2 servers, with 1 server being the NFS Server and one being the NFS Client.

On both the NFS Server and the Client Server:

Install nfs-utils:

yum install nfs-utils 

Start the services on both servers:

systemctl enable rpcbind
systemctl enable nfs-server
systemctl enable nfs-lock
systemctl enable nfs-idmap
systemctl start rpcbind
systemctl start nfs-server
systemctl start nfs-lock
systemctl start nfs-idmap

NFS Server

On the NFS Server, share required directories

The following directories are required to be shared for a CloudBolt HA environment:




Open /etc/exports :

vi /etc/exports

Add sharing points:

(Replace with IP of your other web server)

/var/opt/cloudbolt        ,sync,no_root_squash,no_all_squash)
/var/log/cloudbolt/jobs   ,sync,no_root_squash,no_all_squash)

Restart the NFS Service:

systemctl restart nfs-server

Add NFS Service override in CentOS 7 firewall-cmd public zone service:

firewall-cmd --permanent --zone=public --add-service=nfs
firewall-cmd --permanent --zone=public --add-service=mountd
firewall-cmd --permanent --zone=public --add-service=rpc-bind
firewall-cmd --reload

NFS Client Server

Rename directories that will be shared:

mv /var/opt/cloudbolt /var/opt/cloudbolt.OLD
mv /var/log/cloudbolt/jobs /var/log/cloudbolt/jobs.OLD
mv /var/www/html/cloudbolt/static /var/www/html/cloudbolt/static.OLD

Create empty directories that will be shared:

mkdir /var/opt/cloudbolt 
mkdir /var/log/cloudbolt/jobs
mkdir /var/www/html/cloudbolt/static

Mount the shared directories from the NFS Server:

(Replace with IP of your NFS Server)

mount -t nfs /var/opt/cloudbolt
mount -t nfs /var/log/cloudbolt/jobs
mount -t nfs /var/www/html/cloudbolt/static

Verify the connection with the NFS Server:

df -kh

Add permanent NFS mounting in fstab:

vi /etc/fstab

Add the directories that will be mounted:

(Replace with IP of your NFS Server) /var/opt/cloudbolt             nfs defaults 0 0 /var/log/cloudbolt/jobs   nfs defaults 0 0 /var/www/html/cloudbolt/static   nfs defaults 0 0

NFS should now be set up properly for your CloudBolt HA environment!

Have more questions? Submit a request


Please sign in to leave a comment.