nfs

6.k8s.存储Volume.PV.PVC

不问归期 提交于 2019-12-02 16:56:03
#Volume Volume 解决数据持久化和容器间共享数据 Kubernetes支持几十种类型的后端存储卷 # hostPath 挂载实例,挂载Node节点/tmp/test-volume目录到容器/test-pd #volume-test.yaml apiVersion: v1 kind: Pod metadata: name: volume-test spec: containers: - image: alivv/nginx:node name: volume-test volumeMounts: - mountPath: /test-pd name: test-volume volumes: - name: test-volume hostPath: path: /tmp/test-volume type: DirectoryOrCreate #node节点不存在则创建空目录 #创建pod kubectl create -f volume-test.yaml #查看pod所在node节点 kubectl get pod volume-test -o wide #在容器里创建文件 kubectl exec -it volume-test -- sh -c "date >/test-pd/txt" #删除pod kubectl delete -f volume-test

测试答案:

北城余情 提交于 2019-12-02 16:32:42
16. 当数据无法存储在存储目录中,需要分析的原因有几点? 第一个历程: 编写服务端配置文件 /data01/w 10.0.0.41(rw,sync,all_squash)   /data01/r 172.16.1.0/24(ro,async,no_all_squash) 第二个历程: 创建存储目录 mkdir /data01/{r,w} -p chown nfsnobody.nfsnobody /data01/{r,w} 第三个历程: 重启服务程序 systemctl reload nfs 第四个历程: 进行存储挂载操作 backup服务器 mkdir /w -p mount -t nfs 10.0.0.31:/data01/w /w web01服务器 mkdir /r -p mount -t nfs 172.16.1.31:/data01/r /r 说明: NFS存储服务规划目录存储结构时, 尽量不要有父级目录和子级目录关系 存储服务权限问题和什么有关 1) 存储服务配置文件参数 2) 存储服务目录权限有关 755 3) 存储服务目录权限继承 NFS存储服务规划目录存储结构时, 尽量不要有父级目录和子级目录关系 4) 存储客户端挂载参数 17. NFS服务部署过程中,rpcbind服务有什么作用?存在的价值? 在启动NFS服务的时候,会同时启动很多的端口!因为NFS功能

基于NFS共享存储实现KVM虚拟主机动态迁移

喜你入骨 提交于 2019-12-02 16:29:25
操作环境: 操作系统 IP地址 主机名 CentOS7.5 192.168.200.111 KVM01 CentOS7.5 192.168.200.112 KVM02 CentOS7.5 192.168.200.113 NFS 实验初始配置:所有主机关闭防火墙与selinux iptables -F systemctl stop firewalld setenforce 0 基于NFS共享存储实现KVM虚拟主机动态迁移 在KVM中可以将运行中的虚拟机从一个KVM主机迁移到另一个KVM主机中运行,而不需要任何停机时间。如果两个KVM主机都能够访问相同的存储池,那么实时迁移工作就很好了。要使存储池在KVM主机上都可访问,您需要使用NFS或GFS2文件系统(集群文件系统)。在本例中,我使用NFS文件系统来存储VM映像文件。在迁移过程中,VM的“内存”内容将被复制到目标KVM主机,而在某个时间点上,将发生迁移VM。注意,当您在KVM主机上共享文件系统时,将不会在网络上传输VM的磁盘映像,因为两个KVM主机都可以访问相同的存储池。 迁移介绍 :迁移是指将在KVM上运行的虚拟机系统转移到其他物理机的KVM上运行 静态迁移:在虚拟机关机的情况迁移 动态迁移:在虚拟机上服务正常运行的情况下迁移,要基于共享存储 动态迁移特点: 不会对最终用户造成明显影响 仅有非常短暂的停机时间 动态迁移拓扑图 1、

k8s集群监控 cadvisor/exporter+prometheus+grafana

余生长醉 提交于 2019-12-02 16:07:57
### k8s监控处理 ### 1.cadvisor/exporter+prometheus+grafana 安装 #### 1.1 配置nfs安装 ```shell ubuntu: nfs 服务器 apt-get install nfs-kernel-server # 创建一个/data/pvdata的共享目录 mkdir /data/pvdata centos: chown nfsnobody:nfsnobody /data/pvdata ubuntu: chown chown nobody:nogroup /data/pvdata vim /etc/exports #ip填写自己所支持IP范围 /data/pvdata xxx.xxx.xxx.0/24(rw,async,all_squash) exportfs -rv #显示 exporting xxx.xxx.xxx.0/24:/data/pvdata #需要在prometheus服务所在的节点安装 #nfs 客户端 apt-get update apt-get install nfs-common 在其他节点上测试nfs是否可用,挂载命令: mkdir /kubernetes mount nfs服务器的ip:/data/pvdata /kubernetes ``` #### 1.2 prometheus配置 ``

df执行hang住

