gluster 安装配置基本指南
基于网络上的多篇文章,做了一些调整。
gluster安装
### Installing Gluster
wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/EPEL.repo/glusterfs-epel.repo
yum install glusterfs{-fuse,-server}
启动服务
service glusterd start
chkconfig glusterd on
add rule into iptables file on each gluster server:
vi /etc/sysconfig/iptables:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 24007:24008 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 49152:49162 -j ACCEPT
service iptables restart
建立peer关系
gluster peer probe bluejoe6
gluster peer probe bluejoe7
gluster peer status
创建并启动volume
gluster volume create gv0 bluejoe6:/data/gfs bluejoe7:/data/gfs force
# 启动卷
gluster volume start gv0
# 查看卷
gluster volume info gv0
客户端挂载
mount -t glusterfs bluejoe0:/gv0 /mnt/gfs
===================================
部分命令
volume create <NEW-VOLNAME> [stripe <COUNT>] [replica <COUNT>] [transport <tcp|rdma|tcp,rdma>] <NEW-BRICK>?<vg_name>... [force]
# 五种类型的volume可以被创建:
Distributed:分布式卷,文件通过hash算法随机的分布到由bricks组成的卷上。
Replicated:复制式卷,类似raid1,replica数必须等于volume中brick所包含的存储服务器数,可用性高。
Striped:条带式卷,类似与raid0,stripe数必须等于volume中brick所包含的存储服务器数,文件被分成数据块,以Round Robin的方式存储在bricks中,并发粒度是数据块,大文件性能好。
Distributed Striped:分布式的条带卷,volume中brick所包含的存储服务器数必须是stripe的倍数(>=2倍),兼顾分布式和条带式的功能。
Distributed Replicated:分布式的复制卷,volume中brick所包含的存储服务器数必须是 replica 的倍数(>=2倍),兼顾分布式和复制式的功能。
# 创建分布卷
gluster volume create gv0 fs-server-1:/data/gfs fs-server-2:/data/gfs
# 创建复制卷
gluster volume create gv0 replica 2 fs-server-1:/data/gfs fs-server-2:/data/gfs
# 创建条带卷
gluster volume create gv0 stripe 2 fs-server-1:/data/gfs fs-server-2:/data/gfs
gluster volume create volume2 stripe 3 replica 2 bluejoe6:/data/gfs-rep1 bluejoe6:/data/gfs-rep2 bluejoe7:/data/gfs-rep1 bluejoe7:/data/gfs-rep2 bluejoe8:/data/gfs-rep1 bluejoe8:/data/gfs-rep2 force
# gluster volume info gluster-volume1 Volume Name: gluster-volume1
Type: Distributed-Replicate
Volume ID: 7bed32e1-3ec1-4d67-975e-5ac07f99f481
Status: Created
Number of Bricks: 3 x 2 = 6
Transport-type: tcp
Bricks:
Brick1: bluejoe6:/data/brick1
Brick2: bluejoe7:/data/brick1
Brick3: bluejoe6:/data/brick2
Brick4: bluejoe8:/data/brick1
Brick5: bluejoe7:/data/brick2
Brick6: bluejoe8:/data/brick2
查看volume列表
gluster volume list
查看volume的具体信息(包含bricks的信息)
# gluster volume info
Volume Name: gv0
Type: Distribute
Volume ID: 8bde2ba4-7777-49ff-8b2b-763089017759
Status: Started
Number of Bricks: 3
Transport-type: tcp
Bricks:
Brick1: bluejoe6:/data/gfs
Brick2: bluejoe7:/data/gfs
Brick3: bluejoe8:/data/gfs
#如果以后要添加服务器,可以使用add-brick命令:
gluster volume add-brick gv0 fs-server-3:/data/gfs fs-server-4:/data/gfs
gluster volume remove-brick VOLNAME BRICK
注意:当你给分布式复制卷和分布式条带卷中增加bricks时,你增加的bricks的数目必须是复制或者条带数目的倍数,例如:你给一个分布式复制卷的replica为2,你在增加bricks的时候数量必须为2、4、6、8等。
当移除分布式复制卷或者分布式条带卷的时候,移除的bricks数目必须是replica或者stripe的倍数。例如:一个分布式条带卷的stripe是2,当你移除bricks的时候必须是2、4、6、8等。
============================
常见故障解决方案
问题1
[root@localhost ~]# gluster peer status
Connection failed. Please check if gluster daemon is operational.
原因:未开启glusterd服务
解决方法:开启glusterd服务
/etc/init.d/glusterd start
问题2
[root@localhost ~]# gluster peer probe 192.168.230.130
peer probe: failed: Probe returned with unknown errno 107
原因:日志中打印[2014-05-15 15:55:25.929461] I [glusterd-handler.c:2836:glusterd_probe_begin] 0-glusterd:Unable to find peerinfo for host: 192.168.230.130 (24007)
防火墙没开启24007端口
解决方法:开启24007端口或者关掉防火墙
/sbin/iptables -I INPUT -p tcp --dport 24007 -j ACCEPT # 开启24007端口
/etc/init.d/iptables stop # 关掉防火墙
注:
也可以使用主机名来代替IP,修改/etc/hosts文件实现
gluster peer probe server-130
问题3
volume create volume1 192.168.230.135:/tmp/brick1
volume create: volume2: failed
不能只使用一个server上的brick创建volume,需要至少两个brick,或者在client主机(这里为192.168.230.134)上使用一个brick创建volume。
- gluster> volume create volume1 192.168.230.134:/tmp/brick1 force
- volume create: volume1: success: please start the volume to access data
- gluster> volume info
- Volume Name: volume1
- Type: Distribute
- Volume ID: b01a2c29-09a6-41fd-a94e-ea834173a6a3
- Status: Created
- Number of Bricks: 1
- Transport-type: tcp
- Bricks:
- Brick1: 192.168.230.134:/tmp/brick1
- gluster>
- gluster> volume create volume2 192.168.230.134:/tmp/brick2 192.168.230.135:/tmp/brick2 force
- volume create: volume2: success: please start the volume to access data
- gluster> volume info
- Volume Name: volume1
- Type: Distribute
- Volume ID: b01a2c29-09a6-41fd-a94e-ea834173a6a3
- Status: Created
- Number of Bricks: 1
- Transport-type: tcp
- Bricks:
- Brick1: 192.168.230.134:/tmp/brick1
- Volume Name: volume2
- Type: Distribute
- Volume ID: 4af2e260-70ce-49f5-9663-9c831c5cf831
- Status: Created
- Number of Bricks: 2
- Transport-type: tcp
- Bricks:
- Brick1: 192.168.230.134:/tmp/brick2
- Brick2: 192.168.230.135:/tmp/brick2
问题4
创建一个volume后删除,再使用同名的brick创建volume失败。
gluster> volume create test 192.168.230.134:/tmp/brick1 force
volume create: test: success: please start the volume to access data
gluster> volume info Volume Name: test
Type: Distribute
Volume ID: c29f75d2-c9f5-4d6f-90c5-c562139ab9cd
Status: Created
Number of Bricks: 1
Transport-type: tcp
Bricks:
Brick1: 192.168.230.134:/tmp/brick1
gluster> volume delete test force
Usage: volume delete <VOLNAME>
gluster> volume delete test
Deleting volume will erase all information about the volume. Do you want to continue? (y/n) y
volume delete: test: success
gluster> volume create test 192.168.230.134:/tmp/brick1 force
volume create: test: failed: /tmp/brick1 or a prefix of it is already part of a volume
因为volume delete时并未删掉create时创建的目录,需要手动删除后再使用。
gluster 安装配置基本指南的更多相关文章
- 【转】Windows平台下的Subversion安装配置新手指南
原文地址:http://developer.51cto.com/art/201005/199628.htm 本文介绍Subversion安装配置快速指南,首先讲Subversion的安装和配置,Uni ...
- [转载]SharePoint 2013测试环境安装配置指南
软件版本 Windows Server 2012 标准版 SQL Server 2012 标准版 SharePoint Server 2013 企业版 Office Web Apps 2013 备注: ...
- 高手指南PHP安装配置
高手指南PHP安装配置 2014-11-05 12:57:13 来源: 评论:0 次 点击:12 次 | 发布人:登陆查看 PHP的快速发展,它的功能越来越强大,运用它也变得很方便,下面我 ...
- 【转】服务器证书安装配置指南(Weblogic)
服务器证书安装配置指南(Weblogic) 详情请点击: http://verisign.itrus.com.cn/html/fuwuyuzhichi/fuwuqizhengshuanzhuangpe ...
- Gitolite v3安装配置指南
使用gitolite对git仓储进行权限配置 gitolite在近期做了很多代码改动,升级到了v3版本,而我使用的是v3.5.2.在<Git权威指南>中所提及的是v2版本,有很多东西已经不 ...
- 大数据应用日志采集之Scribe 安装配置指南
大数据应用日志采集之Scribe 安装配置指南 大数据应用日志采集之Scribe 安装配置指南 1.概述 Scribe是Facebook开源的日志收集系统,在Facebook内部已经得到大量的应用.它 ...
- 【转】Syncthing – 数据同步利器---自己的网盘,详细安装配置指南,内网使用,发现服务器配置
Syncthing – 数据同步利器---自己的网盘,详细安装配置指南,内网使用,发现服务器配置 原贴:https://www.cnblogs.com/jackadam/p/8568833.html ...
- 高可用,完全分布式Hadoop集群HDFS和MapReduce安装配置指南
原文:http://my.oschina.net/wstone/blog/365010#OSC_h3_13 (WJW)高可用,完全分布式Hadoop集群HDFS和MapReduce安装配置指南 [X] ...
- vSphere Web Client使用指南之安装配置
vSphere Web Client使用指南之安装配置 vSphere Web Client是为忙碌的管理员提供的一款通用的.基于浏览器的VMware管理工具,能够监控并管理VMware基础设施.在摆 ...
随机推荐
- 浅析Netty的异步事件驱动(二)
上一篇文件浅析了Netty中的事件驱动过程,这篇主要写一下异步相关的东东. 首先,什么是异步了? 异步的概念和同步相对.当一个异步过程调用发出后,调用者不能立刻得到结果.实际处理这个调用的部件在完成后 ...
- [转]带花树,Edmonds's matching algorithm,一般图最大匹配
看了两篇博客,觉得写得不错,便收藏之.. 首先是第一篇,转自某Final牛 带花树……其实这个算法很容易理解,但是实现起来非常奇葩(至少对我而言). 除了wiki和amber的程序我找到的资料看着都不 ...
- RDMA编程实例
1,RDMA verbs Multicast Code for Multicast Using RDMA_CM(Remote directory memory access_connect manag ...
- 【现代程序设计】【homework-02】【11061027】
Q:描述在这么多相似的需求面前, 你怎么维护你的设计 (父类/子类/基类, UML, 设计模式, 或者其它方法) 让整个程序的架构不至于崩溃的? A:由于使用的是面向过程的C语言,所以维护设计这个问 ...
- ACCESS-类型转换函数
类型转换涵数: 函数 返回类型 expression 参数范围 CBool Boolean 任何有效的字符串或数值表达式. CByte Byte 0 至 ...
- activemq重启
172.16.10.72 activemq /home/local/apache-activemq-5.10.0/bin/activemq-admin stop /home/local/apache- ...
- 起底多线程同步锁(iOS)
iOS/MacOS为多线程.共享内存(变量)提供了多种的同步解决方案(即同步锁),对于这些方案的比较,大都讨论了锁的用法以及锁操作的开销,然后就开销表现排个序.春哥以为,最优方案的选用还是看应用场景, ...
- 将NavigationBar设置透明
将NavigationBar设置透明(仅将指定视图控制器进行透明处理),步骤如下:1.在视图控制器的头文件中实现UINavigationControllerDelegate,例如:@interface ...
- oracle 修改索引现有表空间
工作日记之<修改索引现有表空间> //dba_indexes可查询所有索引,以及索引部分信息,可以灵活运用于其他用途 //假设用户USER1现有表空间TS1.TS2,需要迁移其下所有表空间 ...
- other
1.http://handlebarsjs.com/ 2.grunt
