NFS 服务部署

NFS 服务部署

# 安装 NFS 服务
yum install nfs-utils nfs-utils-lib rpcbind -y
systemctl enable rpcbind
systemctl enable nfs-server
systemctl enable nfs-lock
systemctl enable nfs-idmap
systemctl start rpcbind
systemctl start nfs-server
systemctl start nfs-lock
systemctl start nfs-idmap

# 生成 NFS 配置
tee  /etc/exports <<-'EOF'
/data/websites/app  10.10.8/24(rw,sync,no_root_squash,no_all_squash)
/data/websites/storage  10.1.0.8/24(rw,sync,no_root_squash,no_all_squash)
/data/websites/public  10.1.0.8/24(rw,sync,no_root_squash,no_all_squash)
/data/websites/storage  10.1.0.8/24(rw,sync,no_root_squash,no_all_squash)
EOF


# 设置防火墙并重启服务
systemctl restart nfs-server
firewall-cmd --permanent --zone=public --add-service=nfs
firewall-cmd --reload
posted @ 2021-04-13 11:03  冰冷的火  阅读(33)  评论(0)    收藏  举报