1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# 禁用firewalld
systemctl stop firewalld.service
systemctl disable firewalld.service
# 安装rpc和nfs-server
dnf -y install nfs-utils rpcbind
# 配置nfs
echo "/data/k8s *(rw,sync,no_root_squash)" >> /etc/exports
# 启动rpc和nfs-server,启动服务 nfs 需要向 rpc 注册,
# rpc ⼀旦重启了,注册的⽂件都会丢失,向他注册的服务都需要重启
systemctl start rpcbind.service && \
systemctl enable rpcbind.service
systemctl -a | grep nfs | awk '{print $1}' | xargs -L1 systemctl start && \
systemctl -a | grep nfs | awk '{print $1}' | xargs -L1 systemctl enable
# 验证
systemctl status rpcbind.service
systemctl status
rpcinfo -p|grep nfs
cat /var/lib/nfs/etab
#/data/k8s *(rw,sync,wdelay,hide,nocrossmnt,secure,no_root_squash,no_all_squash,no_subtree_check,secure_locks,acl,no_pnfs,anonuid=65534,anongid=65534,sec=sys,rw,secure,no_root_squash,no_all_squash)
|