Chinaunix首页 | 论坛 | 博客
  • 博客访问: 18773
  • 博文数量: 4
  • 博客积分: 128
  • 博客等级: 入伍新兵
  • 技术积分: 70
  • 用 户 组: 普通用户
  • 注册时间: 2012-11-07 19:42
文章分类

全部博文(4)

文章存档

2012年(4)

我的朋友

分类: 服务器与存储

2012-12-13 23:40:54

作为分布式文件系统的另外一个阵营,glusterfs作为优秀代表,已经在一些产品中得以实施;
为了对比之前搭建的hadoop的性能和可用性,以同样三台数据服务节点一台测试机搭建了gluster fs的一个最简单的环境,进行测试。

三台服务节点和测试机均为 ubuntu server 12.04  
安装:
$ apt-get install glusterfs-server
$ apt-get install rpcbind

编辑服务端配置文件:
$ vi /etc/glusterfs/glusterd.vol
#volume management
#    type mgmt/glusterd
#    option working-directory /etc/glusterd
#    option transport-type socket,rdma
#    option transport.socket.keepalive-time 10
#    option transport.socket.keepalive-interval 2
#end-volume

#指定一个卷,路径为/data/gluster,作为服务器文件
volume brick
    type storage/posix
    option directory  //gluster
end-volume

#设置卷brick为锁中继(关于中继在附录中介绍)
volume locker
    type features/posix-locks
    subvolumes brick
end-volume

#设置卷brick为服务器模式,并指定IP和检测端口,同时设置卷的使用权限为*(全部授权),也可以设置成部分授权,如:192.168.1.*
volume server
    type protocol/server
    option transport-type tcp/server
    option bind-address 192.168.1.101
    option listen-port 6996
    subvolumes locker
    option auth.addr.brick.allow *
    option auth.addr.locker.allow *
end-volume

$ glusterfsd -f /etc/glusterfs/glusterd.vol -l /var/log/glusterfs/glusterfsd.log  ---启动服务


客户端:
编辑客户端配置文件:
$ vi /etc/glusterfs/glusterd.vol
#指向Server1:192.168.1.101服务器的客户端访问配置 
volume client1
    type    protocol/client
    option  transport-type  tcp/client
    option  remote-host  192.168.1.101
    option  transport.socket.remote-port 6996
    option  remote-subvolume locker
end-volume

#指向Server2:192.168.1.102服务器的客户端访问配置
volume client2
    type      protocol/client
    option    transport-type  tcp/client
    option    remote-host  192.168.1.102
    option    transport.socket.remote-port 6996
    option    remote-subvolume locker
end-volume

#指向Server2:192.168.1.103服务器的客户端访问配置 
volume client3
    type      protocol/client
    option    transport-type  tcp/client
    option    remote-host  192.168.1.103
    option    transport.socket.remote-port 6996
    option    remote-subvolume locker
end-volume

#将client1和client2, client3设置成复制模式 
volume bricks
    type cluster/replicate
    subvolumes client1 client2 client3
end-volume

启动glusterfs客户端挂载
$ glusterfs -f /etc/glusterfs/glusterd.vol -l /var/log/glusterfs/glusterfs.log /mnt/

$ dd if=/dev/zero of=/mnt/io1 bs=1M &
便可进行并发三个节点的复制写入操作

glusterfs nfs挂载的测试没有配好,参考了下面几个帖子,估计是在卷设置上有些问题:

参考连接:
     基本说的是需要制定nfs版本v3,使用tcp协议,共享存储池的创建也是需要的

http://gluster.org/community/documentation/index.php/Gluster_3.2_Filesystem_Administration_Guide     官方手册,实在不行就按手册上讲的一步一步做

         emc的一个哥们应该测试的是蛮全面的了,总结的优缺点和几个适用的场景很有用

http://purplegrape.blog.51cto.com/1330104/1056048      初次创建简单的glusterfs的环境基本参考本篇博客
阅读(1640) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~