續:Openstack塊存儲cinder安裝配置
接上使用ISCSI作為後端存儲,使用NFS作為後端存儲配置
參考官方文檔:https://wiki.openstack.org/wiki/How_to_deploy_cinder_with_NFS
在node2節點做一個存儲
安裝軟體包
yum install openstack-cinder targetcli python-keystone
安裝nfs
yum -y install nfs-utils rpcbind
建立挂載目錄
mkdir -p /data/nfs
編輯配置檔案vim /etc/exports
/data/nsf *(rw,sync,no_root_squash)
啟動nfs
systemctl start rpcbind
systemctl start nfs
systemctl enable rpcbind
systemctl enable nfs
修改配置檔案(可以從上一篇配置文檔拷貝過來修改,其他資料庫,消息隊列,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後端存儲
轉載于:https://www.cnblogs.com/minseo/p/8506437.html