-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnfs.sh
executable file
·31 lines (23 loc) · 920 Bytes
/
nfs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# setup a shared filed system
# after https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-16-04
# run on master
sudo apt-get install --yes nfs-kernel-server
# this will export the directory /root to all nodes listed
# do manually
rm -rf /etc/exports
echo -e "
/home 10.20.35.11(rw,sync,no_root_squash)
/home 10.20.35.21(rw,sync,no_root_squash)
/home 10.20.35.26(rw,sync,no_root_squash)
/home 10.20.35.27(rw,sync,no_root_squash)
/home 10.20.35.30(rw,sync,no_root_squash)
/home 10.20.35.31(rw,sync,no_root_squash)
/home 10.20.35.32(rw,sync,no_root_squash)
/home 10.20.35.33(rw,sync,no_root_squash)
/home 10.20.35.35(rw,sync,no_root_squash)
/home 10.20.35.36(rw,sync,no_root_squash)" |
cat >> /etc/exports
sudo exportfs -ra
echo "starting nfs server"
sudo systemctl start nfs-kernel-server.service
echo "done starting nfs server"