OM_glusterfs 安装测试文档

glusterfs 安装测试文档v0.0.0.1一、 概述二、 安装2.1 命令手册2.2 安装前的配置2.3 存储服务器的安装2.4 挂载点[文件操作服务器]的安装 三、 测试3.1 普通卷创建3.2 指定条带数为2的创建3.3 指定文件复制数量为2的创建3.4 指定文件复制数量为3的创建3.5 三台存储服务器的搭建四、 其它4.1 安装出现的部分问题4.2 Glusterfs支持的卷类型4.3 参考资料一、 概述开源的Ceph及Red Hat旗下的Gluster都是成熟的技术.Gluster描述为可扩展的网络存储设备(Scale-out NAS)和对象存储系统。开源/分布式文件系统/横向扩展能力/PB存储容量/TCP/IP或InfiniBand[InfiniBand架构是一种支持多并发链接的“转换线缆”技术] RDMA网络/使用操作系统中主流标准的磁盘文件系统[EXT3、EXT4、XFS、ZFS]全局统一命名空间/通过单一挂载点进行数据共享/对上层用户和应用屏蔽了底层的物理硬件/弹性哈希算法在存储池中定位数据/支持NFS, CIFS, HTTP, FTP以及Gluster原生协议,完全与POSIX标准兼容/存储服务器运行着Glusterfsd,负责处理来自其他组件的数据服务请求。客户端上运行Glusterfs进程,它实际是Glusterfsd的符号链接,利用FUSE(File system in User Space)模块将GlusterFS挂载到本地文件系统之上,实现POSIX兼容的方式来访问系统数据。二、 安装2.1 命令手册####################################killall glusterfsd ; killall -9 glusterfsd ; killall glusterd ;killall glusterfs ;ps -ef |grep gluster/etc/init.d/glusterd start ; ps -ef | grep glustergluster helpgluster peer helpgluster volume helpgluster peer datach host2.example.com || 删除节点 gluster volume remove-brick testvol host2.example.com :/data/data01 || 删除brickgluster volume stop testvol ||停止volume服务gluster volume delete testvol || 删除volumedd if=/dev/zero of=/root/1.jpg bs=1024k count=1000 ||压测gluster volume set testvol3[valume name] auth.allow 10.2.50.*[ip address] ||服务端授权设置####################################2.2 安装前的配置more /etc/hosts--- ---10.2.50.124 host1.example.com10.2.50.143 host2.example.com10.2.50.31 host3.example.com10.2.50.27 client.example.com--- ---2.3 存储服务器的安装wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-epel.repoyum -y install glusterfs-server/etc/init.d/glusterd startchkconfig glusterfsd ongluster peer probe host2.example.comgluster peer status(Notice: 以下操作在任何一个存储服务节点操作即可,也即它们可以通过单点进行管理所有的节点)gluster volume create testvol host1.example.com:/data/data01 host2.example.com:/data/data01gluster volume create testvol replica 2 g132:/data/data01 g133:/data/data01 ;;数据存放2份gluster volume create testvol stripe 2 g132:/data/data01 g133:/data/data01 ;;条带化到几个节点gluster volume start testvolnetstat -tap | grep glusterfsd2.4 挂载点[文件操作服务器]的安装 wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-epel.repoyum -y install glusterfs glusterfs-fuse三、 测试3.1 普通卷创建【S】gluster volume create testvol host1.example.com:/data/data01 host2.example.com:/data/data01 gluster volume start testvol【C】mount.glusterfs host1.example.com:testvol /test上传节点如果是客户端的话,文件会存储在Server1或者Server2中。上传节点如果是服务端的话,无论是从哪个服务端,文件都会在Client显示出来,但是文件默认只会保留一份在服务端。客户端执行 rm -rf /test/*(假使该目录 /test 是客户端挂载任何一个服务端brick到本地的目录),则会将任何服务端的任何该brick下的文件都删除。3.2 指定条带数为2的创建【S】gluster volume create testvol2 stripe 2 host1.example.com:/data/data02 host2.example.com:/data/data02 gluster volume start testvol2【C】mount.glusterfs host1.example.com:testvol2 /test2这里通过指定条带化到2个节点。上传节点如果是客户端的话,该文件能够被同步到2个服务端中,但是有个奇怪的现象是该挂载节点下ls不出文件,但是ls filename还是可以的。上传节点如果是服务端的话,还是只能在上传的那个服务端保留文件,而不能够被同步到其它服务节点上去。客户端执行 rm -rf /test2/* 不能够再删除任何服务端的任何文件了(因为ls不出来?)3.3 指定文件复制数量为2的创建【S】gluster volume create testvol3 replica 2 host1.example.com:/data/gfs host2.example.com:/data/gfs force gluster volume start testvol3【C】mount.glusterfs host1.example.com:testvol3 /test3其中有一台服务端上传只能够显示在本机上,而不能同步到客户端和另外一台服务端;另外一台服务端上传都能够同步到另一台服务端和客户端上。客户端上传的文件都能够同步。3.4 指定文件复制数量为3的创建 【S】gluster volume create testvol6 replica 3 host1.example.com:/data/gfss host2.example.com:/data/gfss host3.example.com:/data/gfss force gluster volume start testvol6 【C】mkdir -p /gfs mount.glusterfs host1.example.com:testvol6 /gfs以上设置为开启三个存储服务节点,通过挂载其中任何一个服务节点,在挂载点上进行上传操作都能够同步到其它服务节点上。在任何一台单独的存储服务器上传的文件无法自动同步到其它存储节点。通过客户端上传的文件,在单独任何一台存储服务器进行文件删除操作,不会影响到其它的存储服务节点的该文件,该文件也不会再被同步恢复上来。 3.5 三台存储服务器的搭建解析: host1.example.com:/data/gfs/bbs ;; 指定为host1.example.com 主机上 /data/gfs/bbs文件夹webvol、webvol2、webvol3 ;; 逻辑卷名称 [S1]gluster volume create webvol replica 3 host1.example.com:/data/gfs/bbs host2.example.com:/data/gfs/bbs host3.example.com:/data/gfs/bbs force ;;在各自文件系统中创建同步目录 [S1]gluster volume start webvol ;;开启逻辑卷服务 [S2]gluster volume create webvol2 replica 3 host1.example.com:/data/gfs/bbs2 host2.example.com:/data/gfs/bbs2 host3.example.com:/data/gfs/bbs2 force [S2]gluster volume start webvol2 [S3]gluster volume create webvol3 replica 3 host1.example.com:/data/gfs/bbs3 host2.example.com:/data/gfs/bbs3 host3.example.com:/data/gfs/bbs3 force [S3]gluster volume start webvol3 [C] mount.glusterfs host1.example.com:webvol /data/www/bbs1 ;; 挂载任意一个存储节点到本地目录中 mount.glusterfs host1.example.com:webvol2 /data/www/bbs2 mount.glusterfs host1.example.com:webvol3 /data/www/bbs3 四、 其它4.1 安装出现的部分问题如果 gluster peer probe host2.example.com 出现以下问题:peer probe: failed: Probe returned with unknown errno 107 || Mount failed. Please check the log file for more details.1.check the output of iptables-save for any firewall rules that might be interfering, on both machines2.make sure glusterd is running on both machines3.make sure you can actually ping the other machine4.both machines need to have a valid gateway set up4.2 Glusterfs支持的卷类型Glusterfs3.2.4/5支持五种Volume,即Distribute卷、Stripe卷、Replica卷、Distribute stripe卷和Distribute replica卷,这五种卷可以满足不同应用对高性能、高可用的需求。(1)distribute volume:分布式卷,文件通过hash算法分布到brick server上,这种卷是glusterfs的基础和最大特点;(2)stripe volume:条带卷,类似RAID0,条带数=brick server数量,文件分成数据块以Round Robin方式分布到brick server上,并发粒度是数据块,大文件性能高;(3)replica volume:镜像卷,类似RAID1,镜像数=brick server数量,所以brick server上文件数据相同,构成n-way镜像,可用性高;(4)distribute stripe volume:分布式条带卷,brick server数量是条带数的倍数,兼具distribute和stripe卷的特点;(5)distribute replica volume:分布式镜像卷,brick server数量是镜像数的倍数,兼具distribute和replica卷的特点;4.3 参考资料http://www.gluster.org/https://github.com/gluster/glusterfshttp://www.sohailriaz.com/glusterfs-howto-on-centos-6-x/http://www.chenshake.com/centos-6-4-testing-glusterfs-3-2-7/http://blog.csdn.net/liuaigui/article/details/17331557http://www.linuxidc.com/Linux/2011-12/50580.htm
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值