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

主机名 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. 解决Yii ActiveForm监听submit触发2次submit

    今天用yii框架的ActiveForm需要一个奇怪的问题,点击表单提交时会触发两次submit 产生问题的原因: form挂了2次submit事件,一次是yii activeform自带的,一次是我写 ...

  2. 第 16 章 【硬核!】 垃圾回收相关 GC细讲

    第 16 章 垃圾回收相关概念 1.System.gc() 的理解 1.1.System.gc() 方法 System.gc() 方法 在默认情况下,通过System.gc()者Runtime.get ...

  3. #2020征文-手机#深鸿会深大小组:HarmonyOS手机游戏—数字华容道

    目录: 前言 概述 正文 创建项目 实现初始界面布局 实现数字的随机打乱 实现滑动或点击调换数字 实现游戏成功界面 结语 源码包 前言 12月16号HarmonyOS2.0手机开发者Beta版已经发布 ...

  4. Python进阶——为什么GIL让多线程变得如此鸡肋?

    本文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,如有问题请及时联系我们以作处理 做 Python 开发时,想必你肯定听过 GIL,它经常被 Python 程序员吐槽,说 Pytho ...

  5. Python编程基础:循环结构

    一.为什么要用循环 现在有一个任务,要求你输出一百遍"好好学习,天天向上!",想一想,你会怎么做? (一)老老实实的笨方法 print("第1遍写:好好学习,天天向上!& ...

  6. js中Tabs插件打开的标签页过多自动关闭

    js方法 function addTab(ResourceID, ResourceName, Url) { if (Url != "" && Url != null ...

  7. python的常量与变量

    1.Python属于强类型编程语言,Python解释器会根据赋值或运算来自动判断变量的类型.Python还是一种动态类型语言,变量的类型也是可以随时变化的. >>> x=3 > ...

  8. Mysql Workbench查询成功但是不显示

    先来看看MysqlWorkbench的一个bug: 当执行SQL语句成后显示结果在屏幕下方,但是当你拖动结果拦边框往下移动到与Action Output时两者就会合并,再也拖不上来!!!! 回归正题: ...

  9. Scrum转型(二) Scrum的角色

    1.1 ScurmMaster 作为Scrum流程的捍卫者和布道者,ScrumMaster在Scrum团队中起到至关重要的作用,他们确保团队使用正确的流程,确保团队正确地召开各种会议,他们训练团队的敏 ...

  10. Inno Step软件安装包制作教程

    Inno setup制作软件安装包教程 1,Inno Setup介绍 Inno Setup 是一个免费的安装制作软件,小巧.简便.精美是其最大特点,支持pascal脚本,能快速制作出标准Windows ...