Issue Description:

Can we use NFS Mount instead of SAMBA Share for Ephesoft Shared Folders over network ?

 

Component:

Shared Folder on a n/w for cluster environment setup in Linux Environment.

 

Analysis:

We have tested and verified the working of Ephesoft in multi-server environment by sharing and mounting the SharedFolders using Network File System(NFS). Please find below the overview for the same:

NFS (Network File System) is basically developed for sharing of files and folders between Linux/Unix systems by Sun Microsystems in 1980. It allows you to mount your local file systems over a network and remote hosts to interact with them as they are mounted locally on the same system. With the help of NFS, we can set up file sharing between Unix to Linux system and Linux to Unix system.

Benefits of NFS

  1. NFS allows local access to remote files.
  2. It uses standard client/server architecture for file sharing between all *nix based machines.
  3. With NFS it is not necessary that both machines run on the same OS.
  4. With the help of NFS we can configure centralized storage solutions.
  5. Users get their data irrespective of physical location.
  6. No manual refresh needed for new files.
  7. Newer version of NFS also supports acl, pseudo root mounts.
  8. Can be secured with Firewalls and Kerberos

Setup and Configure NFS Mounts on Linux Server

To setup NFS mounts, we’ll be needing at least two Linux/Unix machines. Here in this example, We’ll be using two servers.

NFS Server: IP-10.127.127.182

NFS Client : IP-172.19.1.254

Installing NFS Server and NFS Client

We need to install NFS packages on our NFS Server as well as on NFS Client machine. We can install it via “yum” (Red Hat Linux) and “apt-get” (Debian and Ubuntu) package installers. We are taking here the example to install it on RedHat operating system.

  1. Install NFS on NFS Server machine using the following command:

yum install nfs* -y

  1. Start NFS services on NFS Server machine using the following command:

service rpcbind start

           chkconfig rpcbind on

           service nfs start

           chkconfig nfs on

  1. Install NFS on NFS Client machine using the following command:

          yum install nfs* -y

  1. Start NFS services on NFS Client machine using the following command:

         service rpcbind start

         chkconfig rpcbind on

         service nfs start

         chkconfig nfs on

  1. Export shared directory on NFS Server machine requires following steps:
  • Edit file /etc/exports in vi editor using following command:

          vi /etc/exports

  • Add the entry as shown below in the /etc/exports file:

          /opt/Ephesoft/SharedFolders    172.19.1.254 (rw,sync,no_root_squash,no_all_squash)

          where,

          /opt/Ephesoft/SharedFolders– Path of Ephesoft’s Shared Folders

          172.19.1.254– IP address range of clients

          rw – Writable permission to shared folder

          sync – Synchronize shared directory

          no_root_squash– Enable root privilege

          no_all_squash– Enable user’s authority

  1. Restart the NFS services on NFS Server machine using the following command:

          service nfs restart

  1. Mount the Shared Folders on NFS Client machine using the following command:

          mount -t nfs 10.127.127.182/opt/Ephesoft/SharedFolders/  /opt/Ephesoft/SharedFolders/

Probably it will show a connection timed out error which means that the firewall is blocking NFS server machine. To allow NFS server to access from outbound, go to NFS server system and add the entries as shown below in the ‘etc/sysconfig/iptables’ file.

     8. vi /etc/sysconfig/iptables

         Append the following lines shown in red colour.

         -A INPUT -m state –state NEW -m tcp -p tcp –dport 2049 -j ACCEPT

         -A INPUT -m state –state NEW -m tcp -p tcp –dport 111 -j ACCEPT

         -A INPUT -m state –state NEW -m tcp -p tcp –dport 32803 -j ACCEPT

         -A INPUT -m state –state NEW -m tcp -p tcp –dport 892 -j ACCEPT

         -A INPUT -m state –state NEW -m tcp -p tcp –dport 875 -j ACCEPT

         -A INPUT -m state –state NEW -m tcp -p tcp –dport 662 -j ACCEPT

    9. Now restart the iptables service.

          service iptables restart

 

10. Again mount the share in client system with command:

         mount -t nfs 192.168.1.250:/ /opt/Ephesoft/SharedFolders/   /opt/Ephesoft/SharedFolders/

 

11. Now the NFS share will mount without any connection timed out error.

12. We can test our NFS server setup by creating a test file on the server end and check its availability at NFS Client side or vice-versa.

13. If you want to unmount that shared directory from your server after you are done with the file sharing, you can simply unmounts that particular directory with “umount” command. See this example below.

          umount  /opt/Ephesoft/SharedFolders /

Important commands for NFS

Some more important commands for NFS:

  1.  showmount -e : Shows the available shares on your local machine
  2.  showmount -e <server-ip or hostname>: Lists the available shares at the remote server
  3.  showmount -d : Lists all the sub directories
  4.  exportfs -v : Displays a list of shares files and options on a server
  5.  exportfs -a : Exports all shares listed in /etc/exports, or given name
  6.  exportfs -u : Unexports all shares listed in /etc/exports, or given name
  7.  exportfs -r : Refresh the server’s list after modifying /etc/exports

Reference Link

Please see the below link for reference:

http://www.unixmen.com/nfs-server-installation-and-configuration-in-centos-6-3-rhel-6-3-and-scientific-linux-6-3/

http://www.tecmint.com/how-to-setup-nfs-server-in-linux/

 

Was this article helpful to you?

Abhishek Jain