eGov ERP DevOps
Setup NFS Mounts On Ubuntu
Setup NFS Mounts On Ubuntu:
For this, we’re going to be using two systems:
Host Computer with IP address: Host
Client Computer with IP address: Client(App server)
Share Resource Name: egovFilestore
Step 1: Installing NFS Server packages on the Host computer
Host
sudo apt-get update
sudo apt-get install nfs-kernel-server
Step 2: Installing NFS client packages on the client systems
Client(App server)
sudo apt-get update
sudo apt-get install nfs-common
Step 3: Creating the folder/directory to export (share) to the NFS clients
Client(App server)
sudo mkdir -p /nfs/egovFilestore
sudo chown nobody:nogroup /nfs/egovFilestore
sudo chmod 777 /nfs/egovFilestore
Step 4: Configuring NFS Exports file
Host
/server_share_resource client_IP(share option1, ..... share_optionN)
sudo nano /etc/exports
/nfs/egovFilestore ClientServerIP(rw,sync,no_subtree_check)
sudo exportfs -a
sudo systemctl restart nfs-kernel-server
Step 5: Mounting the NFS share on the client
Client(App server)
sudo mkdir -p /nfs/egovFilestore
sudo mount Host:/nfs/egovFilestore /nfs/egovFilestore
#auto-mount
sudo nano /etc/fstab
Host:/nfs/egovFilestore /nfs/egovFilestore nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0
#unmount
sudo umount /nfs/egovFilestore
#If for some reasons the client can’t access the host folder, open Ubuntu firewall to the client on the host computer.
sudo ufw allow from ClientServer to any port nfs