1. 程式人生 > >openstack newton 配置glusterfs 作cinder backend

openstack newton 配置glusterfs 作cinder backend

glusterfs cinder newton

一、搭建gluster

1、節點準備

hostname
ip
數據盤vdb
g0
192.168.10.10
10G
g1
192.168.10.1110G
g2
192.168.10.1210G

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