User Tools

Site Tools


hpc:installnfs

Differences

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

Link to this comparison view

Next revision
Previous revision
hpc:installnfs [2020/01/29 09:04]
miriel@uclv created
hpc:installnfs [2020/04/10 17:38] (current)
Line 13: Line 13:
 <​code>​ <​code>​
 yum install nfs-utils yum install nfs-utils
 +systemctl enable nfs-server
 systemctl enable nfs-server systemctl enable nfs-server
 </​code>​ </​code>​
Line 34: Line 35:
   * Options for each of the hosts must be placed in parentheses directly after the host identifier, without any spaces separating the host and the first parenthesis.   * Options for each of the hosts must be placed in parentheses directly after the host identifier, without any spaces separating the host and the first parenthesis.
  
-We’ll create directory on /opt/apps that will be exported to NFS clients.+We’ll create directory on /opt/apps that will be exported to NFS clients 
 + 
 +we need to modify /​etc/​exports to configure NFS shareThe structure is: 
 + 
 +<​code>​ 
 +vi /​etc/​exports 
 +</​code>​ 
 + 
 +<​code>​ 
 +/​opt/​apps ​          ​10.10.2.0/​24(ro,​no_root_squash) 
 +</​code>​ 
 + 
 +The **no_root_squash** option disables root **squashing** – enables remote root user to have root privileges. 
 + 
 +Once you’re done with the settings, use the exportfs utility to selectively export directories without restarting the NFS service or you can restart the service. 
 + 
 +<​code>​ 
 +exportfs -rav 
 +</​code>​ 
 +  * r – Causes all directories listed in /​etc/​exports to be exported by constructing a new export list in /​etc/​lib/​nfs/​xtab 
 +  * a – All directories are exported or unexported, depending on what other options are passed to exportfs 
 +  * v – Verbose operation – Show what’s going on 
 + 
 +or 
 + 
 +<​code>​ 
 +systemctl restart nfs-server 
 +</​code>​ 
 + 
 +SELinux boolean may need to be enabled. 
 + 
 +<​code>​ 
 +setsebool -P nfs_export_all_rw 1 
 +</​code>​ 
 + 
 +====== Mounting NFS shares on remote servers ====== 
 +Now that we’re done with NFS server configurations,​ the remaining part is mounting NFS shares on a client system. 
 + 
 +===== Install NFS Client ​ ===== 
 +<​code>​ 
 +yum -y install nfs-utils 
 +</​code>​ 
 +===== Mouting NFS Share on the Client ===== 
 +We need to create a folder on clients where we are going to mount the remote NFS folder 
 + 
 +<​code>​ 
 +mkdir /opt/apps 
 +</​code>​  
 + 
 +<​code>​ 
 +mount -t nfs -o nfsvers=4 10.10.2.242:/​opt/​apps /opt/apps 
 +</​code>​ 
 + 
 +Verifying its all ok 
 + 
 +<​code>​ 
 +df -hT | grep /opt/apps 
 +</​code>​ 
 + 
 +To persist the changes across system reboots, Configure NFS mounting on /​etc/​fstab. 
 + 
 +<​code>​ 
 +vi /​etc/​fstab 
 +</​code>​ 
 + 
 +Add a line like with the following syntax to the end of file. 
 + 
 +<​code>​ 
 +10.10.2.242:/​opt/​apps ​ /​opt/​apps ​  nfs defaults ​  0 0 
 +</​code>​ 
 + 
 +Test your settings. 
 + 
 +<​code>​ 
 +sudo umount /mnt 
 +sudo mount -a 
 +df -hT | grep /mnt 
 +</​code>​
  
  
hpc/installnfs.1580288674.txt.gz · Last modified: 2020/04/10 17:38 (external edit)