glusterFS安装维护文档
# 安装 glusterfs 组件
yum install -y glusterfs glusterfs-server glusterfs-fuse glusterfs-rdma glusterfs-geo-replication glusterfs-devel
## 创建 glusterfs 目录
mkdir /data/glusterd
## 修改 glusterd 目录
$ sed -i 's/var\/lib/export/g' /etc/glusterfs/glusterd.vol
# 启动 glusterfs,设置开机启动,查看状态
systemctl start glusterd.service
systemctl enable glusterd.service
systemctl status glusterd.service
配置 glusterfs
[root@node1 glusterd]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
:: localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.20.171 master1 etcd1
192.168.20.172 master2 etcd2
192.168.20.173 master3 etcd3
192.168.20.174 node1
192.168.20.175 node2
192.168.20.176 node3
192.168.20.177 node4
192.168.20.178 node5
# 添加节点到 集群, 执行操作的本机不需要probe 本机执行[root@node1 ~]#
gluster peer probe node2
gluster peer probe node3
gluster peer probe node4
gluster peer probe node5
查看集群状态
[root@node1 glusterd]# gluster peer status
Number of Peers: Hostname: node2
Uuid: 58fe4710--4f18-8ae7-92d0130efbb7
State: Peer in Cluster (Connected) Hostname: node3
Uuid: af0985bd-2f85--9ac6-5712cd35b148
State: Peer in Cluster (Connected) Hostname: node4
Uuid: 917cb471--48b5-95ad-454395f3f1f4
State: Peer in Cluster (Connected) Hostname: node5
Uuid: a73078df-13a5-4b2c-b3bb-9a63f25f77fa
State: Peer in Cluster (Connected)
创建存储目录mkdir /export/gfs_data
配置 volume
GlusterFS中的volume的模式有很多中,包括以下几种:
- 分布卷(默认模式):即DHT, 也叫 分布卷: 将文件已hash算法随机分布到 一台服务器节点中存储。
- 复制模式:即AFR, 创建volume 时带 replica x 数量: 将文件复制到 replica x 个节点中。
- 条带模式:即Striped, 创建volume 时带 stripe x 数量: 将文件切割成数据块,分别存储到 stripe x 个节点中 ( 类似raid 0 )。
- 分布式条带模式:最少需要4台服务器才能创建。 创建volume 时 stripe 2 server = 4 个节点: 是DHT 与 Striped 的组合型。
- 分布式复制模式:最少需要4台服务器才能创建。 创建volume 时 replica 2 server = 4 个节点:是DHT 与 AFR 的组合型。
- 条带复制卷模式:最少需要4台服务器才能创建。 创建volume 时 stripe 2 replica 2 server = 4 个节点: 是 Striped 与 AFR 的组合型。
- 三种模式混合: 至少需要8台 服务器才能创建。 stripe 2 replica 2 , 每4个节点 组成一个 组。
创建分布式卷
gluster volume create senyintvolume stripe replica transport tcp node1:/export/gfs_data/ node2:/export/gfs_data/ node3:/export/gfs_data/ node4:/export/gfs_data/ node5:/export/gfs_data/ node1:/data/gfs_data/ node2:/data/gfs_data/ node3:/data/gfs_data/ force
查看卷
[root@node1 glusterd]# gluster volume info Volume Name: senyintvolume
Type: Distributed-Striped-Replicate
Volume ID: d11a39c5-65c8-415a-ac28-a698554a2b77
Status: Created
Snapshot Count:
Number of Bricks: x x =
Transport-type: tcp
Bricks:
Brick1: node1:/export/gfs_data
Brick2: node2:/export/gfs_data
Brick3: node3:/export/gfs_data
Brick4: node4:/export/gfs_data
Brick5: node5:/export/gfs_data
Brick6: node1:/data/gfs_data
Brick7: node2:/data/gfs_data
Brick8: node3:/data/gfs_data
Options Reconfigured:
transport.address-family: inet
nfs.disable: on
performance.client-io-threads: off
 启动 分布卷gluster volume start senyintvolume
