上一篇我们已经创建了GlusterFS集群,接下来就是我们怎么在Cinder后端来添加GlusterFS存储,其实熟悉了前面介绍的添加NFS的朋友,在参考GlusterFS其实是一样的,我们只需要修改cinder的配置文件即可。
1、在计算节点和存储节点安装glusterfs客户端软件
注意,由于我是单独创建了一个cinder存储节点,然后通过cinder存储节点的cinder-volume服务来挂载创建的两个glusterfs集群,所以我需要安装glusterfs客户端。
root@cinder:~# apt-get install glusterfs-client
2、在cinder节点的cinder.conf添加如下内容,添加如下内容[DEFAULT]
volume_driver=cinder.volume.drivers.glusterfs.GlusterfsDriver
glusterfs_mount_point_base = $state_path/mnt
glusterfs_qcow2_volumes = False
glusterfs_shares_config = /etc/cinder/glusterfs_shares
glusterfs_sparsed_volumes = True
3、创建glusterfs_shares文件
注意该文件的权限,所属组
root@cinder:~# ll /etc/cinder/glusterfs_shares
-rw-r----- 1 root cinder 19 Jul 17 16:45 /etc/cinder/glusterfs_shares
4、添加glusterfs集群内容,包括新创建的demo卷
root@cinder:~# cat /etc/cinder/glusterfs_shares