NFS共享存储

一、安装

https://zhuanlan.zhihu.com/p/578935706
https://blog.csdn.net/huahua1999/article/details/124375495
https://zhuanlan.zhihu.com/p/606174368?utm_id=0

# 安装nfs
yum -y install nfs-utils

# 创建nfs目录
mkdir -p /nfs/data/

# 修改权限
chmod -R 777 /nfs/data

# 编辑export文件
vim /etc/exports
/nfs/data *(rw,no_root_squash,sync)  (“*“代表所有人都能连接,建议换成具体ip或ip段,如192.168.20.0/24)

# 配置生效
exportfs -r
#查看生效
exportfs

# 启动rpcbind、nfs服务
systemctl restart rpcbind && systemctl enable rpcbind
systemctl restart nfs && systemctl enable nfs

# 查看 RPC 服务的注册状况
rpcinfo -p localhost
# 服务器端
sudo apt update
sudo apt upgrade

sudo apt install nfs-kernel-server

sudo mkdir -p /opt/nfs/data/

sudo chown nobody:nogroup /opt/nfs/data/
sudo chmod 755 /opt/nfs/data/

vim /etc/exports
# 配置
/opt/nfs/data/ <client_IP>(rw,sync,no_subtree_check)

sudo exportfs -ra
sudo systemctl restart nfs-kernel-server

# 客户端
sudo apt install nfs-common

你可能感兴趣的:(kubernetes)