yelmos

test

docker 使用NFS挂载远程目录

功能概述

docker远程目录做容器的映射

  • 功能解决链接

https://cloud-atlas.readthedocs.io/zh_CN/latest/docker/storage/docker_container_nfs.html

采用链接中的方案二

  • NFS 下载指导链接

https://cloud-atlas.readthedocs.io/zh_CN/latest/linux/ubuntu_linux/storage/ubunut_nfs.html#ubunut-nfs

  • nfs服务端下载
apt install nfs-kernel-server
  • NFS下载可能出现的问题
    1.swap未开启
    开启方式
swapon /swap   
echo "/swap swap swap defaults    0  0" >> /etc/fstab

本人工作执行机是执行

swapon /swap.img  
echo "/swap.img swap swap defaults    0  0" >> /etc/fstab

k8s需要关闭是执行 swapon -a

  • nfs 设置部分ip访问
vim /etc/fstab
/data/nfs  127.0.0.0/24(rw,sync,no_root_squash,no_subtree_check)

127.0.0.0-24才可以访问挂载的/data/nfs目录

  • nfs 客户端下载
apt install nfs-common
  • 目前只知道一个服务端的nfs可以挂载到多个客户端上,nfs服务端集群互通还不知道怎么弄
    不同的nfs服务端挂载到执行机不同目录上,如下图

  • gfs可是可以解决远程挂载问题
    https://blog.51cto.com/u_15127564/3469924

posted on 2021-09-10 10:19  yelmos  阅读(346)  评论(0编辑  收藏  举报

导航