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