OpenStack的部署T版(七)——cinder模块
生活随笔
收集整理的這篇文章主要介紹了
OpenStack的部署T版(七)——cinder模块
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
OpenStack的部署T版(七)——cinder模塊
- 一、創建數據庫實例和角色
- 二、創建用戶、修改配置文件
- 三、在計算節點c2配置Cinder(存儲節點)
- 四、ct節點查看卷列表
一、創建數據庫實例和角色
CT節點
mysql -uroot -p CREATE DATABASE cinder; GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' IDENTIFIED BY 'CINDER_DBPASS'; GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' IDENTIFIED BY 'CINDER_DBPASS'; flush privileges; exit二、創建用戶、修改配置文件
創建cinder用戶,密碼設置為CINDER_PASS
openstack user create --domain default --password CINDER_PASS cinder把cinder用戶添加到service服務中,并授予admin權限
openstack role add --project service --user cinder admincinder有v2和v3兩個并存版本的API,所以需要創建兩個版本的service實例
openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2 openstack service create --name cinderv3 --description "OpenStack Block Storage" volumev3給v2和v3版本的api創建endpoint
openstack endpoint create --region RegionOne volumev2 public http://ct:8776/v2/%\(project_id\)sopenstack endpoint create --region RegionOne volumev2 internal http://ct:8776/v2/%\(project_id\)sopenstack endpoint create --region RegionOne volumev2 admin http://ct:8776/v2/%\(project_id\)sopenstack endpoint create --region RegionOne volumev3 public http://ct:8776/v3/%\(project_id\)sopenstack endpoint create --region RegionOne volumev3 internal http://ct:8776/v3/%\(project_id\)sopenstack endpoint create --region RegionOne volumev3 admin http://ct:8776/v3/%\(project_id\)s
yum 安裝cinder 服務
yum -y install openstack-cinder修改cinder 配置文件
cp /etc/cinder/cinder.conf{,.bak} grep -Ev '#|^$' /etc/cinder/cinder.conf.bak>/etc/cinder/cinder.confopenstack-config --set /etc/cinder/cinder.conf database connection mysql+pymysql://cinder:CINDER_DBPASS@ct/cinder openstack-config --set /etc/cinder/cinder.conf DEFAULT transport_url rabbit://openstack:RABBIT_PASS@ct openstack-config --set /etc/cinder/cinder.conf DEFAULT auth_strategy keystone openstack-config --set /etc/cinder/cinder.conf keystone_authtoken www_authenticate_uri http://ct:5000 openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_url http://ct:5000 openstack-config --set /etc/cinder/cinder.conf keystone_authtoken memcached_servers ct:11211 openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_type password openstack-config --set /etc/cinder/cinder.conf keystone_authtoken project_domain_name default openstack-config --set /etc/cinder/cinder.conf keystone_authtoken user_domain_name default openstack-config --set /etc/cinder/cinder.conf keystone_authtoken project_name service openstack-config --set /etc/cinder/cinder.conf keystone_authtoken username cinder openstack-config --set /etc/cinder/cinder.conf keystone_authtoken password CINDER_PASS openstack-config --set /etc/cinder/cinder.conf DEFAULT my_ip 192.168.100.10 openstack-config --set /etc/cinder/cinder.conf oslo_concurrency lock_path /var/lib/cinder/tmp
同步cinder數據庫(填充塊存儲數據庫)
su -s /bin/sh -c "cinder-manage db sync" cinder修改 Nova 配置文件,并重啟服務。
openstack-config --set /etc/nova/nova.conf cinder os_region_name RegionOnesystemctl restart openstack-nova-api.service配置Cinder服務
systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service配置控制節點驗證
cinder service-list三、在計算節點c2配置Cinder(存儲節點)
yum -y install openstack-cinder targetcli python-keystone yum -y install lvm2 device-mapper-persistent-data systemctl enable lvm2-lvmetad.service systemctl start lvm2-lvmetad.service創建lvm物理卷和卷組
pvcreate /dev/sdb vgcreate cinder-volumes /dev/sdb修改lvm配置文件(指定使用sdc磁盤)
vim /etc/lvm/lvm.conf 141行,取消注釋,修改filter規則,如下: filter = [ "a/sdb/","r/.*/" ] ## a表示允許,r表示拒絕 ## 只允許lvm服務訪問sdc中的數據,不允許lvm服務訪問其他磁盤,這也間接實現了openstack創建的虛擬機只能訪問sdb中的數據,不能訪問其他磁盤 ## 設置只允許實例訪問sdc邏輯卷中的數據;如果不配置的話,本機的其他服務也有可能會訪問sdc邏輯卷中的數據重啟lvm服務
systemctl restart lvm2-lvmetad.service配置cinder模塊
cp /etc/cinder/cinder.conf{,.bak} grep -Ev '#|^$' /etc/cinder/cinder.conf.bak>/etc/cinder/cinder.confopenstack-config --set /etc/cinder/cinder.conf database connection mysql+pymysql://cinder:CINDER_DBPASS@ct/cinder openstack-config --set /etc/cinder/cinder.conf DEFAULT transport_url rabbit://openstack:RABBIT_PASS@ct openstack-config --set /etc/cinder/cinder.conf DEFAULT auth_strategy keystone openstack-config --set /etc/cinder/cinder.conf DEFAULT my_ip 192.168.100.30 openstack-config --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm openstack-config --set /etc/cinder/cinder.conf DEFAULT glance_api_servers http://ct:9292 openstack-config --set /etc/cinder/cinder.conf keystone_authtoken www_authenticate_uri http://ct:5000 openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_url http://ct:5000 openstack-config --set /etc/cinder/cinder.conf keystone_authtoken memcached_servers ct:11211 openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_type password openstack-config --set /etc/cinder/cinder.conf keystone_authtoken project_domain_name default openstack-config --set /etc/cinder/cinder.conf keystone_authtoken user_domain_name default openstack-config --set /etc/cinder/cinder.conf keystone_authtoken project_name service openstack-config --set /etc/cinder/cinder.conf keystone_authtoken username cinder openstack-config --set /etc/cinder/cinder.conf keystone_authtoken password CINDER_PASS openstack-config --set /etc/cinder/cinder.conf lvm volume_driver cinder.volume.drivers.lvm.LVMVolumeDriver openstack-config --set /etc/cinder/cinder.conf lvm volume_group cinder-volumes openstack-config --set /etc/cinder/cinder.conf lvm target_protocol iscsi openstack-config --set /etc/cinder/cinder.conf lvm target_helper lioadm openstack-config --set /etc/cinder/cinder.conf oslo_concurrency lock_path /var/lib/cinder/tmp開啟cinder卷服務
systemctl enable openstack-cinder-volume.service target.service systemctl start openstack-cinder-volume.service target.service四、ct節點查看卷列表
openstack volume service list總結
以上是生活随笔為你收集整理的OpenStack的部署T版(七)——cinder模块的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 玩转游戏必备!apu超内存频率提升全攻略
- 下一篇: 内存CPU选购全攻略,让你秒变电脑达人