You've already forked www.colben.cn
update
This commit is contained in:
@@ -8,8 +8,8 @@ categories: ["storage"]
|
||||
---
|
||||
|
||||
## 环境
|
||||
- 服务端 CentOS7 192.168.1.100
|
||||
- 客户端 CentOS7 192.168.1.101
|
||||
- 服务端 CentOS8 192.168.1.100
|
||||
- 客户端 CentOS8 192.168.1.101
|
||||
|
||||
## 服务端
|
||||
- 安装
|
||||
@@ -19,14 +19,16 @@ categories: ["storage"]
|
||||
systemctl start nfs-server
|
||||
# rpcbind 服务自动 start 并 enable
|
||||
```
|
||||
|
||||
- 创建配置文件
|
||||
```bash
|
||||
mkdir /nfs_share -p
|
||||
chown -R nfsnobody.nfsnobody /nfs_share
|
||||
cat > /etc/exports.d/mynfs.conf <<EOF
|
||||
chown -R nobody:nobody /nfs_share
|
||||
cat > /etc/exports <<EOF
|
||||
/nfs_share 192.168.1.0/24(rw,sync,all_squash)
|
||||
EOF
|
||||
```
|
||||
|
||||
- 重新载入配置
|
||||
```bash
|
||||
exportfs -r
|
||||
@@ -41,10 +43,12 @@ categories: ["storage"]
|
||||
# 客户端就不需要启动 nfs 服务了
|
||||
# rpcbind 服务自动 start 并 enable
|
||||
```
|
||||
|
||||
- 查看服务端可用的共享目录
|
||||
```bash
|
||||
showmount -e 192.168.1.100
|
||||
```
|
||||
|
||||
- 挂载服务端共享目录
|
||||
```bash
|
||||
# 先创建本地目录,用于挂载
|
||||
@@ -56,7 +60,6 @@ categories: ["storage"]
|
||||
## 通信过程
|
||||
- 首先服务器端启动 RPC 服务,并开启 111 端口
|
||||
- 服务器端启动 NFS 服务,并向 RPC 注册端口信息
|
||||
- **注:该端口是用来传输数据的,目前不知道 NFS 选择该端口的依据,如果是随机的,防火墙如何放行?**
|
||||
- 客户端启动 RPC 服务,向服务端的 RPC 服务请求服务端的 NFS 端口
|
||||
- 服务端的 RPC 服务反馈 NFS 端口信息给客户端
|
||||
- 客户端通过获取的 NFS 端口来建立和服务端的 NFS 连接并进行数据的传输
|
||||
@@ -76,7 +79,7 @@ hide | 在 nfs 共享目录中不共享其子目录
|
||||
no_hide | 共享 nfs 目录的子目录
|
||||
subtree_check | 如果共享 /usr/bin 之类的子目录时,强制 nfs 检查父目录的权限(默认)
|
||||
no_subtree_check | 不检查父目录权限
|
||||
all_squash | 共享文件的 UID 和 GID 映射匿名用户 nfsnobody,适合公用目录
|
||||
all_squash | 共享文件的 UID 和 GID 映射匿名用户 nobody,适合公用目录
|
||||
no_all_squash | 保留共享文件的 UID 和 GID(默认)
|
||||
root_squash | root 用户的所有请求映射成如 anonymous 用户一样的权限(默认)
|
||||
no_root_squash | root 用户具有根目录的完全管理访问权限
|
||||
|
||||
Reference in New Issue
Block a user