next up previous contents
Next: 使用 Glusterfs volume Up: Glusterfs 檔案系統 Previous: 建置 Glusterfs Server   Contents

Gluster Client 新增 cinder volume

  1. 安裝 gluster-fuse 套件。
    [root@kvm4 ~]# yum install -y glusterfs-fuse
    
  2. 備份 /etc/cinder/cinder.conf。
    [root@kvm4 ~]# cp /etc/cinder/cinder.conf /etc/cinder/cinder.conf.orig
    
  3. 設定 /etc/cinder/cinder.conf。
    [root@kvm4 ~]# openstack-config --set /etc/cinder/cinder.conf \
    DEFAULT enabled_backends glusterfs,lvm
    [root@kvm4 ~]# openstack-config --set /etc/cinder/cinder.conf \
    lvm volume_group cinder-volumes
    [root@kvm4 ~]# openstack-config --set /etc/cinder/cinder.conf \
    lvm volume_driver cinder.volume.drivers.lvm.LVMISCSIDriver
    [root@kvm4 ~]# openstack-config --set /etc/cinder/cinder.conf \
    lvm volume_backend_name LVM
    [root@kvm4 ~]# openstack-config --set /etc/cinder/cinder.conf \
    glusterfs volume_driver cinder.volume.drivers.glusterfs.GlusterfsDriver
    [root@kvm4 ~]# openstack-config --set /etc/cinder/cinder.conf \
    glusterfs glusterfs_shares_config /etc/cinder/shares.conf
    [root@kvm4 ~]# openstack-config --set /etc/cinder/cinder.conf \
    glusterfs glusterfs_sparsed_volumes false
    [root@kvm4 ~]# openstack-config --set /etc/cinder/cinder.conf \
    glusterfs volume_backend_name RHS
    
  4. 建立分享 volume 設定檔,加入 volume4。
    [root@kvm4 ~]# echo "kvm4.deyu.wang:volume4" >> /etc/cinder/shares.conf
    
  5. 重新啟動 openstack-cinder-schduler 及 openstack-cinder-volume 服務。
    [root@kvm4 ~]# /etc/init.d/openstack-cinder-scheduler restart
    Stopping openstack-cinder-scheduler:               [  OK  ]
    Starting openstack-cinder-scheduler:               [  OK  ]
    [root@kvm4 ~]# /etc/init.d/openstack-cinder-volume restart
    Stopping openstack-cinder-volume:                  [  OK  ]
    Starting openstack-cinder-volume:                  [  OK  ]
    
  6. 查看啟動情況,沒訊息表示啟動正常。
    [root@kvm4 ~]# tail /var/log/cinder/volume.log
    
  7. 查看掛載狀況,volume4 已掛載。
    [root@kvm4 ~]# df
    Filesystem           1K-blocks      Used Available Use% Mounted on
    /dev/mapper/vg_os-root
                           4031680    968084   2858796  26% /
    tmpfs                  1478460         0   1478460   0% /dev/shm
    /dev/vda1               194366     25853    158478  15% /boot
    /dev/mapper/vg_os-var
                          10079084   1237012   8330072  13% /var
    /dev/vdb1                89243      5721     78914   7% /srv/node/z1d1
    /dev/vdc1                89243      5719     78916   7% /srv/node/z2d1
    kvm4.deyu.wang:volume4
                           4031616    968064   2858752  26% /var/lib/cinder/mnt/528c07a5e99cd72c63f4bdf80da8dcde
    



2015-12-29