ClusterFS 安装

GlusterFS安装示例

环境:
Centos6.5 x64
ClusterFS 3.6

服务器列表 cat /etc/hosts
192.168.58.11 c1
192.168.58.12 c2
192.168.58.13 c3

注:
c3 GusterFS 客户机
c1GusterFS 服务器1
c2 GusterFS 服务器2

1、安装依赖包(每台机器上执行)

yum install wget
cd /etc/yum.repos.d/
wget http://download.gluster.org/pub/gluster/glusterfs/3.6/LATEST/CentOS/glusterfs-epel.repo
yum install epel-release

2、安装服务端 (服务端机器执行)

yum install glusterfs-server
service iptables stop
chkconfig iptables off
service glusterd start     或  # /etc/init.d/glusterd start
chkconfig glusterd on

gluster peer probe c2(此步操作在一台服务器上操作即可,状态将同步到其他服务器)

查看状态

 gluster peer status

挂载独立硬盘分区到/data/glusterfs目录
在c1和c2中分别执行

 mkdir -p /data/glusterfs/brick1

在c1和c2任一一台机器上执行

gluster volume create gv0 replica 2 c1:/data/glusterfs/brick1 c2:/data/glusterfs/brick1

注:生产环境必须用独立硬盘,这里用force强硬创建
(gluster volume create gv0 replica 2 c1:/data/glusterfs/brick1 c2:/data/glusterfs/brick1 force)

启动volume

 gluster volume start gv0

若要使用Cache(可选)

gluster volume set gv0 performance.cache-size 1GB

可选项:配置ACL只允许指定IP访问集群,例如:

gluster volume set gv0 auth.allow 192.168.100.191,192.168.100.192

查看volume状态

gluster volume status
gluster volume info

3、客户端挂载远程文件系统

安装客户端

yum -y install glusterfs-client

挂载目录

mkdir -p /data/gfs_data

在客户端上上执行(读写模式):

mount -t glusterfs -o rw c2:gv0 /data/gfs_data

注:ro:只读模式 rw:读写模式

发生错误:Mount failed. Please check the log file for more details.
检查 [root@myserver2 ~]# gluster volume status,发现NFS Server Online = N
重启myserver2、myserver3再mount,成功。

设置为启动自动挂载

vi /etc/fstab
c2:gv0 /data/gfs_data glusterfs defaults,_netdev 0 0

4、参考资料

GlusterFS文件系统研究
http://blog.csdn.net/zonelan/article/details/8468383

Gluster分布式文件系统 使用(初阶篇)
http://blog.csdn.net/zonelan/article/details/8476281

官网
http://www.gluster.org/

该在线文档:
http://note.youdao.com/share/?id=46c409c84ffa564d97a54ef320f41205&type=note

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值