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

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. vue+springboot上传和下载附件功能

    https://blog.csdn.net/qq_35867245/article/details/84325385 上传附件(服务端代码) 第一步:在application.yml中配置附件要上传的 ...

  2. HttpLitener处理http请求和Websocket请求

    HttpLitener处理http请求和Websocket请求的案例具体步骤如下 1.新建控制台项目TestClientWebsocket 2.选择项目右键添加类HttpAndWebsocket,代码 ...

  3. 通过字节码分析this关键字以及异常表的作用

    1.创建MyTest3类 public class MyTest3 { public void test(){ try { InputStream is = new FileInputStream(& ...

  4. 人脸替换(FaceSwap)的一些思考

    本文链接:https://blog.csdn.net/cy1070779077/article/details/85224347人脸替换(FaceSwap)的一些思考 最一开始,我使用了openCV( ...

  5. shell - 拉取代码部署执行

    #!/bin/bash nodejs_path=/data/myserver/yihao01-node-js cd /data/myserver if [ -d "$nodejs_path& ...

  6. IDEA中使用Maven:通过模板项目来创建新工程(转)

    首先自己有一个很完善的项目,并想通过这个项目做一个Demo事例项目: 例子1 如下图,在idea的terminal中敲入命令: mvn archetype:create-from-project 1 ...

  7. C++17 std::shared_mutex的替代方案boost::shared_mutex

    C++17 std::shared_mutex的替代方案boost::shared_mutex C++17boost  std::shared_mutex http://en.cppreference ...

  8. LeetCode_219. Contains Duplicate II

    219. Contains Duplicate II Easy Given an array of integers and an integer k, find out whether there ...

  9. MySQL修改表名示例

    首先,我们新建一个名为test_table的表: drop table if exists test_table; create table test_table select TABLE_SCHEM ...

  10. 18点睛Spring4.1-Meta Annotation

    18.1 Meta Annotation 元注解:顾名思义,就是注解的注解 当我们某几个注解要在多个地方重复使用的时候,写起来比较麻烦,定义一个元注解可以包含多个注解的含义,从而简化代码 下面我们用& ...