Roger Maitland | eb412c6 | 2018-05-31 14:09:09 -0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | usage () { |
| 4 | echo "Usage:" |
| 5 | echo " ./$(basename $0) nfs_master_ip" |
| 6 | exit 1 |
| 7 | } |
| 8 | |
| 9 | if [ "$#" -ne 1 ]; then |
| 10 | echo "Missing NFS mater node" |
| 11 | usage |
| 12 | fi |
| 13 | |
| 14 | MASTER_IP=$1 |
| 15 | |
| 16 | #Install NFS common |
| 17 | sudo apt-get update |
| 18 | sudo apt-get install -y nfs-common |
| 19 | |
| 20 | #Create NFS directory |
| 21 | sudo mkdir -p /dockerdata-nfs |
| 22 | |
| 23 | #Mount the remote NFS directory to the local one |
| 24 | sudo mount $MASTER_IP:/dockerdata-nfs /dockerdata-nfs/ |
| 25 | echo "$MASTER_IP:/dockerdata-nfsĀ /dockerdata-nfs nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0" | sudo tee -a /etc/fstab |