再次查看
[root@node1 glusterd]# gluster volume info Volume Name: senyintvolume
Type: Distributed-Striped-Replicate
Volume ID: d11a39c5-65c8-415a-ac28-a698554a2b77
Status: Started
Snapshot Count:
Number of Bricks: x x =
Transport-type: tcp
Bricks:
Brick1: node1:/export/gfs_data
Brick2: node2:/export/gfs_data
Brick3: node3:/export/gfs_data
Brick4: node4:/export/gfs_data
Brick5: node5:/export/gfs_data
Brick6: node1:/data/gfs_data
Brick7: node2:/data/gfs_data
Brick8: node3:/data/gfs_data
Options Reconfigured:
transport.address-family: inet
nfs.disable: on
performance.client-io-threads: off
Glusterfs调优
# 设置 cache 大小, 默认32MB
$ gluster volume set senyintvolume performance.cache-size 4GB # 设置 io 线程, 太大会导致进程崩溃
$ gluster volume set senyintvolume performance.io-thread-count # 设置 网络检测时间, 默认42s
$ gluster volume set senyintvolume network.ping-timeout # 设置 写缓冲区的大小, 默认1M
$ gluster volume set senyintvolume performance.write-behind-window-size 1024MB # 开启 指定 volume 的配额,不使用
# gluster volume quota k8s-volume enable
# 限制 指定 volume 的配额,不使用
# gluster volume quota k8s-volume limit-usage / 1TB
挂载使用
master1: yum install glusterfs-client
mount -t glusterfs node1:/senyintvolume /data//
GlusterFS 几种volume 模式说明:
一、 默认模式,既DHT, 也叫 分布卷: 将文件已hash算法随机分布到 一台服务器节点中存储。
gluster volume create test-volume server1:/exp1 server2:/exp2

二、 复制模式,既AFR, 创建volume 时带 replica x 数量: 将文件复制到 replica x 个节点中。
gluster volume create test-volume replica 2 transport tcp server1:/exp1 server2:/exp2

三、 条带模式,既Striped, 创建volume 时带 stripe x 数量: 将文件切割成数据块,分别存储到 stripe x 个节点中 ( 类似raid 0 )。
gluster volume create test-volume stripe 2 transport tcp server1:/exp1 server2:/exp2

四、 分布式条带模式(组合型),最少需要4台服务器才能创建。 创建volume 时 stripe 2 server = 4 个节点: 是DHT 与 Striped 的组合型。
gluster volume create test-volume stripe 2 transport tcp server1:/exp1 server2:/exp2 server3:/exp3 server4:/exp4

五、 分布式复制模式(组合型), 最少需要4台服务器才能创建。 创建volume 时 replica 2 server = 4 个节点:是DHT 与 AFR 的组合型。
gluster volume create test-volume replica 2 transport tcp server1:/exp1 server2:/exp2 server3:/exp3 server4:/exp4

六、 条带复制卷模式(组合型), 最少需要4台服务器才能创建。 创建volume 时 stripe 2 replica 2 server = 4 个节点: 是 Striped 与 AFR 的组合型。
gluster volume create test-volume stripe 2 replica 2 transport tcp server1:/exp1 server2:/exp2 server3:/exp3 server4:/exp4

七、 三种模式混合, 至少需要8台 服务器才能创建。 stripe 2 replica 2 , 每4个节点 组成一个 组。
gluster volume create test-volume stripe 2 replica 2 transport tcp server1:/exp1 server2:/exp2 server3:/exp3 server4:/exp4 server5:/exp5 server6:/exp6 server7:/exp7 server8:/exp8

glusterFS安装维护文档的更多相关文章
- C#给PDF文档添加文本和图片页眉
		页眉常用于显示文档的附加信息,我们可以在页眉中插入文本或者图形,例如,页码.日期.公司徽标.文档标题.文件名或作者名等等.那么我们如何以编程的方式添加页眉呢?今天,这篇文章向大家分享如何使用了免费组件 ... 
- dotNET跨平台相关文档整理
		一直在从事C#开发的相关技术工作,从C# 1.0一路用到现在的C# 6.0, 通常情况下被局限于Windows平台,Mono项目把我们C#程序带到了Windows之外的平台,在工作之余花了很多时间在M ... 
- ABP文档 - Javascript Api - AJAX
		本节内容: AJAX操作相关问题 ABP的方式 AJAX 返回信息 处理错误 HTTP 状态码 WrapResult和DontWrapResult特性 Asp.net Mvc 控制器 Asp.net ... 
