k8s 集群需要存储,本地测试环境懒得搞些复杂的,开始回忆回忆入门时学的 nfs 的搭建,记录下吧,方便查看
搭建服务器
1
| sudo apt install -y nfs-kernel-server
|
1
| sudo yum install -y nfs-utils
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| sudo mkdir /nfs
sudo chown -R nobody:nogroup /nfs
echo "/nfs *(rw,sync,no_subtree_check,no_root_squash)" >> /etc/exports
sudo exportfs -a
|
重启服务
1 2
| sudo systemctl restart nfs-server sudo systemctl enable nfs-server
|
1 2 3
| sudo systemctl restart nfs sudo systemctl enable nfs
|
1 2
| sudo systemctl restart nfs-server sudo systemctl enable nfs-server
|
搭建客户端
1
| sudo apt install -y nfs-common
|
1
| sudo yum install -y nfs-utils
|
1 2 3 4 5 6 7 8
| mkdir /mnt/nfs
sudo mount 10.0.0.3:/nfs /mnt/nfs
10.0.0.3:/nfs /mnt/nfs nfs defaults 0 0
|