存储节点部署示例环境,仅供参考

主机名 IP 系统
gfs01 10.10.10.13 CentOS 7.4.1708
gfs02 10.10.10.14 CentOS 7.4.1708

一、GlusterFS的安装

1.1 格式化磁盘、创建目录并挂载

# 查看可用磁盘
fdisk -l
# 分区并格式化
mkfs.xfs /dev/vdb1
mkdir -p /data
echo "/dev/vdb1 /data xfs defaults 1 2" >>/etc/fstab
# 挂载
mount -a

存储节点都需要执行如上操作。

# 确定/data挂载
df -h | grep data

1.3 安装启动glusterfs服务

yum -y install centos-release-gluster
yum -y install glusterfs-server
systemctl start glusterd.service
systemctl enable glusterd.service
systemctl status glusterd.service

1.4 配置信任池

仅在其中1个节点执行操作即可

[root@gfs01 ~]# gluster peer probe 10.10.10.14
peer probe: success.

在gfs02上验证

[root@gfs02 ~]# gluster peer status
Number of Peers: 1 Hostname: 10.10.10.13
Uuid: f88992e2-4a3f-4cbd-b79b-a5b7e28881dd
State: Peer in Cluster (Connected)

1.5 创建卷

# 存储节点都需执行
mkdir -p /data/glusterfs # 在第一个节点执行创建卷操作
gluster volume create data replica 2 10.10.10.14:/data/glusterfs 10.10.10.13:/data/glusterfs Replica 2 volumes are prone to split-brain. Use Arbiter or Replica 3 to avoid this. See: http://docs.gluster.org/en/latest/Administrator%20Guide/Split%20brain%20and%20ways%20to%20deal%20with%20it/.
Do you still want to continue?
(y/n) y
volume create: data: success: please start the volume to access data # 在gfs02 查看卷信息
[root@gfs02 ~]# gluster volume info Volume Name: data
Type: Replicate
Volume ID: 1c27e490-af0c-4794-af45-60e960c6eb47
Status: Created
Snapshot Count: 0
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: 10.10.10.14:/data/glusterfs
Brick2: 10.10.10.13:/data/glusterfs
Options Reconfigured:
transport.address-family: inet
nfs.disable: on
performance.client-io-threads: off # 启动卷
gluster volume start data

1.6 简单挂载测试

# 挂载
[root@gfs01 ~]# mount -t glusterfs 10.10.10.14:/data /mnt
[root@gfs02 ~]# mount -t glusterfs 10.10.10.13:/data /mnt # gfs02 写文件
touch /mnt/{1..10}.txt # gfs01 验证是否生成{1..10}.txt
ls /mnt/ | wc -l

到此完成GlusterFS的部署

二、通过ansible安装GlusterFS

# 下载源码
git clone https://github.com/goodrain/rainbond-glusterfs.git
cd rainbond-glusterfs
# 编辑 inventory/hosts 文件
all下为所有节点信息
gfscluster下为gfscluster server端(存储节点)
rainbondcluster下为gfscluster client端(即管理节点,计算节点)
# 执行安装
./setup.sh

需要注意disk_volume_device_1值为实际GlusterFS存储使用的磁盘(fdisk -l)

