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

yum -y install nfs-utils rpcbind

  1. # 启动 rpcbind 和配置开机自启动
  2. systemctl start rpcbind
  3. systemctl enable rpcbind
  4.  
  5. # 启动 nfs 和配置开机自启动
  6. systemctl start nfs
  7. systemctl enable nfs
    重启服务
    service nfs restart
  1. [root@master nfs]# ps -ef|grep nfs
  2. root : ? :: [nfsd4_callbacks]
  3. root : ? :: [nfsd]
  4. root : ? :: [nfsd]
  5. root : ? :: [nfsd]
  6. root : ? :: [nfsd]
  7. root : ? :: [nfsd]
  8. root : ? :: [nfsd]
  9. root : ? :: [nfsd]
  10. root : ? :: [nfsd]
  11. root : ? :: [nfsv4.-svc]
  12. root : pts/ :: grep --color=auto nfs
  13. root : ? :: [nfsiod]
  14. 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

  1. apiVersion: v1
  2. kind: ServiceAccount
  3. metadata:
  4. name: nfs-client-provisioner
  5. ---
  6. kind: Deployment
  7. apiVersion: extensions/v1beta1
  8. metadata:
  9. name: nfs-client-provisioner
  10. spec:
  11. replicas:
  12. strategy:
  13. type: Recreate
  14. template:
  15. metadata:
  16. labels:
  17. app: nfs-client-provisioner
  18. spec:
  19. serviceAccount: nfs-client-provisioner
  20. containers:
  21. - name: nfs-client-provisioner
  22. image: quay.io/external_storage/nfs-client-provisioner:latest
  23. volumeMounts:
  24. - name: nfs-client-root
  25. mountPath: /persistentvolumes
  26. env:
  27. - name: PROVISIONER_NAME
  28. value: fuseim.pri/ifs
  29. - name: NFS_SERVER
  30. value: 172.19.68.9
  31. - name: NFS_PATH
  32. value: /mnt/nfs
  33. volumes:
  34. - name: nfs-client-root
  35. nfs:
  36. server: 172.19.68.9
  37. path: /mnt/nfs

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

nfs挂载文件的更多相关文章

  1. 4.13、nfs挂载优化及优缺点

    1.硬盘:sas/ssd磁盘,买多块,硬件raid5/raid0,网卡吞吐量要大,至少千兆(多网卡bond0) 2.nfs客户端挂载说明: 文件系统有自己的权限,挂载是建立在文件系统之上的,然后更改挂 ...

  2. nfs 动态文件挂载读写权限设置

    nfs 动态文件挂载读写权限设置 待办 ll 命令查看文件夹权限 参考设置共享文件夹https://www.linuxidc.com/Linux/2018-11/155331.htm

  3. nfs挂载配置

    nfs挂载步骤 服务器端 1.安装nfs-utils rpcbind $sudo yum –y install nfs-utils rpcbind 2.文件开放出去配置/etc/exports 例子: ...

  4. linux挂载文件

    Linux挂载Winodws共享文件夹 mount -t cifs -o username=***,password=*** //192.168.1.48/share /mnt 其中-t表示要挂载的类 ...

  5. TQ210开发板NFS挂载android4.0.4的rootfs的方法

    首先声明的是,我使用的u-boot是自己移植的u-boot2013.01.01而非天嵌官方的那个,至于使用官方的u-boot如何去实现nfs挂载rootfs我没怎么研究过,不过原理方法都是一致的. 主 ...

  6. linux下使用NFS挂载文件系统

    转自linux如何使用NFS挂载文件系统 设备:一台服务器和一台客户端,这里我们把装在PC机上的RedHat作为服务器,而客户端则是嵌入式linux开发板. 环境:开发板已启动,连接好串口和网线,串口 ...

  7. Ubuntu开启NFS,挂载根目录

    1.安装NFS server Ubuntu初始状态是没有NFS server的,首先要安装NFS server: $ sudo apt-get install nfs-kernel-server (安 ...

  8. mkyaffs2image制作根文件系统、使用NFS挂载虚拟机目录(2)

    1.制作根文件系统及nfs烧写 1.1 先解压文件系统,/wok/nfs_root 目录下是已经构造好的各种文件系统:① fs_mini.tar.bz2 是最小的根文件系统,里面的设备节点是事先建立好 ...

  9. Linux NFS挂载

    Linux NFS挂载 一.NFS挂载 192.25.10.101/home/sharedata/azkaban/ODS_HS08 挂载到 192.25.10.102/home/data_azkaba ...

随机推荐

  1. HTMLPage测试js通过ajax调用

    HTMLPage测试js通过ajax调用接口 <!DOCTYPE html> <html lang="en" xmlns="http://www.w3. ...

  2. JVM常量的含义与反编译助记符详解

    1.定义一个常量 public class MyTest2 { public static void main(String[] args) { System.out.println(MyParent ...

  3. Spring Boot核心原理

    Spring Boot核心原理 spring-boot-starter-xxx  方便开发和配置 1.没有depoy setup tomcat 2.xml文件里面的没有没有了 @SpringBootA ...

  4. 微信小程序带cookie的request请求代码封装(小程序使用session)

    微信小程序带cookie的request请求可,以使服务端知道是同一个客户端请求. session_id会不变,从而很好的使用服务端的session. 写一个工具函数,直接导入使用即可,接口同 wx. ...

  5. vim 外部粘贴代码,如何保持原格式,而不持续缩进

    主要内容:使用“:set paste” 来实现vim 按照源文件格式复制 在vim 使用中偶尔要复制外部代码,常常出现不停缩进的问题: 怎么避免此种情况出现呢 可以在命令模式中使用“:set past ...

  6. 阿里druid连接池监控数据自定义存储

    如何将druid连接池监控到的sql执行效率,连接池资源情况等进行持久化存储,方便系统运维分析优化,以下案例初步测试成功. 第一部: 新建MyDruidStatLogger类实现接口 extends ...

  7. linux: E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)

    今天在使用ubuntu执行下列指令的时候出现了错误: sudo apt-get update 解决办法: 输入以下命令: sudo rm /var/cache/apt/archives/lock su ...

  8. Linux防火墙白名单设置

    在linux系统中安装yum install iptables-services 然后 vi /etc/sysconfig/iptables # Generated by iptables-save ...

  9. Android平台云端打包证书使用说明

    原贴:https://ask.dcloud.net.cn/article/35985 Android平台云端打包证书使用说明 分类:HBuilderX 证书 Android 签名证书是一个应用的所有者 ...

  10. MFC加载大型osg模型

    MFC加载模型,发现打开 Navid 缓冲等选项后,加载大型模型的速度就快了很多. #include "stdafx.h" #include "OSGObject.h&q ...