GlusterFS 安装 on centos7
本文演示如何在CentOS7上安装,配置和使用GlusterFS。
1 准备工作
1.1 基础设施
| 编号 | IP | OS | 主机名 | 角色 | 说明 |
|---|---|---|---|---|---|
| A | 192.168.1.101 | CentOS7.4 | ddc_node01 | GFS Client | Gluster FS客户端节点 |
| B | 192.168.1.102 | CentOS7.4 | ddc_node02 | GFS Client | Gluster FS客户端节点 |
| C | 192.168.1.103 | CentOS7.4 | ddc_node03 | GFS Client | Gluster FS客户端节点 |
| D | 192.168.1.104 | CentOS7.4 | ddc_node04 | GFS Server Master | Gluster FS服务器主节点 |
| E | 192.168.1.105 | CentOS7.4 | ddc_node05 | GFS Server Slave | Gluster FS服务器从节点 |
1.2 关闭防火墙
$ systemctl stop firewalld.service && systemctl disable firewalld.service
1.3 关闭selinux
$ vi /etc/selinux/config
# 修改SELINUX=disabled
1.4 时间同步
保证时区和时间都要一致。
1.5 配置hosts文件
如果安装配置过程中要使用主机名,就需要配置每个节点的hosts文件。
2 安装Gluster FS Server
2.1 在D,E节点上安装Gluster FS Server
$ yum install -y centos-release-gluster
$ yum install -y glusterfs glusterfs-server
$ yum install -y glusterfs-fuse glusterfs-rdma
2.2 启动 gluster FS Server并设置开机启动
$ systemctl start glusterd.service && systemctl enable glusterd.service
3 配置Gluster FS Server集群
3.1 新节点加入集群
在GFS Server Maseter节点(192.168.1.104)上执行命令:
$ gluster peer probe ddc_node05 # 在Master节点上将Slave节点加入到集群中。
3.2 从集群中删除节点
在GFS Server Maseter节点(192.168.1.104)上执行命令:
$ gluster peer detach 192.168.1.105
可以从任意GFS Server节点上删除集群中的其它节点,但不能删除执行命令时的当前节点。
3.3 查看集群状态
在GFS Server任意节点上执行命令:
$ gluster peer status
会显示当前集群的slave节点数量:
Number of Peers: 1
4 配置GFS Volume
4.1 在所有GFS Server节点上创建数据存储目录
$ mkdir -p /data/gluster/app1-mysql
4.2 创建GFS volume
在任意GFS Server节点上执行命令:
$ gluster volume create app1-mysql-vol replica 2 A:/data/gluster/app1-mysql B:/data/gluster/app1-mysql force
创建成功后会显示:
volume create: mysql-vol: success: please start the volume to access data
4.3 启动 Volume:
$ gluster volume start app1-mysql-vol
启动成功后会显示
volume start: app1-mysql-vol: success
4.4 查看 Volume 状态
$ gluster volume info
会显示当前所有volume的信息:
Volume Name: app1-mysql-vol
Type: Replicate
Volume ID: e539ff3b-2278-4f3f-a594-1f101eabbf1e
Status: Created
Number of Bricks: 1 x 2 = 2
......
Options Reconfigured:
performance.readdir-ahead: on
4.5 删除 Volume
$ gluster volume stop app1-mysql-vol # 停止名为app1-mysql-vol的GFS Volume
$ gluster volume delete app1-mysql-vol # 删除名为app1-mysql-vol的GFS Volume
5 配置GFS Client
GFS 客户端节点必须能连通GFS服务器节点
5.1 安装客户端
$ yum install -y glusterfs glusterfs-fuse
5.2 将客户端目录挂载到GFS Volume
a, 在GFS Client节点上(例如192.168.1.102),创建一个本地目录:
$ mkdir -p /var/data/app1-mysql
b, 将本地目录挂载到GFS Volume:
$ mount.glusterfs 192.168.1.104:/app1-mysql-vol /var/data/app1-mysql
5.3 查看挂载情况
在GFS客户端节点上执行命令:
$ df -h
会显示当前挂载信息
文件系统 容量 已用 可用 已用%挂载点
/dev/mapper/ddc_node02-root 50G 1.2G50G 12% /
devtmpfs 32G 0 3.9G0% /dev
tmpfs3.9G0 3.9G0% /dev/shm
tmpfs3.9G 13M 3.9G1% /run
tmpfs3.9G0 3.9G0% /sys/fs/cgroup
......
tmpfs 783M 0 783M0% /run/user/1002
192.168.1.104:app1-mysql-vol 50G 0 3.9G 1% /var/data/app1-mysql # 挂载到GFS Volume的本地目录
5.4 取消挂载
$ umount /var/data/app1-mysql
以上介绍了最基本的GFS安装配置过程,更多GFS使用方法和优化方式,后续会继续整理。
GlusterFS 安装 on centos7的更多相关文章
- GlusterFS 安装
一.简介 GlusterFS 是近年兴起的一个高性能开源分布式文件系统,其目标是全局命名空间.分布式前端的高性能文件系统,目前已被 RedHat 看中,GlusterFS 具有高扩展.高可性.高性能. ...
- glusterfs安装配置
目标: 原有的k8s的集群磁盘容量不够,数据迁移无法完成,数据迁移是物理机无法由于采购磁盘流程过程,申请虚拟机搭建glusterfs做分布式存储 磁盘规划: # 查看盘符 $ lsblk # 然后创建 ...
- 使用Xshell5连接虚拟机VMware中安装的CentOS7系统
使用Xshell5连接VMware中安装的CentOS7系统 准备材料 Xshell 下载地址 VMware Workstation 12 Pro 下载地址 CentOS 7 64位系统 下载地址 安 ...
- NAT 模式下虚拟机安装的centos7 ping主机显示connect: Network is unreachable
在虚拟机下安装的centos7使用的网络是NAT模式,安装成功后ping主机地址显示 Network is unreachable 解决方案: 1)使用ifconfig命令查看网卡信息 2)进入/et ...
- CentOS 6.5下PXE+Kickstart无人值守安装操作系统centos7.3
CentOS 6.5下PXE+Kickstart无人值守安装操作系统centos7.3 一.简介 1.1 什么是PXE PXE(Pre-boot Execution Environment,预启动执行 ...
- 2.GlusterFS 安装配置
2.1 GlusterFS 安装前的准备 服务器规划:(vmware 实验) 操作系统 IP 主机名 数据盘(2 块) CentOS 6.8 x86_64 10.1.0.151 mystorage1 ...
- 【Nginx安装】CentOS7安装Nginx及配置
[Nginx安装]CentOS7安装Nginx及配置 2018年03月05日 11:07:21 阅读数:7073 Nginx是一款轻量级的网页服务器.反向代理服务器.相较于Apache.lighttp ...
- cacti1.2.7安装教程+Centos7|Cacti1.2.x+Centos7+Spine1.2.7零基础手把手教学
cacti1.2.7安装教程+Centos7|Cacti1.2.x+Centos7+Spine1.2.7零基础手把手教学 教程地址: 链接:http://note.youdao.com/notesha ...
- 用xshell连接VMware虚拟机中安装的Centos7系统
首先要保证你安装的Centos7系统的网路适配器使用的桥接模式,这个模式允许你安装再虚拟机中的Centos系统有一个自己的ip地址. 然后再虚拟机中登录你的Centos系统,用ip addr命令查看你 ...
随机推荐
- Velocity CheckingForNull
Q: I want to check for null, something like this: #if ($car.fuel == null) A: There are several appro ...
- [WebKit内核] JavaScriptCore深度解析--基础篇(一)字节码生成及语法树的构建
看到HorkeyChen写的文章<[WebKit] JavaScriptCore解析--基础篇(三)从脚本代码到JIT编译的代码实现>,写的很好,深受启发.想补充一些Horkey没有写到的 ...
- SpringCloud实战10-Sleuth
Spring-Cloud-Sleuth是Spring Cloud的组成部分之一,为SpringCloud应用实现了一种分布式追踪解决方案,其兼容了Zipkin, HTrace和log-based追踪, ...
- python3 对拉勾数据进行可视化分析
上回说到我们如何如何把拉勾的数据抓取下来的,既然获取了数据,就别放着不动,把它拿出来分析一下,看看这些数据里面都包含了什么信息.(本次博客源码地址:https://github.com/MaxLyu/ ...
- JS中如何理解浮点数?
本文由云+社区发表 相信大家在平常的 JavaScript 开发中,都有遇到过浮点数运算精度误差的问题,比如 console.log(0.1+0.2===0.3)// false.在 JavaScri ...
- WebService SOAP
<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http:// ...
- QT 设置有效绘图区域
void QPainter::setClipRect(int x, int y, int width, int height, Qt::ClipOperation operation = Qt::Re ...
- mybatis是如何防止SQL注入的
mybatis是如何防止SQL注入的 1.首先看一下下面两个sql语句的区别: <select id="selectByNameAndPassword" parameterT ...
- IIS配置文件上传大小限制
2018-08-28 IIS配置文件上传大小限制 问题:上传文件过大导致上传不了,直接在webconfig里做以下配置会导致程序出错,这个需要在IIS里配置 <system.web> &l ...
- c# 项目之间循环引用vs弹窗提醒
circular dependencies in projects' graph ! Projects in cycle are:ProjectImp(Name:FrameWork.Entity,Pl ...