二、准备一台单独的cinder节点
虚拟机设置
虚拟网络编辑器设置:
外部网络:
管理网络
____________________________________________________________________________________________________________________________________
正式部署
一.环境准备
先按照我的文章将基本环境弄好,也就是
OpenStack-M版(Mitaka)搭建基于(Centos7.2)+++二、Openstack环境准备篇上
OpenStack-M版(Mitaka)搭建基于(Centos7.2)+++二、Openstack环境准备篇中
OpenStack-M版(Mitaka)搭建基于(Centos7.2)+++二、Openstack环境准备篇下
照着compute的设置完成环境准备
cinder外部网络:192.168.200.50
cinder管理网络:192.168.100.50
完成后继续下一步
二.配置控制节点
mysql -uroot -p
CREATE DATABASE cinder;
GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' IDENTIFIED BY '123456';
[root@controller ~]# . admin-openrc
[root@controller ~]# openstack user create --domain default --password-prompt cinder
User Password:
Repeat User Password:
+-----------+----------------------------------+
| Field | Value |
+-----------+----------------------------------+
| domain_id | b24b3093654b4ba4be706fe675a03b2d |
| enabled | True |
| id | abf7418a5e90422cab6ae4df523cd850 |
| name | cinder |
+-----------+----------------------------------+
openstack role add --project service --user cinder admin
此操作无返回
4.创建 cinder 和 cinderv2 服务实体
openstack service create --name cinder --description "OpenStack Block Storage" volume
[root@controller ~]# openstack service create --name cinder \
> --description "OpenStack Block Storage" volume
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Block Storage |
| enabled | True |
| id | 148fef5f0fae4569b7f7d89d855c7066 |
| name | cinder |
| type | volume |
+-------------+----------------------------------+
[root@controller ~]# openstack service create --name cinderv2 \
> --description "OpenStack Block Storage" volumev2
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Block Storage |
| enabled | True |
| id | a041d71904364c59a5e65ef49450db70 |
| name | cinderv2 |
| type | volumev2 |
+-------------+----------------------------------+
openstack endpoint create --region RegionOne volume public http://controller:8776/v1/%\ (tenant_id\ )s
openstack endpoint create --region RegionOne volume internal http://controller:8776/v1/%\ (tenant_id\ )s
openstack endpoint create --region RegionOne volume admin http://controller:8776/v1/%\ (tenant_id\ )s
volume:
[root@controller ~]# openstack endpoint create --region RegionOne volume public http://controller:8776/v1/%(tenant_id)s
+--------------+-----------------------------------------+
| Field | Value |
+--------------+-----------------------------------------+
| enabled | True |
| id | 764744c5a9ce488f98d65f6d9c38b86a |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 148fef5f0fae4569b7f7d89d855c7066 |
| service_name | cinder |
| service_type | volume |
| url | http://controller:8776/v1/%(tenant_id)s |
+--------------+-----------------------------------------+
[root@controller ~]# openstack endpoint create --region RegionOne volume internal http://controller:8776/v1/%(tenant_id)s
+--------------+-----------------------------------------+
| Field | Value |
+--------------+-----------------------------------------+
| enabled | True |
| id | 563d6c54f3cd4ad293cd86aec1a7c20f |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 148fef5f0fae4569b7f7d89d855c7066 |
| service_name | cinder |
| service_type | volume |
| url | http://controller:8776/v1/%(tenant_id)s |
+--------------+-----------------------------------------+
[root@controller ~]# openstack endpoint create --region RegionOne volume admin http://controller:8776/v1/%(tenant_id)s
+--------------+-----------------------------------------+
| Field | Value |
+--------------+-----------------------------------------+
| enabled | True |
| id | ad5bf2d6772046958d6cbba29af5201d |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 148fef5f0fae4569b7f7d89d855c7066 |
| service_name | cinder |
| service_type | volume |
| url | http://controller:8776/v1/%(tenant_id)s |
+--------------+-----------------------------------------+
volume2:
openstack endpoint create --region RegionOne volumev2 public http://controller:8776/v2/%\(tenant_id\)s
openstack endpoint create --region RegionOne volumev2 internal http://controller:8776/v2/%\(tenant_id\)s
openstack endpoint create --region RegionOne volumev2 admin http://controller:8776/v2/%\(tenant_id\)s
[root@controller ~]# openstack endpoint create --region RegionOne volumev2 public http://controller:8776/v2/%(tenant_id)s
+--------------+-----------------------------------------+
| Field | Value |
+--------------+-----------------------------------------+
| enabled | True |
| id | aa5366acb5634b6dbd4dd3e86d8115be |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | a041d71904364c59a5e65ef49450db70 |
| service_name | cinderv2 |
| service_type | volumev2 |
| url | http://controller:8776/v2/%(tenant_id)s |
+--------------+-----------------------------------------+
[root@controller ~]# openstack endpoint create --region RegionOne volumev2 internal http://controller:8776/v2/%(tenant_id)s
+--------------+-----------------------------------------+
| Field | Value |
+--------------+-----------------------------------------+
| enabled | True |
| id | 0f0ea4d5f5914717b196f8b7cb6d17ae |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | a041d71904364c59a5e65ef49450db70 |
| service_name | cinderv2 |
| service_type | volumev2 |
| url | http://controller:8776/v2/%(tenant_id)s |
+--------------+-----------------------------------------+
[root@controller ~]# openstack endpoint create --region RegionOne volumev2 admin http://controller:8776/v2/%(tenant_id)s
+--------------+-----------------------------------------+
| Field | Value |
+--------------+-----------------------------------------+
| enabled | True |
| id | c616c24c31e34d20b6e860e609109ceb |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | a041d71904364c59a5e65ef49450db70 |
| service_name | cinderv2 |
| service_type | volumev2 |
| url | http://controller:8776/v2/%(tenant_id)s |
+--------------+-----------------------------------------+
安装配置:
1.安装软件包
yum install openstack-cinder
yum install openstack-cinder
vi /etc/cinder/cinder.conf
[DEFAULT]
rpc_backend = rabbit#启用消息队列
auth_strategy = keystone#启用keystone认证
my_ip = 192.168.100.10#控制节点管理接口ip地址
配置数据库访问
[database]
connection = mysql+pymysql://cinder:123456@controller/cinder
配置消息队列
[oslo_messaging_rabbit]
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = 123456
配置认证服务访问
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = 123456
配置锁路径
[oslo_concurrency]
lock_path = /var/lib/cinder/tmp
3.初始化块设备服务的数据库
su -s /bin/sh -c "cinder-manage db sync" cinder
[root@controller ~]# su -s /bin/sh -c "cinder-manage db sync" cinder
Option "logdir" from group "DEFAULT" is deprecated. Use option "log-dir" from group "DEFAULT".
2017-11-28 07:01:31.212 53220 WARNING py.warnings [-] /usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py:241: NotSupportedWarning: Configuration option(s) ['use_tpool'] not supported
exception.NotSupportedWarning
2017-11-28 07:01:34.318 53220 INFO migrate.versioning.api [-] 0 -> 1...
2017-11-28 07:01:36.365 53220 INFO migrate.versioning.api [-] done
2017-11-28 07:01:36.365 53220 INFO migrate.versioning.api [-] 1 -> 2...
2017-11-28 07:01:39.636 53220 INFO migrate.versioning.api [-] done
2017-11-28 07:01:39.637 53220 INFO migrate.versioning.api [-] 2 -> 3...
2017-11-28 07:01:41.062 53220 INFO migrate.versioning.api [-] done
2017-11-28 07:01:41.063 53220 INFO migrate.versioning.api [-] 3 -> 4...
....
....
....
2017-11-28 07:02:00.633 53220 INFO migrate.versioning.api [-] done
2017-11-28 07:02:00.633 53220 INFO migrate.versioning.api [-] 69 -> 70...
2017-11-28 07:02:00.647 53220 INFO migrate.versioning.api [-] done
2017-11-28 07:02:00.648 53220 INFO migrate.versioning.api [-] 70 -> 71...
2017-11-28 07:02:00.666 53220 INFO migrate.versioning.api [-] done
2017-11-28 07:02:00.666 53220 INFO migrate.versioning.api [-] 71 -> 72...
2017-11-28 07:02:00.687 53220 INFO migrate.versioning.api [-] done
计算节点修改配置文件/etc/nova/nova.conf
vi /etc/nova/nova.conf
配置计算节点使用块设备存储
[cinder]
os_region_name = RegionOne
systemctl restart openstack-nova-api.service
systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service
三.配置cinder节点
1.安装软件包
yum install openstack-cinder targetcli python-keystone
yum install openstack-cinder targetcli python-keystone
vi /etc/cinder/cinder.conf
[DEFAULT]
rpc_backend = rabbit#启用消息队列
auth_strategy = keystone#启用keystone认证
my_ip = 192.168.100.10#控制节点管理接口ip地址
glance_api_servers = http://controller:9292#配置镜像api位置
配置数据库访问
[database]
connection = mysql+pymysql://cinder:123456@controller/cinder
配置消息队列
[oslo_messaging_rabbit]
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = 123456
配置认证服务访问
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = 123456
配置锁路径
[oslo_concurrency]
lock_path = /var/lib/cinder/tmp
systemctl enable openstack-cinder-volume.service target.service
systemctl start openstack-cinder-volume.service target.service
四.完成安装
cinder service-list
. admin-openrc
[root@controller ~]# cinder service-list
+------------------+------------+------+---------+-------+----------------------------+-----------------+
| Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
+------------------+------------+------+---------+-------+----------------------------+-----------------+
| cinder-scheduler | controller | nova | enabled | up | 2017-11-28T12:13:56.000000 | - |
| cinder-volume | cinder | nova | enabled | up | 2017-11-28T12:13:07.000000 | - |
+------------------+------------+------+---------+-------+----------------------------+-----------------+