一、部署gluster集群

1、使用daemon-set的方式进行部署,注意数据目录根据环境自行更改,这里是在每个服务器上创建一个目录/data/glusterfs做为glusterfs的实际存储目录

# glusterfs
---
apiVersion: apps/v1
kind: DaemonSet
metadata:name: glusterfslabels:glusterfs: daemonsetannotations:description: GlusterFS DaemonSettags: glusterfs
spec:template:metadata:name: glusterfslabels:glusterfs-node: podspec:nodeSelector:storagenode: glusterfshostNetwork: truecontainers:- image: gluster/gluster-centos:latestname: glusterfsvolumeMounts:#数据目录挂载点- name: glusterfs-datamountPath: "/data"- name: glusterfs-heketimountPath: "/var/lib/heketi"- name: glusterfs-runmountPath: "/run"- name: glusterfs-lvmmountPath: "/run/lvm"- name: glusterfs-etcmountPath: "/etc/glusterfs"- name: glusterfs-logsmountPath: "/var/log/glusterfs"- name: glusterfs-configmountPath: "/var/lib/glusterd"- name: glusterfs-devmountPath: "/dev"- name: glusterfs-miscmountPath: "/var/lib/misc/glusterfsd"- name: glusterfs-cgroupmountPath: "/sys/fs/cgroup"readOnly: true- name: glusterfs-sslmountPath: "/etc/ssl"readOnly: truesecurityContext:capabilities: {}privileged: truereadinessProbe:timeoutSeconds: 3initialDelaySeconds: 60exec:command:- "/bin/bash"- "-c"- systemctl status glusterd.servicelivenessProbe:timeoutSeconds: 3initialDelaySeconds: 60exec:command:- "/bin/bash"- "-c"- systemctl status glusterd.servicevolumes:- name: glusterfs-heketihostPath:path: "/var/lib/heketi"- name: glusterfs-run- name: glusterfs-lvmhostPath:path: "/run/lvm"- name: glusterfs-etchostPath:path: "/etc/glusterfs"- name: glusterfs-logshostPath:path: "/var/log/glusterfs"- name: glusterfs-confighostPath:path: "/var/lib/glusterd"- name: glusterfs-devhostPath:path: "/dev"- name: glusterfs-mischostPath:path: "/var/lib/misc/glusterfsd"- name: glusterfs-cgrouphostPath:path: "/sys/fs/cgroup"- name: glusterfs-sslhostPath:path: "/etc/ssl"#这是服务器上的目录,可自行修改- name: glusterfs-datahostPath:path: "/data/glusterfs"

2、这里是使用主机模式进行部署的,可以在服务器上检查24007端口是否正常启动,服务正常启动后,进入到容器中向集群中添加节点

有几个节点就添加几个节点

gluster peer probe  1.2.3.4
peer probe: success

查看状态

gluster peer status

创建卷,我这里服务器上没有额外的数据盘,就使用了一个/data目录进行创建,生产环境中建议挂载数据盘。

分布式复制模式(组合型), 最少需要4台服务器才能创建。最后边有一个force参数,不加会报错

gluster volume create data-volume replica 2   10.102.23.41:/data 10.102.23.44:/data 10.102.23.42:/data 10.102.23.43:/data  10.102.23.44:/data 10.102.23.4:/data 10.102.23.45:/data  10.102.23.46:/data  force

启动创建的卷

gluster volume start data-volume

查看创建的卷

gluster volume info

查看分布式卷的状态

gluster volume status

3、nfs-ganesha环境搭建

yum -y install centos-release-gluster6

yum -y install nfs-ganesha nfs-ganesha-gluster

[root@admin-node ~]# vim /etc/ganesha/ganesha.conf.....................................EXPORT{## Export Id (mandatory, each EXPORT must have a unique Export_Id)#Export_Id = 12345;Export_Id = 10;## Exported path (mandatory)#Path = /nonexistant;Path = /data01;## Pseudo Path (required for NFSv4 or if mount_path_pseudo = true)#Pseudo = /nonexistant;Pseudo = /data01; #客户端通过nfs挂载的根目录## Restrict the protocols that may use this export. This cannot allow## access that is denied in NFS_CORE_PARAM.#Protocols = 3,4;Protocols = 4; #客户端nfs挂载的版本## Access type for clients. Default is None, so some access must be## given. It can be here, in the EXPORT_DEFAULTS, or in a CLIENT block#Access_Type = RW;Access_Type = RW; #权限问题## Whether to squash various users.#Squash = root_squash;Squash = No_root_squash; #root降级## Allowed security types for this export#Sectype = sys,krb5,krb5i,krb5p;Sectype = sys; #类型## Exporting FSAL#FSAL {#Name = VFS;#}FSAL {Name = GLUSTER;hostname = "10.102.23.44"; #glusterfs管理节点IPvolume = "data-volume"; #glusterfs卷名}}...................[root@admin-node ~]# systemctl restart nfs-ganesha[root@admin-node ~]# systemctl enable nfs-ganesha[root@admin-node ~]# showmount -e 10.102.23.44Export list for 10.102.23.44: #nfs-ganesha搭建成功

4、客户端挂载

以glusterfs方式挂载:

mkdir /logs
mount -t glusterfs 10.102.23.44:data-volume /logs

以NFS方式进行挂载

