glusterfs 快速安装配置

安装的机器为两台 centOS 6.4 X86_64的机器。


首先安装gluster
分布在两台机器做如下操作:

创建一个glusterfs.repo 文件在 /etc/yum.repo.d/下
[glusterfs]
name=glusterfs
baseurl=http://download.gluster.org/pub/gluster/glusterfs/3.3/3.3.2/RHEL/epel-6/x86_64/
enable=1
gpgcheck=0

修改 /etc/resolv.conf 为
; generated by /sbin/dhclient-script
search openstacklocal
nameserver 8.8.8.8

注: 8.8.8.8 为google的dsn服务器地址 (霸气的ip。。。)

yum安装
yum install glusterfs-server

配置glusterfs;
配置的目标是在 glusterfs文件系统中有两个文件夹挂载点

首先是让glusterfs的两台机器建立通信:
[root@host-10-0-32-16 ~]# gluster peer probe 10.0.32.15
Probe successful
然后是创建本地文件夹,分布在两台机器上执行
shell>mkdir /root/glusterfs-folder1
shell>mkdir /root/glusterfs-folder2
注:文件夹位置和名称任意
之后是创建卷
[root@host-10-0-32-16 ~]# gluster volume create vol1 10.0.32.16:/root/gluster-folder1 10.0.32.15:/root/gluster-folder1
Creation of volume vol1 has been successful. Please start the volume to access data.
[root@host-10-0-32-16 ~]# gluster volume start vol1
Starting volume vol1 has been successful
[root@host-10-0-32-16 ~]# gluster volume create replic 2 vol2 10.0.32.16:/root/gluster-folder2 10.0.32.15:/root/gluster-folder2
Creation of volume vol2 has been successful. Please start the volume to access data.
[root@host-10-0-32-16 ~]# gluster volume start vol2
Starting volume vol2 has been successful
[root@host-10-0-32-16 ~]# gluster volume list
vol1
vol2


挂载glusterfs文件夹
最后通过fstab来mount
shell> vi /etc/fstab
添加如下两行
10.0.32.16:/vol1  /root/test      glusterfs      auto 0 0
10.0.32.16:/vol2  /root/test2     glusterfs      auto 0 0

shell> mkdir /root/test
shell>mkdir /root/test2
shell> mount /root/test
shell> mount /root/test2

shell>df
10.0.32.16:/vol1        123852672    4464128 113097216    4% /root/test
10.0.32.16:/vol2      123852672    4464128 113097216    4% /root/test2


转载请注明转自高孝鑫的博客
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值