首页 > 其他 > 详细

GlusterFS作为OpenStack后端存储

时间:2016-07-14 22:16:04      阅读:438      评论:0      收藏:0      [点我收藏+]

创建3个卷imagesvolumesinstances分别对接openstackglancecindernova组件

images卷用于存放OpenStack镜像

volumes卷用于存放OpenStack硬盘

instances卷用于存放OpenStack云主机

1、  创建卷

gluster volume create images replica 3 controller1:/data/brick1/image  controller2:/data/brick1/image  compute01:/data/brick1/image controller1:/data/brick2/image  controller2:/data/brick2/image  compute01:/data/brick2/image controller1:/data/brick3/image  controller2:/data/brick3/image  compute01:/data/brick3/image
 
gluster volume create volumes replica 3 controller1:/data/brick1/volume  controller2:/data/brick1/volume  compute01:/data/brick1/volume controller1:/data/brick2/volume  controller2:/data/brick2/volume  compute01:/data/brick2/volume controller1:/data/brick3/volume  controller2:/data/brick3/volume  compute01:/data/brick3/volume
 
gluster volume create instances replica 3 controller1:/data/brick1/instance  controller2:/data/brick1/instance  compute01:/data/brick1/instance controller1:/data/brick2/instance  controller2:/data/brick2/instance  compute01:/data/brick2/instance controller1:/data/brick3/instance  controller2:/data/brick3/instance  compute01:/data/brick3/instance

2、  启动卷

gluster volume start images
gluster volume start volumes
gluster volume start instances

3、  添加imagesinstancesfstab自动挂载

controller1:/images   /var/lib/glance/images   glusterfs  defaults,_netdev,backupvolfile-server=controller2,backupvolfile-server=compute01   0 0
controller1:/instances   /var/lib/nova/instances   glusterfs  defaults,_netdev,backupvolfile-server=controller2,backupvolfile-server=compute01   0 0

技术分享

mount  -a 挂载

上述挂载方式使用backupvolfile起到了高可用性,避免单点故障

novaglance节点要挂载到instancesimages的相关目录,根据实际服务部署情况调整,cinder不太一样,下边会说到。

 4、  设置相关权限

chown -R nova.nova /var/lib/nova/instances
chown -R glance.glance/var/lib/glance/images
chown -R nova:nova /data/brick1/instance
chown -R nova:nova /data/brick2/instance
chown -R nova:nova /data/brick3/instance
chown -R glance:glance /data/brick1/image
chown -R glance:glance /data/brick2/image
chown -R glance:glance /data/brick3/image
chown -R cinder:cinder /data/brick1/volume
chown -R cinder:cinder /data/brick2/volume
chown -R cinder:cinder /data/brick3/volume

nova要有instancecinder要有volumeglance要有image的读写权限,根据节点上的服务,给相应的权限。

5、  配置cinder

cp /etc/cinder/cinder.conf{,.bak}
openstack-config --set/etc/cinder/cinder.conf DEFAULT volume_drivercinder.volume.drivers.glusterfs.GlusterfsDriver
openstack-config --set/etc/cinder/cinder.conf DEFAULT glusterfs_shares_config /etc/cinder/shares.conf
openstack-config --set /etc/cinder/cinder.confDEFAULT glusterfs_mount_point_base /var/lib/cinder/volumes

touch /etc/cinder/shares.conf
vim /etc/cinder/shares.conf  #添加以下内容
controller1:/volumes
controller2:/volumes
compute01:/volumes

#设置相关权限

chown -R cinder.cinder/etc/cinder/shares.conf
chown -R cinder:cinder /var/lib/cinder/*

6、  重启openstack相关服务

openstack-service restart nova
openstack-service restart cinder
openstack-service restart glance

7、  验证cinder

技术分享

本文出自 “生命不息,奋斗不止!” 博客,请务必保留此出处http://linuxnote.blog.51cto.com/9876511/1826501

GlusterFS作为OpenStack后端存储

原文:http://linuxnote.blog.51cto.com/9876511/1826501

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!