谁说我不能喝 提交于 2019-12-02 14:54:27
一、现象 在linux操作系统中,执行df -h命令,后hang住 二、思路 排查是否存在Nfs问题,无法正常挂载nfs路径导致的问题。 三、解决过程 3.1 cat /etc/rc.local #mount 10.8.4.11:/dbbak/yt3wdb /oracle/dbbak2 mount -t nfs -o rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp 10.8.5.188:/backup/oracle/10.8.2.40_yt3wdb /oracle/ dbbak 如上,可以发现,存在两个nfs记录信息,一个正在使用,另一个已被注释 3.2 查询 根据上述信息,cd观察两个路径是否有效[root@yt3wdb dbbak2]# cd /oracle/dbbak [root@yt3wdb dbbak]# ls archivelog_copy backup rman#cd /oracle/dbbak2 路径,会话hang住,问题找到了,问题原因是 10.8.4.11作为nfs service端,共享的路径,在本地无法正常读 3.3 问题处理 #cat /proc/mounts10.8.5.188:/backup/oracle/10.8.2.40_yt3wdb /oracle/dbbak nfs

Vagrant error: NFS is reporting that your exports file is invalid

吃可爱长大的小学妹 提交于 2019-12-02 13:55:32
I am trying to set up the Discourse development environment using these instructions . However when I run Vagrant I get the error: NFS is reporting that your exports file is invalid. Vagrant does this check before making any changes to the file. Please correct the issues below and execute "vagrant reload": Can't open /etc/exports I checked, and I don't have an etc/exports folder, so I created one and ran vagrant reload . This got me: /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/plugins/hosts/bsd/host.rb:146:in read': Is a directory - /etc/exports (Errno::EISDIR) from /Applications

Force unmount of NFS-mounted directory [closed]

徘徊边缘 提交于 2019-12-02 13:47:33
I have an NFS-mounted directory on a Linux machine that has hung. I've tried to force an unmount, but it doesn't seem to work: $ umount -f /mnt/data $ umount2: Device or resource busy $ umount: /mnt/data: device is busy If I type " mount ", it appears that the directory is no longer mounted, but it hangs if I do " ls /mnt/data ", and if I try to remove the mountpoint, I get: $ rmdir /mnt/data rmdir: /mnt/data: Device or resource busy Is there anything I can do other than reboot the machine? tessein You might try a lazy unmount: umount -l Daniel Papasian If the NFS server disappeared and you

NFS PersistentVolume(11)

余生颓废 提交于 2019-12-02 11:54:17
一、部署nfs服务端 1、 需在 k8s-master 节点上搭建了一个 NFS 服务器,目录为 /nfsdata: yum install -y nfs-utils rpcbind vim /etc/exports /nfsdata *(rw,no_root_squash,no_all_squash,sync) 2、保存配置文件后,执行如下操作:   在服务端创建对应的目录和赋予权限: mkdir /nfsdata chmod 777 /nfsdata 3、 启动rpcbind和nfs服务: systemctl start rpcbind && systemctl enable rpcbind systemctl start nfs && systemctl enable nfs 4、 每个node安装nfs工具 yum install -y nfs-utils 5、 每个node查询NFS服务器 showmount -e nfs-ip 二、 NFS PersistentVolume 来源: https://www.cnblogs.com/renyz/p/11743874.html

cinder nfs配置操作

天涯浪子 提交于 2019-12-02 11:29:45
cinder nfs配置操作 #####重启计算机服务 ###cinder 节点操作 yum install -y nfs-utils rpcbind mkdir -p /data/nfs echo ' /data/nfs *(rw,no_root_squash) ' >>/etc/exports #all_squash:将远程访问的所有普通用户及所属组都映射为匿名用户或用户组; #no_all_squash:访问用户先与本机用户匹配,匹配失败后再映射为匿名用户或用户组; #root_squash:将root用户及所属组都映射为匿名用户或用户组; #no_root_squash:来访的root用户保持root帐号权限; systemctl enable rpcbind nfs systemctl restart rpcbind nfs systemctl reload rpcbind nfs echo '[nfs] volume_driver = cinder.volume.drivers.nfs.NfsDriver nfs_shares_config = /etc/cinder/nfs_shares nfs_mount_point_base = $state_path/mnt volume_backend_name=nfs_volumes ' >>/etc/cinder

NFS项目实践

痞子三分冷 提交于 2019-12-02 10:53:23
1.NFS共享的怒名用户为www. 使得客户端上传的图片都是www用户,而不是匿名用户nfsnobody。 web01 backup客户端实现开机自动挂载到nfs 2.NFS下面共享/backup ,允许web01 backup客户端(/backup)可读写 3.web01上传图片,backup上可以删除web01上传的图片 4.NFS下面共享/data1,允许web01 backup客户端10网段 只读(data01) 5.实现开机自动挂载! 1.nfs01, 以及所有客户端: useradd -u 1111 www 2.特殊配置 tail -2 /etc/exports /data 172.16.1.0/24(rw,sync,all_squash,anonuid=1111,anongid=1111) /data1 10.0.0.0/24(ro) 3.该目录权限 chown -R www.www /data chown -R www.www /data1 4.重启 systemctl reload nfs 客户端: 卸载重新挂载 mount -t nfs 172.16.1.31:/data /data mount -t nfs 10.0.0.31:/data1 /data1 来源: https://www.cnblogs.com/zhanghongqi/p/11742248