本文主要是介绍openstack Queens版本在centos7.1,最小化安装(安装Cinder(控制节点 ),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
在数据库中创建cinder库和用户并授权
[root@controller ~]# mysql -u root -ptest.2018
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 252
Server version: 10.1.20-MariaDBMariaDB Server
Copyright (c) 2000, 2016, Oracle,MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type'\c' to clear the current input statement.
MariaDB [(none)]> CREATE DATABASEcinder;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> GRANT ALLPRIVILEGES ON cinder.* TO 'cinder'@'localhost' \
-> IDENTIFIED BY 'test.2018';
Query OK, 0 rows affected (0.06 sec)
MariaDB [(none)]> GRANT ALLPRIVILEGES ON cinder.* TO 'cinder'@'%' \
-> IDENTIFIED BY 'test.2018';
Query OK, 0 rows affected (0.00 sec)
**********************************************************************
[root@controller ~]# openstack usercreate --domain default --password-prompt cinder
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id |9e570b85c8eb42f6b2d27176823ba0e0 |
| name | cinder |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+
[root@controller ~]# openstack roleadd --project service --user cinder admin
[root@controller ~]# openstack servicecreate --name cinderv2 \
> --description "OpenStack Block Storage" volumev2
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack BlockStorage |
| enabled | True |
| id | cf9211aeff9745b0bd383b6c203e7d85 |
| name | cinderv2 |
| type | volumev2 |
+-------------+----------------------------------+
You have new mail in/var/spool/mail/root
[root@controller ~]# openstackservice create --name cinderv3 \
> --description "OpenStack Block Storage" volumev3
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack BlockStorage |
| enabled | True |
| id | f2c6d5c9b8104d75b0b11caeebee2622 |
| name | cinderv3 |
| type | volumev3 |
+-------------+----------------------------------+
[root@controller ~]# openstackendpoint create --region RegionOne \
> volumev2 public http://controller:8776/v2/%\(project_id\)s
+--------------+------------------------------------------+
| Field | Value |
+--------------+------------------------------------------+
| enabled | True |
| id |f98acd01b64b43fc9386479aaf1e8397 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | cf9211aeff9745b0bd383b6c203e7d85 |
| service_name | cinderv2 |
| service_type | volumev2 |
| url | http://controller:8776/v2/%(project_id)s|
+--------------+------------------------------------------+
[root@controller ~]# openstackendpoint create --region RegionOne \
> volumev2 internal http://controller:8776/v2/%\(project_id\)s
+--------------+------------------------------------------+
| Field | Value |
+--------------+------------------------------------------+
| enabled | True |
| id |ba5f1f31a6c74c66be64264be1838c53 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | cf9211aeff9745b0bd383b6c203e7d85 |
| service_name | cinderv2 |
| service_type | volumev2 |
| url | http://controller:8776/v2/%(project_id)s|
+--------------+------------------------------------------+
[root@controller ~]# openstackendpoint create --region RegionOne \
> volumev2 admin http://controller:8776/v2/%\(project_id\)s
+--------------+------------------------------------------+
| Field | Value |
+--------------+------------------------------------------+
| enabled | True |
| id |418b3ae7f9de44be8b30b2830147d88d |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | cf9211aeff9745b0bd383b6c203e7d85 |
| service_name | cinderv2 |
| service_type | volumev2 |
| url | http://controller:8776/v2/%(project_id)s|
+--------------+------------------------------------------+
[root@controller ~]# openstackendpoint create --region RegionOne \
> volumev3 public http://controller:8776/v3/%\(project_id\)s
+--------------+------------------------------------------+
| Field | Value |
+--------------+------------------------------------------+
| enabled | True |
| id |d8bd399d2b1642c0aa3059efcdb1b13c |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | f2c6d5c9b8104d75b0b11caeebee2622 |
| service_name | cinderv3 |
| service_type | volumev3 |
| url | http://controller:8776/v3/%(project_id)s|
+--------------+------------------------------------------+
[root@controller ~]# openstackendpoint create --region RegionOne \
> volumev3 internal http://controller:8776/v3/%\(project_id\)s
+--------------+------------------------------------------+
| Field | Value |
+--------------+------------------------------------------+
| enabled | True |
| id |d75d945d115a4eaeb9a4115c8d031e56 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | f2c6d5c9b8104d75b0b11caeebee2622 |
| service_name | cinderv3 |
| service_type | volumev3 |
| url | http://controller:8776/v3/%(project_id)s|
+--------------+------------------------------------------+
You have new mail in /var/spool/mail/root
[root@controller ~]# openstackendpoint create --region RegionOne \
> volumev3 admin http://controller:8776/v3/%\(project_id\)s
+--------------+------------------------------------------+
| Field | Value |
+--------------+------------------------------------------+
| enabled | True |
| id |f958ebc0bb9e42d98e217565e4e8e2c5 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | f2c6d5c9b8104d75b0b11caeebee2622 |
| service_name | cinderv3 |
| service_type | volumev3 |
| url | http://controller:8776/v3/%(project_id)s|
+--------------+------------------------------------------+
[root@controller ~]#
**********************************************************************
安装
yum install openstack-cinder -y
修改配置文件
/etc/cinder/cinder.conf
[DEFAULT]
transport_url = rabbit://openstack:test.2018@controller
auth_strategy = keystone
my_ip = 10.0.2.111
[database]
connection = mysql+pymysql://cinder:test.2018@controller/cinder
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_id = default
user_domain_id = default
project_name = service
username = cinder
password = test.2018
[oslo_concurrency]
lock_path = /var/lib/cinder/tmp
初始化数据库
[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".
配置Compute以使用块存储???
Vim /etc/nova/nova.conf
[cinder]
os_region_name=RegionOne
重启服务
# systemctl restartopenstack-nova-api.service
systemctl restartopenstack-nova-api.service
systemctl enableopenstack-cinder-api.service openstack-cinder-scheduler.service
systemctl restart openstack-cinder-api.serviceopenstack-cinder-scheduler.service
验证
soure admin-openrc
[root@controller nova]# openstackvolume service list
这篇关于openstack Queens版本在centos7.1,最小化安装(安装Cinder(控制节点 )的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!