配置nfs环境的一些命令

服务器端

安装nfs

yum install -y nfs-utils

创建共享目录

mkdir /mnt/share
chown -R nfsnobody.nfsnobody # 修改权限

编辑nfs文件

vim etc/exports

写入

共享目录 可访问的权限

/mnt/share *(rw)

启动服务

启动rpc服务

systemctl restart rpcbind

启动nfs服务

systemctl restart nfs-server
showmount -e localhost #展示本地可挂载信息

查看状态:

systemctl status -l nfs-server

查看rpcbind 和nfs端口状态

netstat -lantu|grep 111
netstat -lantu|grep 2049

选择共享权限:

shoumount -t ip

客户端:

安装nfs

yum -y install nfs-utils

查看链接状态:

showmount -e 192.168.159.128

选择文件夹及存储到本地的位置

mount -t nfs 服务器端ip:/mnt/share /mnt/nfs

发布了33 篇原创文章 · 获赞 27 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/eclipse9527/article/details/103012203