【NFS 服务】Centos7 离线安装配置NFS

离线安装 NFS 服务

下载链接:
https://mirrors.aliyun.com/centos/7.9.2009/os/x86_64/Packages/nfs-utils-1.3.0-0.68.el7.x86_64.rpm
https://mirrors.aliyun.com/centos/7.9.2009/os/x86_64/Packages/gssproxy-0.7.0-29.el7.x86_64.rpm
https://mirrors.aliyun.com/centos/7.9.2009/os/x86_64/Packages/keyutils-1.5.8-3.el7.x86_64.rpm
https://mirrors.aliyun.com/centos/7.9.2009/os/x86_64/Packages/keyutils-libs-1.5.8-3.el7.x86_64.rpm
https://mirrors.aliyun.com/centos/7.9.2009/os/x86_64/Packages/keyutils-libs-devel-1.5.8-3.el7.x86_64.rpm
https://mirrors.aliyun.com/centos/7.9.2009/os/x86_64/Packages/libevent-2.0.21-4.el7.x86_64.rpm
https://mirrors.aliyun.com/centos/7.9.2009/os/x86_64/Packages/libevent-devel-2.0.21-4.el7.x86_64.rpm
https://mirrors.aliyun.com/centos/7.9.2009/os/x86_64/Packages/libnfsidmap-0.25-19.el7.x86_64.rpm
https://mirrors.aliyun.com/centos/7.9.2009/os/x86_64/Packages/libnfsidmap-devel-0.25-19.el7.x86_64.rpm
https://mirrors.aliyun.com/centos/7.9.2009/os/x86_64/Packages/quota-4.01-19.el7.x86_64.rpm
https://mirrors.aliyun.com/centos/7.9.2009/os/x86_64/Packages/quota-devel-4.01-19.el7.x86_64.rpm
https://mirrors.aliyun.com/centos/7.9.2009/os/x86_64/Packages/rpcbind-0.2.0-49.el7.x86_64.rpm

# 安装( 同目录下,批量安装)
rpm -ivh --force --nodeps *.rpm

# 开机启动
systemctl enable rpcbind.service
systemctl enable nfs-server.service
# 启动nfs
systemctl start rpcbind.service
systemctl start nfs-server.service


systemctl status rpcbind.service
systemctl status nfs-server.service

NFS 服务端(172.17.3.36)配置

# 修改用户/权限
chown -R nfsnobody:nfsnobody /home/apps_share/files/
chmod -R 766 /home/apps_share/files/

# 修改 /etc/exports 添加以下内容(允许本地网段172.17.3.0/24访问):
/home/apps_share/files/ 172.17.3.0/24(rw,sync,no_root_squash,no_all_squash)

# 应用配置并重启NFS服务:
exportfs -rav
systemctl restart nfs-server

# 防火墙
 firewall-cmd --permanent --zone=public --add-service=nfs
 firewall-cmd --permanent --zone=public --add-service=mountd
 firewall-cmd --permanent --zone=public --add-service=rpc-bind
 firewall-cmd --reload

NFS 客户端(172.17.3.37)挂载配置

# 备份原文件
cp -rf /home/apps_share/files /home/backup/

# 删除文件夹内容
cd /home/apps_share/files
rm -rf *


# 挂载
sudo mount -t nfs 172.17.4.64:/home/apps_share/files /home/apps_share/files

# 开机启动, 编辑 /etc/fstab 文件

172.17.3.36:/home/apps_share/files /home/apps_share/files nfs defaults 0 0
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值