linux_wiki:nfs_shares

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux_wiki:nfs_shares [2016/01/04 23:17]
billdozor created
linux_wiki:nfs_shares [2019/05/25 23:50] (current)
Line 1: Line 1:
-====== Nfs Shares ======+====== NFS Shares ======
  
 **General Information** **General Information**
Line 6: Line 6:
  
 **Checklist** **Checklist**
-  * Enterprise Linux 6/+  * Distro(s): Enterprise Linux 7 
-  * Two systems (server and client)+  * Other: Two systems (server and client)
  
 ---- ----
Line 13: Line 13:
 ====== NFS Server Setup ====== ====== NFS Server Setup ======
  
-TODO+  * Install required package<code bash>yum install nfs-utils</code> 
 +  * Start and enable the NFS Server<code bash>systemctl start nfs-server 
 +systemctl enable nfs-server</code> 
 +  * Create your share directory structure<code bash>mkdir -p /data/share1</code> 
 +  * Create an export line to share the directory<code bash>vim /etc/exports 
 + 
 +/data/share1  192.168.1.0/24(rw)</code> 
 +    * /data/share1 => the directory to share 
 +    * 192.168.1.0/24(rw) => share to entire network with read/write. 
 +      * Other ways to share are to specify single hostnames(short, fqdn, single ip), IP networks (as shown), hostnames/domains with wildcards (*.mydomain.edu). See man exports for more details. 
 +  * If a firewall is running, allow nfs, rpc-bind, and mountd<code bash>firewall-cmd --permanent --add-service=nfs 
 +firewall-cmd --permanent --add-service=rpc-bind 
 +firewall-cmd --permanent --add-service=mountd 
 +firewall-cmd --reload</code> 
 +    * nfs (tcp/udp 2049) => needed for NFSv4 
 +    * rpc-bind (tcp/udp 111) => needed for NFSv3 compatibility and for showmount to work from client 
 +    * mountd (tcp/udp 20048) => needed for the "showmount -e hostname" command to work from a client 
 + 
 +---- 
 + 
 +===== NFS Server: Increasing NFS Threads ===== 
 + 
 +To increase NFS server performance, it is usually necessary to increase the number of NFS daemon processes running. (The default is very small at 8.) 
 + 
 +  * CentOS 7 
 +    * Edit the following config file<code bash>vim /etc/sysconfig/nfs 
 + 
 +# Number of nfs server processes to be started. 
 +# The default is 8. 
 +RPCNFSDCOUNT=16 
 +</code> 
 +    * Restart the nfs-config service<code bash>systemctl restart nfs-config</code> 
 +    * Restart the nfs service<code bash>systemctl restart nfs-server</code> 
 +    * Verify 
 +      * NFS running sysconfig (takes effect after nfs-config restart)<code bash>cat /run/sysconfig/nfs-utils 
 +RPCNFSDARGS=" 16"</code> 
 +      * "th" line in proc (number after 'th' is number of processes)<code bash>grep th /proc/net/rpc/nfsd 
 +th 16 0 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000</code> 
 +      * Running processes<code bash>ps -elf | grep nfsd] | grep -v grep | wc -l 
 +16</code>
  
 ---- ----
Line 19: Line 58:
 ====== NFS Client Setup ====== ====== NFS Client Setup ======
  
-TODO+  * Install required package<code bash>yum install nfs-utils</code> 
 +  * View available mounts on NFS Server<code bash>showmount -e fileserver01 
 + 
 +Export list for fileserver01: 
 +/data/share1 192.168.1.0/24</code> 
 +  * Mount temporarily<code bash>mount -t nfs fileserver01:/data/share1 /mnt</code> 
 +  * Mount persistently<code bash>vim /etc/fstab 
 + 
 +## NFS Shares ## 
 +fileserver01:/data/share1  /remote  nfs  _netdev  0 0</code> 
 +    * _netdev => Mount option to skip mounting this location until the network is available.
  
 ---- ----
  
  • linux_wiki/nfs_shares.1451967475.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)