搭建nfs服务器

NFS 是Network File System的缩写,即网络文件系统。一种使用于分散式文件系统的协定,
NFS 的基本原则是“容许不同的客户端及服务端通过一组RPC分享相同的文件系统”,它是独立于操作系统,容许不同硬件及操作系统的系统共同进行文件的分享。
NFS服务器搭建(192.168.16.128)
1,若防火墙未关闭,使用如下命令进行关闭
systemctl stop firewalld`
systemctl disable firewalld

2. 检查SELinux
[root@node2 ~]# cat /etc/selinux/config 
     SELINUX=disabled
3.安装nfs包
检查是否安装
rpm -qa | grep nfs
rpm -qa | grep rpcbind
# 安装nfs相关服务软件包
yum install nfs-utils
yum install rpcbind 
4.配置nfs
vim /etc/exports
/nfs 192.168.16.*(rw,async,no_root_squash)

5.启动,自启服务,先rpbind再nfs
[root@mail ~]# systemctl enable rpcbind && systemctl start rpcbind
[root@mail ~]# systemctl enable nfs && systemctl restart nfs
6.使nfs配置生效
exportfs -r

# 查看服务状态
systemctl status rpcbind
systemctl status nfs
 查看服务状态
systemctl status rpcbind
systemctl status nfs
 rpcinfo -p ,如果显示rpc 服务器注册的端口列表(端口:111),则启动成功。
查看是否成功和可用的nfs地址:
# 查看可用的nfs地址
[root@node2 ~]# showmount -e localhost

NFS客户端配置(792.168.16.129)

#创建挂载的文件夹
mkdir -p /nfs/data 
# showmount -e $(nfs服务器的IP)
showmount -e 192.168.16.128
挂载nfs
mount -t nfs 192.168.16.128:/nfs /nfs/data


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

离陌殇殃

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值