nfs安装

2021-04-28 14:32:21 浏览数 (2)

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

  • dev
代码语言: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
  • test
代码语言: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
  • demo
代码语言: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

0 人点赞