1. 安装必备插件  以防centos7默认没有启动nfs服务

yum -y install nfs-utils rpcbind

# 启动 rpcbind 和配置开机自启动
systemctl start rpcbind
systemctl enable rpcbind # 启动 nfs 和配置开机自启动
systemctl start nfs
systemctl enable nfs
重启服务
service nfs restart
[root@master nfs]# ps -ef|grep nfs
root : ? :: [nfsd4_callbacks]
root : ? :: [nfsd]
root : ? :: [nfsd]
root : ? :: [nfsd]
root : ? :: [nfsd]
root : ? :: [nfsd]
root : ? :: [nfsd]
root : ? :: [nfsd]
root : ? :: [nfsd]
root : ? :: [nfsv4.-svc]
root : pts/ :: grep --color=auto nfs
root : ? :: [nfsiod]
root : ? :: [nfsv4.-svc]

2. 设置共享目录  去掉密码校验insecure

vim /etc/exports

增加一行

/mnt/nfs/ *(insecure,rw,async,no_root_squash)

如果是挂载到另外一台服务器

/mnt/nfs/ 172.19.68.10(insecure,rw,async,no_root_squash)

3. 重启直接用命令挂载

创建目录

mkdir /mnt/nfs

sudo mount -t nfs 172.19.68.9:/mnt/nfs/ /mnt/nfs

查看挂载的目录

nfsstat -m

显示共享目录的情况

showmount -e

附录deployment.yaml内容

kubectl replace -f deployment.yaml

apiVersion: v1
kind: ServiceAccount
metadata:
name: nfs-client-provisioner
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: nfs-client-provisioner
spec:
replicas:
strategy:
type: Recreate
template:
metadata:
labels:
app: nfs-client-provisioner
spec:
serviceAccount: nfs-client-provisioner
containers:
- name: nfs-client-provisioner
image: quay.io/external_storage/nfs-client-provisioner:latest
volumeMounts:
- name: nfs-client-root
mountPath: /persistentvolumes
env:
- name: PROVISIONER_NAME
value: fuseim.pri/ifs
- name: NFS_SERVER
value: 172.19.68.9
- name: NFS_PATH
value: /mnt/nfs
volumes:
- name: nfs-client-root
nfs:
server: 172.19.68.9
path: /mnt/nfs

这篇详细https://blog.csdn.net/qq_35992900/article/details/80446005

最新文章

  1. ubunt14.04 安装JDK
  2. Linux环境下段错误的产生原因及调试方法小结(转)
  3. EXCEL导入导出自己整理的一些方法
  4. 周赛-kiki's game 分类: 比赛 2015-08-02 09:24 7人阅读 评论(0) 收藏
  5. BZOJ 1176 MOKIA
  6. Eclipse 安装对 Java 8 的支持
  7. C++使用http请求,亲测可用,VS2008编译运行通过
  8. jquery之前后台交互
  9. 我对hibernate的对象的3种状态的理解
  10. HTML——超文本标记语言
  11. 某控股公司OA系统ORACLE DG搭建
  12. Mac上Homebrew的安装
  13. pyqt text browser 设置文本
  14. [NOIp2013提高组]积木大赛/[NOIp2018提高组]铺设道路
  15. 二进制手动部署kubernetes 1.10.10
  16. ubuntu安装rvm
  17. Vue组件中引入jQuery
  18. OSSIM架构与组成综述
  19. P4889 kls与flag
  20. 20155313 2016-2017-2 《Java程序设计》第八周学习总结

热门文章

  1. useState 的介绍和多状态声明(二)
  2. R Shiny app | 交互式网页开发
  3. pt-table-checksum解读【转】
  4. 多个请求共用一个Servlet(JavaWEB)
  5. vue-router 利用url传递参数
  6. ffmpeg-php扩展
  7. Dart介绍和环境搭建
  8. Android 打开相册拍照选择多张图片显示
  9. ISO/IEC 9899:2011 条款6.5.16——赋值操作符
  10. 【转】用python读写excel的强大工具:openpyxl