glusterFS分布式文件系统的搭建
准备工作
1、安装IBA
yum install libradmacm librdmacm-devel libmlx4 infiniband-diags
2、配置IPOIB
/etc/sysconfig/network-scripts/ifcfg-ib0 DEVICE=ib0 TYPE=InfiniBand BOOTPROTO=static ONBOOT=yes IPADDR=17.0.31.3 NETMASK=255.255.0.0
修改完配置之后,需要重启ib0
ifdown ib0
ifup ib0
ib0无法识别
service rdma restart
3、配置hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 173.0.31.1 datasrv001 173.0.31.2 datasrv002 173.0.31.3 datasrv003 17.0.31.1 ibdatasrv001 datasrv001.ib 17.0.31.2 ibdatasrv002 datasrv002.ib 17.0.31.3 ibdatasrv003 datasrv003.ib
安装glusterfs-3.6.7
1、下载glusterfs-3.6.7
2、
configure;make;make clean
3、打包后,放在
/root/rpmbuild/SOURCES/glusterfs-3.6.7.tar.gz
目录下。
4、
rpmbuild -ta glusterfs-3.6.7.tar.gz
或
rpmbuild -ba glusterfs.spec
生成包。
5、将Centos自带的glusterfs-3.6.0(卸载)
rpm -qa |grep glusterfs|xargs rpm -e --nodeps
6、安装生成的rpm包,
rpm -ivh *.rpm --nodeps
(注): ibstat 发现ib状态无法过去,缺少 ib_umad模块,可以使用modprobe加载模块。
modprobe ib_umad
加载成功之后,使用ibstat查看IB状态。
[root@datasrv001 ~]# ibstat CA 'mlx4_0' CA type: MT4099 Number of ports: 1 Firmware version: 2.35.5100 Hardware version: 0 Node GUID: 0xe41d2d030050b260 System image GUID: 0xe41d2d030050b263 Port 1: State: Active Physical state: LinkUp Rate: 40 (FDR10) Base lid: 1287 LMC: 0 SM lid: 1637 Capability mask: 0x02514868 Port GUID: 0xe41d2d030050b261 Link layer: InfiniBand
启动glusterfs
1、打开防火墙
iptables -I INPUT -p tcp --dport 24007:24011 -j ACCEPT iptables -I INPUT -p tcp --dport 34865:34885 -j ACCEPT
2、修改glusterd.vol文件
volume management type mgmt/glusterd option working-directory /var/lib/glusterd option transport-type socket,rdma option transport.socket.keepalive-time 10 option transport.socket.keepalive-interval 2 option transport.socket.read-fail-log off option ping-timeout 30 # option base-port 49152 option base-port 49352 option rpc-auth-allow-insecure on end-volume
3、启动服务
service glusterd start
4、探测节点
在cinder的服务器datasrv001上
gluster peer probe ibdatasrv002
gluster peer probe ibstatsrv003
挂载卷
格式化磁盘 mkfs.ext4
准备服务
1、在存储服务器上准备卷
gluster volume create datavolume1 transport tcp ibdatasrv001:/mnt/test1/dv1
2、把datavolume也给设置上insecure on
gluster volume set datavolume1 server.allow-insecure on
3、启动datavolume服务
gluster volume start datavolume1
4、挂载客户端
mount -t glusterfs ibdatasrv001:/datavolume1 /mnt/mount_test