NFS Server
代码语言:javascript
复制yum -y install nfs-utils nfs-utils-lib rpcbind
mkdir -p /opt/nfsdata
vi /etc/exports # Add
---------------------------------------------------------------
/opt/nfsdata 172.21.16.0/20(rw,sync,no_root_squash)
---------------------------------------------------------------
systemctl restart rpcbind
systemctl restart nfs
systemctl enable rpcbind
systemctl enable nfs
NFS Client
代码语言:javascript
复制yum install nfs-utils
showmount -e 172.21.16.160
mkdir -p /opt/nfsdata
chown -R www: /opt/nfsdata
mount -t nfs4 172.21.16.160:/opt/nfsdata /opt/nfsdata
cat >> /etc/fstab <<EOF
172.21.16.160:/opt/nfsdata /opt/nfsdata nfs4 nodev,rw,rsize=32768,wsize=32768 0 0
EOF
代码语言:javascript
复制yum install nfs-utils
showmount -e 172.21.16.156
mkdir -p /opt/nfsdata
chown -R www: /opt/nfsdata
mount -t nfs4 172.21.16.156:/opt/nfsdata /opt/nfsdata
cat >> /etc/fstab <<EOF
172.21.16.156:/opt/nfsdata /opt/nfsdata nfs4 nodev,rw,rsize=32768,wsize=32768 0 0
EOF
代码语言:javascript
复制yum install nfs-utils
showmount -e 172.21.16.162
mkdir -p /opt/nfsdata
chown -R www: /opt/nfsdata
mount -t nfs4 172.21.16.162:/opt/nfsdata /opt/nfsdata
cat >> /etc/fstab <<EOF
172.21.16.162:/opt/nfsdata /opt/nfsdata nfs4 nodev,rw,rsize=32768,wsize=32768 0 0
EOF