CentOS对接GlusterFS的更多相关文章

  1. k8s 对接glusterfs存储

    service 与 endpoint 是通过namespace相同,name相同,相互关联的 创建endpoint [root@k8s-master glusterfs]# cat glusterfs ...

  2. Ubuntu对接GlusterFS

    存储节点部署示例环境,仅供参考 主机名 IP 系统 gfs01 10.10.10.13 Ubuntu 16.04.3 LTS gfs02 10.10.10.14 Ubuntu 16.04.3 LTS ...

  3. CentOS 7 安装 GlusterFS

    CentOS 7 GlusterFS 环境说明: 3台机器安装 GlusterFS 组成一个集群. 使用 docker volume plugin GlusterFS 服务器: 10.6.0.140 ...

  4. [转帖]CentOS 7 安装 GlusterFS

    CentOS 7 安装 GlusterFS https://www.cnblogs.com/jicki/p/5801712.html 改天测试一下 我一直没有搞这一块呢.   CentOS 7 Glu ...

  5. 学习GlusterFS(九)

    环境说明: 3台机器安装 GlusterFS 组成一个集群. 使用 docker volume plugin GlusterFS 服务器: 10.6.0.140 10.6.0.192 10.6.0.1 ...

  6. CentOS 6 部署GlusterFS

    首先需要关闭CentOS的防火墙和selinux,否则glusterfs将可能无法正常工作. /etc/init.d/iptables status 会得到一系列信息,说明防火墙开着. /etc/in ...

  7. 【good】在CentOS 6.x上安装GlusterFS

    转发:http://quenywell.com/install-glusterfs-on-centos-6-x/ 本文主要介绍如何在CentOS 6.x上快速安装GlusterFS.GlusterFS ...

  8. 在CentOS 7上安装和使用GlusterFS

    GlusterFS aggregates various storage servers over Ethernet or Infiniband RDMA interconnect into one ...

  9. GlusterFS分布式文件系统部署及基本使用(CentOS 7.6)

    GlusterFS分布式文件系统部署及基本使用(CentOS 7.6) 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. Gluster File System 是一款自由软件,主要由 ...

随机推荐

  1. 2020 .NET 开发者峰会顺利在苏州落幕,相关数据很喜人以及线上直播回看汇总

    在2019年上海中国.NET开发者大会的基础上,2020年12月19-20日 继续以"开源.共享.创新" 为主题的第二届中国 .NET 开发者峰会(.NET Conf China ...

  2. mybatis实现MySQL数据库的增删改查

    环境: jdk1.8 mysql5.7 maven3.6.0 IDEA 什么是mybatis框架? MyBatis 是一款优秀的持久层框架, 它支持自定义 SQL.存储过程以及高级映射. MyBati ...

  3. MM-RFQ询价报价

    (1).询价报价单事务码:ME41/ME42/ME43 需要的主数据:采购组织.供应商.采购组,物料 (2)ME47:维护供应商的报价.可以用项目明细的条件对供应商的报价进行详细设置. (3)供应商价 ...

  4. ipython快捷键

    IPython Notebook有两种不同的键盘输入模式(编辑模式和命令模式). 编辑模式:允许你输入代码或者文本到一个单元格(cell这里我译作单元格)内,并且单元格外面有灰色的选中框(注:Jupy ...

  5. 关于HashSet

    HashSet存储数据原理: 当HashSet调用add方法时,有返回值,返回值是boolean类型,表示是否添加成功(如果对象不存在,则添加成功,否则添加失败) 但是,添加的过程并不是一个个去遍历去 ...

  6. maven方式使用jetty

    Jetty 是一个开源的servlet容器,它为基于Java的web容器,例如JSP和servlet提供运行环境.Jetty是使用Java语言编写的,它的API以一组JAR包的形式发布.开发人员可以将 ...

  7. HTML学习案例-仿慕课网网页制作(一)

    概述:仿制慕课网头部导航栏和分支导航栏的外观 考察知识点: 1.消除浮动的原因:如果最上面的块级元素不清楚浮动的话就会影响下面的块级元素的布局 对subnav块使用了float,结果subnav块飞到 ...

  8. Java GC --- Java堆内存

    Java堆是被所有线程共享的一块内存区域,所有对象实例和数组都在堆上进行内存分配.为了进行高效的垃圾回收,虚拟机把堆内存划分成: 1. 新生代(Young Generation): 由 Eden 与 ...

  9. ES6 class类 静态方法及类的继承

    一.class类 ES6之前都是定义函数以及函数的原型对象实现类型, 如果想要实现共享构造函数成员,可以用prototype来共享实现 ES6出现之后,使用class类的概念来实现原型的继承 二,静态 ...

  10. python函数----名称空间和作用域

    一 名称空间 名称空间即存放名字与对象映射/绑定关系的地方. 对于x=3,Python会申请内存空间存放对象3,然后将名字x与3的绑定关系存放于名称空间中,del x表示清除该绑定关系. ​在程序执行 ...