-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnfs.setup.sh
executable file
·31 lines (27 loc) · 1016 Bytes
/
nfs.setup.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
yum install rpcbind nfs-utils -y
systemctl start rpcbind
systemctl start nfs-server
systemctl enable rpcbind
systemctl enable nfs-server
systemctl enable nfs-idmap
systemctl enable nfs-lock.service
grep -q fs.nlm /etc/sysctl.conf
if [ $? -eq 1 ]
then
sed -i -e '$afs.nfs.nlm_tcpport=53248' -e '$afs.nfs.nlm_udpport=53248' /etc/sysctl.conf
fi
sed -i -e 's/^RPCMOUNTDOPTS.*/RPCMOUNTDOPTS="-p 20048"/' -e 's/^STATDARG.*/STATDARG="-p 50825"/' /etc/sysconfig/nfs
setsebool -P virt_use_nfs=true
mkdir /nfsexport
parted -s /dev/xvdb mklabel msdos
parted -s /dev/xvdb mkpart primary xfs 0 100%
mkfs.xfs /dev/xvdb1
mount /dev/xvdb1 /nfsexport
echo "/dev/xvdb1 /nfsexport xfs defaults 0 0" >>/etc/fstab
echo "Creating mounts for Casandra and Hawkular"
mkdir /nfsexport/{cassandra-volume,registry-volume}
echo "/nfsexport/registry-volume *(rw,root_squash)" >> /etc/exports
echo "/nfsexport/cassandra-volume *(rw,root_squash)" >> /etc/exports
chmod -R 777 /nfsexport/*
chown -R nfsnobody:nfsnobody /nfsexport
exportfs -a