續:Openstack塊存儲cinder安裝配置html
接上使用ISCSI做爲後端存儲,使用NFS做爲後端存儲配置node
參考官方文檔:https://wiki.openstack.org/wiki/How_to_deploy_cinder_with_NFSpython
在node2節點作一個存儲web
安裝軟件包數據庫
yum install openstack-cinder targetcli python-keystone
安裝nfsvim
yum -y install nfs-utils rpcbind
建立掛載目錄後端
mkdir -p /data/nfs
編輯配置文件vim /etc/exportspython2.7
/data/nsf *(rw,sync,no_root_squash)
啓動nfsurl
systemctl start rpcbind systemctl start nfs
systemctl enable rpcbind
systemctl enable nfs.net
修改配置文件(能夠從上一篇配置文檔拷貝過來修改,其餘數據庫,消息隊列,keystone配置不變去掉[lvm]配置添加nfs配置)
[nfs] #模塊路徑是/usr/lib/python2.7/site-packages/cinder/volume/drivers/nfs.py volume_driver=cinder.volume.drivers.nfs.NfsDriver nfs_shares_config = /etc/cinder/nfs_shares nfs_mount_point_base = $state_path/mnt
nfs_shares_config 設置NFS共享配置文件
nfs_mount_point_base 設置NFS掛載點
建立文件/etc/cinder/nfs_shares內容爲
192.168.0.115:/data/nfs
設置權限
chown root:cinder /etc/cinder/nfs_shares
chmod 640 /etc/cinder/nfs_shares
原配置文檔enabled_backends = lvm改成
[DEFAULT]
enabled_backends = nfs
啓動而且設置爲開機啓動
systemctl enable openstack-cinder-volume.service systemctl start openstack-cinder-volume.service
在控制節點查看是否註冊上
此時有兩種硬盤類型lvm和nfs
建立類型
在控制節點操做
cinder type-create NFS
cinder type-create ISCSI
把類型和存儲關聯起來
先在配置文件加類型
在ISCSI存儲節點上面[lvm]下添加
[lvm] volume_backend_name=ISCSI-Storage
在nfs存儲節點上面
[nfs] volume_backend_name=NSF-Storage
配置完的節點須要重啓
systemctl restart openstack-cinder-volume.service
把類型和存儲關聯起來(建立了兩個類型)
cinder type-key NFS set volume_backend_name=NFS-Storage cinder type-key NFS set volume_backend_name=ISCSI-Storage
驗證
使用demo登錄web界面
卷-建立卷 有卷的類型可選
cinder後端存儲步驟
1,把存儲準備好
2,安裝cinder-volume
3,編輯配置文件vim /etc/cinder/cinder.conf
[xxx]
volume_driver=xxx
xxx
xxx
4,設置名稱volume_backend_nam=xxx-Storage
啓動
5,建立類型
cinder type-create xxx
6,關聯類型
cinder type-key xxx set volume_backend_name=xxx-Storage
練習:使用GlusterFS做爲cinder後端存儲