Administrator
发布于 2025-10-16 / 3 阅读
0
0

Centos7 安装 NFS 服务器

192.186.2.105 NFS 服务器

192.168.2.106 Client 客户端

一、安装 NFS 服务器

1、创建 数据文件夹

mkdir -p /nfsdata

2、安装

yum -y install rpcbind nfs-utils

3、编辑配置

vim /etc/exports

/nfsdata *(rw,sync,no_root_squash,no_all_squash)

4、启动

systemctl start rpcbind
systemctl start nfs-server.service
systemctl enable rpcbind
systemctl enable nfs-server.service

 二、安装 客户端

1、安装

yum -y install nfs-utils

2、查看

showmount -e 192.168.2.105

Export list for 192.168.2.105:
/nfsdata *

3、挂载

mkdir -p /mnt/nfsdata

mount -t nfs 192.168.2.105:/nfsdata /mnt/nfsdata

4、创建一个文件

echo "hello,world" > hello.html

三、查看 NFS 服务器

1、成功显示 hello.html 文件

ll /nfsdata
总用量 4
-rw-r--r-- 1 root root 12 3月  19 07:31 hello.html

原文链接:

https://blog.csdn.net/mshxuyi/article/details/115102838


评论