- ABP文档 - EntityFramework 集成
		文档目录 本节内容: Nuget 包 DbContext 仓储 默认仓储 自定义仓储 特定的仓储基类 自定义仓储示例 仓储最佳实践 ABP可使用任何ORM框架,它已经内置了EntityFrame(以下 ... 
- ABP文档 - SignalR 集成
		文档目录 本节内容: 简介 安装 服务端 客户端 连接确立 内置功能 通知 在线客户端 帕斯卡 vs 骆峰式 你的SignalR代码 简介 使用Abp.Web.SignalR nuget包,使基于应用 ... 
- ABP文档 - 通知系统
		文档目录 本节内容: 简介 发送模式 通知类型 通知数据 通知重要性 关于通知持久化 订阅通知 发布通知 用户通知管理器 实时通知 客户端 通知存储 通知定义 简介 通知用来告知用户系统里特定的事件发 ... 
- ABP文档 - Hangfire 集成
		文档目录 本节内容: 简介 集成 Hangfire 面板授权 简介 Hangfire是一个综合的后台作业管理器,可以在ABP里集成它替代默认的后台作业管理器,你可以为Hangfire使用相同的后台作业 ... 
- ABP文档 - 后台作业和工作者
		文档目录 本节内容: 简介 后台作业 关于作业持久化 创建一个后台作业 在队列里添加一个新作业 默认的后台作业管理器 后台作业存储 配置 禁用作业执行 Hangfire 集成 后台工作者 创建一个后台 ... 
- ABP文档 - Javascript Api
		文档目录 本节内容: AJAX Notification Message UI Block & Busy Event Bus Logging Other Utility Functions A ... 
随机推荐
- 块级&行内(内联)元素
			行内元素列表 <a>标签可定义锚 <abbr>表示一个缩写形式 <acronym>定义只取首字母缩写 <b>字体加粗 <bdo>可覆盖默认的 ... 
- uploadify 3.2 后台动态传参数
			最近在弄一个上传的小功能,需要往后台传递一些动态参数,网上有一些传参数可能是因为版本不对也没成功.仔细看了官网的一些说明,搞定了. 3.2中传递参数用的的是'formData':{'somekey': ... 
- sortedArrayUsingComparator
			/* 升序.降序 */ NSArray * array41 = @[@,@,@,@,@,@,@]; NSArray * array42 = [[NSArray alloc]init]; array42 ... 
- UITableview  xib里面 cell 按钮的回调
			// MoreBtnCell.m#import <UIKit/UIKit.h> @interface MoreBtnCell : UITableViewCell @property (w ... 
- Windows下编译objective-C
			Windows下编译objective-C 2011-08-31 14:32 630人阅读 评论(0) 收藏 举报 windowscocoa工具objective clibraryxcode 目录 ... 
- ecshop缓存清理-限制或禁用ECShop缓存
			ecshop缓存清理-限制或禁用ECShop缓存 ECSHOP的缓存存放在templates/caches/文章夹下,时间长了这个文件夹就会非常庞大,拖慢网站速度.还有很多情况我们不需要他的缓存. ... 
- RT-Thread的线程间同步
			禁止系统调度上一节< 多线程导致的临界区问题>中由于 test1 线程被 test2 线程打断,才导致了我们没有得到预期的结果,我们一般可通过关闭中断和调度器上锁这两种简单的途径来禁止系统 ... 
- Image Formats
			http://www.html5rocks.com/en/tutorials/speed/img-compression/ https://developers.google.com/speed/we ... 
- Delphi中如何控制其他程序窗体上的窗口控件
			回调函数一般是按照调用者的要求定义好参数和返回值的类型,你向调用者提供你的回调函数的入口地址,然后调用者有什么事件发生的时候就可以随时按照你提供的地址调用这个函数通知你,并按照预先规定好的形式传递参数 ... 
- nginx 反向代理 取得真实IP和域名
			nginx反向代理后,在应用中取得的ip都是反向代理服务器的ip,取得的域名也是反向代理配置的url的域名,解决该问题,需要在nginx反向代理配置中添加一些配置信息,目的将客户端的真实ip和域名传递 ... 
