一、搭建gluster
1、节点准备
hostname | ip | 数据盘vdb |
g0 | 192.168.10.10 | 10G |
g1 | 192.168.10.11 | 10G |
g2 | 192.168.10.12 | 10G |
2、安装glusterfs
yum install centos-release-gluster310 yum install glusterfs-server
3、创建glusterfs,登录g0
gluster peer probe g1 gluster peer probe g2
4、对vdb分区
parted /dev/vdb -s -- mklabel gpt mkpart glusterfs 1 -1 mkfs.xfs -f /dev/vdb1
5、挂载vdb
mkdir /data cat /srv/salt/mkfstab.sh #!/bin/bash uuid=`blkid /dev/vdb1 | awk -F‘ ‘ ‘{print $2}‘ | awk -F‘=‘ ‘{print $2}‘ | sed s/\"//g` cat <<EOF>> /etc/fstab UUID=${uuid} /data xfs defaults 0 0 EOF salt-ssh -i ‘*‘ cp.get_file salt://mkfstab.sh /tmp/mkfstab.sh salt-ssh -i ‘*‘ cmd.run ‘chmod +x /tmp/mkfstab.sh‘ salt-ssh -i ‘*‘ cmd.run ‘/tmp/mkfstab.sh‘ salt-ssh -i ‘*‘ cmd.run ‘mount -a‘ salt-ssh -i ‘*‘ cmd.run ‘mkdir /data/fs‘
6、创建卷
gluster volume create vol0 replica 3 g0:/data/fs g1:/data/fs g2:/data/fs gluster volume start vol0
7、mount.glusterfs 读取多少配置
以下引用自:
http://einst.blog.51cto.com/9493625/1594668/
gluster 的提供option叫backup-volfile-server和backup-volfile-servers,达到挂载时候可以指定多个读取卷配置服务器。
使用方式如下:
mount -t glusterfs -o backup-volfile-server=gluster2 gluster1:/volume /mnt mount -t glusterfs -o backup-volfile-servers=gluster2:gluster3:gluster4 gluster1:/volume /mnt
二、配置glusterfs作为cinder后端
1、节点准备
host | |
newton | 使用packstack单节点安装newton |
cinder-volume | 安装cinder-volume配置glusterfs |
2、安装openstack
通过packstack在newton节上安装openstack newton版本,过程略
3、配置glusterfs作为cinder后端
yum install centos-release-gluster310 yum install openstack-cinder python2-keystonemiddleware python-crypto glusterfs-fuse
本文出自 “武陵荒草” 博客,请务必保留此出处http://penguintux.blog.51cto.com/3021117/1929069
openstack newton 配置glusterfs 作cinder backend
原文地址:http://penguintux.blog.51cto.com/3021117/1929069