安装 NFS
# 临时关闭 SeLinux,重启机器会恢复 setenforce 0 # 永久关闭 SeLinux sed -i "s/SELINUX=enforcing/SELINUX=permissive/" /etc/selinux/config # 关闭 iptables systemctl stop iptables # 关闭 firewalld systemctl stop firewalld# CentOS yum install -y nfs-utils rpcbind # Debian apt-get install -y nfs-common nfs-kernel-servermkdir /data chmod 755 /data# /etc/exports # <path> <allow-host>(<option>) /data 10.140.0.0/14(rw,sync,no_root_squash)# CentOS systemctl start nfs.service systemctl start rpcbind.service # Debian systemctl start nfs-server systemctl restart nfs-kernel-server# 检查是否有共享目录 showmount -e <nfs-server-ip># 创建本地目录 mkdir /test # 挂载 nfs mount -t nfs <nfs-server-ip>:<path> /test
Last updated