yum -y install nfs-utils rpcbindsystemctl start rpcbindsystemctl enable rpcbindmkdir /home/dwweiyinwen/logs/mount -t nfs -o vers=4,proto=tcp,port=2049 10.102.23.44:/data01 /home/dwweiyinwen/logs/

k8s搭建gluster集群以及安装nfs-ganesha相关推荐

  1. [Mac/Minikube] 使用K8s搭建ZooKeeper集群

    前言 相关的教程很多, 但是也很乱. 自己整理一篇. 使用过程中还遇到一些问题, 顺手记录一些. 创建PV 一般的PV都是创建在集群, 使用NFS共享管理的. 但是本次实验只有一台机器. 所以简单一点 ...

  2. 【Linux云计算架构:第四阶段-Linux虚拟化-私有云-docker】第12章—— 搭建 Kubernetes 的 web 管理界面和基于 k8s 搭建+redis 集群案例

    13.1 部署 Kubernetes Dashboard web 界面 13.1.1 创建 dashboard-deployment.yaml deployment 配置文件 13.1.2 创建 da ...

  3. k8s搭建 rabbitmq集群

    工具 版本 k8s 1.19 rabbitmq 3.7.8 rabbitmq镜像下载-CSDN mq镜像下载位置 链接:https://pan.baidu.com/s/1tJ1xxfA174Kjj4C ...

  4. 电商详情页缓存架构(二)环境搭建(搭建CentOS 集群、安装redis及启动方案)

    在虚拟机中安装 CentOS 安装 JDK 和 Perl 安装 CentOS 集群 配置 4 台 CentOS 为 ssh 免密码互相通信 安装单机版 redis redis 的生产环境启动方案 re ...

  5. CentOS 7 搭建 Ceph 集群(nautilus 版本)

    推荐阅读 Helm3(K8S 资源对象管理工具)视频教程:https://edu.csdn.net/course/detail/32506 Helm3(K8S 资源对象管理工具)博客专栏:https: ...

  6. OSX上摆脱vagrant搭建CoreOS集群

    一般我们在OSX下使用vagrant+virtualbox部署虚拟机集群做开发测试.现在我们还可以有更轻量的选择--xhyve.xhyve是FreeBSD 下的虚拟技术 bhyve (The BSD ...

  7. Hadoop(二)搭建Hadoop集群

    在了解Hadoo基础之后,借助于docker快速实现虚拟化,搭建Hadoop集群,进一步了解Hadoop,实地测试,实地操作,更进一步的了解Hadoop. 首先需要了解Hadoop的各个模块概念已经功 ...

  8. K8s上使用rook搭建Ceph集群

    目录 准备工作 一.安装kubectl 二:win10 安装Docker Desktop for Windows(非必须) 三.Harbor 知识补充: 1.Ceph mgr和mon 2:Ceph 中 ...

  9. Hadoop-2.8.0集群搭建、hadoop源码编译和安装、host配置、ssh免密登录、hadoop配置文件中的参数配置参数总结、hadoop集群测试,安装过程中的常见错误

    25. 集群搭建 25.1 HADOOP集群搭建 25.1.1集群简介 HADOOP集群具体来说包含两个集群:HDFS集群和YARN集群,两者逻辑上分离,但物理上常在一起 HDFS集群: 负责海量数据 ...

最新文章

  1. ajax 阻止默认提交,jQuery验证插件:在对ajax调用servlet时,submitHandler不会阻止默认提交-返回false无效...
  2. 1141. PAT Ranking of Institutions (25)
  3. 经常误提交.DS_Store文件怎么办?Git全局排除配置了解一下!
  4. js中的true,false盲点
  5. Skpi List跳表
  6. linux 服务器 iptables 防止arp病毒,Linux下防御ARP病毒攻击
  7. java重要基础知识点_java基础知识点整理
  8. ADO.NET、ODP.NET、Linq to SQL、ADO.NET Entity 、NHibernate在Oracle下的性能比较
  9. 美团面试:如何设计一个注册中心?
  10. Flutter进阶—铅刀一割
  11. 研究员发现70个web缓存投毒漏洞,获奖4万美元
  12. Spring中的AOP(8)
  13. linux:账号管理
  14. phpcms手机端去掉index.php,如何取消phpcms v9手机门户中文章详情页模板中内容被自动分页...
  15. 【xinfanqie】熟知针式与喷墨打印机之间的区别
  16. 如何收割暑期实习offer
  17. 2021-03-06
  18. 小程序人脸核验功能实现-边读边录(一)
  19. 三阶齐次线性方程求通解_三阶常系数线性微分方程特解的简单求法
  20. ACL中的permit/deny与traffic policy中behavior的permit/deny之间是什么关系?

热门文章

  1. PASCAL VOC2012数据集
  2. oracle数据库的安装及配置方法
  3. 卷积和反卷积(deconv)
  4. PE重装系统,U盘装装系统,你学会了吗
  5. 计算机专业jsp项目,可练手
  6. python中字典的循环遍历的方式
  7. 字符串转换成数字的三种方法 js
  8. 问题解决: ValueError: Can't Handle mix of binary and continuous
  9. 公安局计算机岗位应知应会综合基础知识,事业单位考试计算机综合知识基础知识真题...
  10. 报错原因高的地图调用mapView.onDestroy() 崩溃问题