先放个链接,万一有人关注呢
优质文章推荐
↓ ↓ ↓ ↓ ↓
书接上回:OpenStack部署(T版本)第七篇——仪表盘服务(Horizon)
概述
环境部署
进入控制节点的数据库中
mysql -uroot -p123CREATE DATABASE cinder;授权数据库
GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' IDENTIFIED BY '123'GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' IDENTIFIED BY '123';
退出数据库
获得admin凭证用于获取管理员权限
source admin-openrcopenstack user create --domain default --password-prompt cinder输出两次密码,创建成功。输出如下
User Password:Repeat User Password:+---------------------+----------------------------------+| Field | Value |+---------------------+----------------------------------+| domain_id | default || enabled | True || id | 9d7e33de3e1a498390353819bc7d245d || name | cinder || options | {} || password_expires_at | None |+---------------------+----------------------------------+
将块存储服务用户添加到具有admin角色的服务项目
openstack role add --project service --user cinder adminopenstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2输出如下
+-------------+----------------------------------+| Field | Value |+-------------+----------------------------------+| description | OpenStack Block Storage || enabled | True || id | eb9fd245bdbc414695952e93f29fe3ac || name | cinderv2 || type | volumev2 |+-------------+----------------------------------+
openstack service create --name cinderv3 --description "OpenStack Block Storage" volumev3+-------------+----------------------------------+| Field | Value |+-------------+----------------------------------+| description | OpenStack Block Storage || enabled | True || id | ab3bbbef780845a1a283490d281e7fda || name | cinderv3 || type | volumev3 |+-------------+----------------------------------+
openstack endpoint create --region RegionOne \volumev2 public http://controller:8776/v2/%\(project_id\)s
输出如下
+--------------+------------------------------------------+| Field | Value |+--------------+------------------------------------------+| enabled | True || id | 513e73819e14460fb904163f41ef3759 || interface | public || region | RegionOne || region_id | RegionOne || service_id | eb9fd245bdbc414695952e93f29fe3ac || service_name | cinderv2 || service_type | volumev2 || url | http://controller:8776/v2/%(project_id)s |+--------------+------------------------------------------+
openstack endpoint create --region RegionOne \volumev2 internal http://controller:8776/v2/%\(project_id\)s
输出如下
+--------------+------------------------------------------+| Field | Value |+--------------+------------------------------------------+| enabled | True || id | 6436a8a23d014cfdb69c586eff146a32 || interface | internal || region | RegionOne || region_id | RegionOne || service_id | eb9fd245bdbc414695952e93f29fe3ac || service_name | cinderv2 || service_type | volumev2 || url | http://controller:8776/v2/%(project_id)s |+--------------+------------------------------------------+
openstack endpoint create --region RegionOne \volumev2 admin http://controller:8776/v2/%\(project_id\)s
输出如下
+--------------+------------------------------------------+| Field | Value |+--------------+------------------------------------------+| enabled | True || id | e652cf84dd334f359ae9b045a2c91d96 || interface | admin || region | RegionOne || region_id | RegionOne || service_id | eb9fd245bdbc414695952e93f29fe3ac || service_name | cinderv2 || service_type | volumev2 || url | http://controller:8776/v2/%(project_id)s |+--------------+------------------------------------------+
创建块存储服务API端点public v3
openstack endpoint create --region RegionOne \volumev3 public http://controller:8776/v3/%\(project_id\)s
输出如下
+--------------+------------------------------------------+| Field | Value |+--------------+------------------------------------------+| enabled | True || id | 03fa2c90153546c295bf30ca86b1344b || interface | public || region | RegionOne || region_id | RegionOne || service_id | ab3bbbef780845a1a283490d281e7fda || service_name | cinderv3 || service_type | volumev3 || url | http://controller:8776/v3/%(project_id)s |+--------------+------------------------------------------+
创建网络服务API端点internal v3
openstack endpoint create --region RegionOne \volumev3 internal http://controller:8776/v3/%\(project_id\)s
输出如下
+--------------+------------------------------------------+| Field | Value |+--------------+------------------------------------------+| enabled | True || id | 94f684395d1b41068c70e4ecb11364b2 || interface | internal || region | RegionOne || region_id | RegionOne || service_id | ab3bbbef780845a1a283490d281e7fda || service_name | cinderv3 || service_type | volumev3 || url | http://controller:8776/v3/%(project_id)s |+--------------+------------------------------------------+
创建网络服务API端点admin v3
openstack endpoint create --region RegionOne \volumev3 admin http://controller:8776/v3/%\(project_id\)s
输出如下
+--------------+------------------------------------------+| Field | Value |+--------------+------------------------------------------+| enabled | True || id | 4511c28a0f9840c78bacb25f10f62c98 || interface | admin || region | RegionOne || region_id | RegionOne || service_id | ab3bbbef780845a1a283490d281e7fda || service_name | cinderv3 || service_type | volumev3 || url | http://controller:8776/v3/%(project_id)s |+--------------+------------------------------------------+
在控制节点安装与配置网络
安装块存储服务相关组件
yum install openstack-cinder -y vi /etc/cinder/cinder.conf[database]# ...connection = mysql+pymysql://cinder:123@controller/cinder
[DEFAULT]# ...transport_url = rabbit://openstack:RABBIT_PASS@controller
[DEFAULT]# ...auth_strategy = keystone[keystone_authtoken]# ...www_authenticate_uri = http://controller:5000auth_url = http://controller:5000memcached_servers = controller:11211auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = cinderpassword = 123
[DEFAULT]# ...my_ip = 192.168.2.161
[oslo_concurrency]# ...lock_path = /var/lib/cinder/tmp
填充块存储数据库
su -s /bin/sh -c "cinder-manage db sync" cinder编辑/etc/nova/nova.conf文件
vi /etc/nova/nova.conf将块存储服务配置到计算服务中
[cinder]os_region_name = RegionOne
重新启动计算API服务
systemctl restart openstack-nova-api.service启动块存储服务并将其配置为在系统引导时启动
systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.servicesystemctl start openstack-cinder-api.service openstack-cinder-scheduler.servic
配置块存储节点基础环境
在块存储节点安装LVM软件包
yum install lvm2 device-mapper-persistent-data -y启动LVM元数据服务,并为其配置开机启动
systemctl enable lvm2-lvmetad.servicesystemctl start lvm2-lvmetad.service
创建LVM物理卷,这里需要两块磁盘
pvcreate /dev/sdb创建LVM卷组
vgcreate cinder-volumes /dev/sdb编辑/devcinder-volumes/etc/lvm/lvm.conf文件
vi /devcinder-volumes/etc/lvm/lvm.conf修改配置,指定项目使用的磁盘
devices {...filter = [ "a/sdb/", "r/.*/"]
在块存储节点安装块存储服务软件包
yum install openstack-cinder targetcli python-keystone -y编辑/etc/cinder/cinder.conf文件
vi /etc/cinder/cinder.conf在[database]部分中,配置数据库访问
[database]# ...connection = mysql+pymysql://cinder:123@controller/cinder
在[DEFAULT]部分中,配置消息队列访问
[DEFAULT]# ...transport_url = rabbit://openstack:123@controller
在[DEFAULT]和[keystone_authtoken]部分中,配置标识服务访问
[DEFAULT]# ...auth_strategy = keystone[keystone_authtoken]# ...www_authenticate_uri = http://controller:5000auth_url = http://controller:5000memcached_servers = controller:11211auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = cinderpassword = 123
在[DEFAULT]部分中,配置以下选项
[DEFAULT]# ...my_ip = 192.168.2.163
使用LVM驱动程序、卷组、iSCSI协议和相应的iSCSI服务配置LVM后端,如果文件内容不存在,那么直接添加到文件中
[lvm]volume_driver = cinder.volume.drivers.lvm.LVMVolumeDrivervolume_group = cinder-volumestarget_protocol = iscsitarget_helper = lioadm
在[DEFAULT]部分中,启用LVM后端
[DEFAULT]# ...enabled_backends = lvm
在[DEFAULT]部分中,配置影像服务API的位置
[DEFAULT]# ...glance_api_servers = http://controller:9292
在[oslo_concurrency]部分中,配置锁定路径
[oslo_concurrency]# ...lock_path = /var/lib/cinder/tmp
启动块存储卷服务(包括其依赖项),并配置开机自启
systemctl enable openstack-cinder-volume.service target.servicesystemctl start openstack-cinder-volume.service target.service
安装与配置备份服务
编辑/etc/cinder/cinder.conf文件
vi /etc/cinder/cinder.conf[DEFAULT]# ...backup_driver = cinder.backup.drivers.swift.SwiftBackupDriverbackup_swift_url = http://controller:8776/v3/%(project_id)s
启动块存储备份服务,并设置开机自启
systemctl enable openstack-cinder-backup.servicesystemctl start openstack-cinder-backup.service
验证操作
获取管理员权限
source admin-openrc列出服务组件以验证每个进程是否成功启动
openstack volume service list输出如下
+------------------+------------+------+---------+-------+----------------------------+| Binary | Host | Zone | Status | State | Updated_at |+------------------+------------+------+---------+-------+----------------------------+| cinder-scheduler | controller | nova | enabled | up | 2016-09-30T02:27:41.000000 || cinder-volume | block@lvm | nova | enabled | up | 2016-09-30T02:27:46.000000 || cinder-backup | controller | nova | enabled | up | 2016-09-30T02:27:41.000000 |+------------------+------------+------+---------+-------+----------------------------
打完收工!
来不及解释了,快上车!(进群看公告)

欢迎新的小伙伴加入!在这里,我们鼓励大家积极参与群内讨论和交流,分享自己的见解和经验,一起学习和成长。同时,也欢迎大家提出问题和建议,让我们不断改进和完善这个平台。
↓↓↓ 点个在看,你最好看!