openstack安装newton版本dashboard+cinder(六)

一、dashboard

  1、安装dashboard及配置  

[root@linux-node1 ~]# yum install openstack-dashboard -y   #可以装任何地方只要能连接[root@linux-node1 ~]#  grep -n "^[a-Z]"   /etc/openstack-dashboard/local_settings
3:import os
5:from django.utils.translation import ugettext_lazy as _
8:from openstack_dashboard import exceptions
9:from openstack_dashboard.settings import HORIZON_CONFIG
11:DEBUG = False
16:WEBROOT = '/dashboard/'
29:ALLOWED_HOSTS = ['*', 'localhost']
55:OPENSTACK_API_VERSIONS = {
74:OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = 'default'
114:LOCAL_PATH = '/tmp'
125:SECRET_KEY='751890c0cef51ef6fbac'
130:CACHES = {
137:CACHES = {
144:EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
160:OPENSTACK_HOST = "172.22.0.218"
161:OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST
162:OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user"
210:OPENSTACK_KEYSTONE_BACKEND = {
257:OPENSTACK_HYPERVISOR_FEATURES = {
266:OPENSTACK_CINDER_FEATURES = {
273:OPENSTACK_NEUTRON_NETWORK = {
328:OPENSTACK_HEAT_STACK = {
354:IMAGE_CUSTOM_PROPERTY_TITLES = {
366:IMAGE_RESERVED_CUSTOM_PROPERTIES = []
394:API_RESULT_LIMIT = 1000
395:API_RESULT_PAGE_SIZE = 20
398:SWIFT_FILE_TRANSFER_CHUNK_SIZE = 512 * 1024
401:INSTANCE_LOG_LENGTH = 35
404:DROPDOWN_MAX_ITEMS = 30
408: TIME_ZONE = "Asia/Shanghai"
441:POLICY_FILES_PATH = '/etc/openstack-dashboard'
481:LOGGING = {
605:SECURITY_GROUP_RULES = {
753:REST_API_REQUIRED_SETTINGS = ['OPENSTACK_HYPERVISOR_FEATURES',
820:ALLOWED_PRIVATE_SUBNET_CIDR = {'ipv4': [], 'ipv6': []}
[root@linux-node1 ~]# systemctl restart httpd
[root@linux-node1 conf.d]# ls
autoindex.conf  openstack-dashboard.conf  README  userdir.conf  welcome.conf  wsgi-keystone.conf

View Code

  2、登录测试

  

二、cinder部署:

  一)控制节点部署

  1、安装及部署配置:  

[root@linux-node1 ~]# yum install openstack-cinder
[root@linux-node1~]# vi /etc/cinder/cinder.conf
[DEFAULT]
transport_url = rabbit://openstack:RABBIT_PASS@controller
auth_strategy = keystone
my_ip = 172.22.0.218
enabled_backends = lvm
rpc_backend = rabbit
[database]connection = mysql+pymysql://cinder:cinder@172.22.0.218/cinder
[keystone_authtoken]
[keystone_authtoken]
auth_uri = http://172.22.0.218:5000
auth_url = http://172.22.0.218:35357
auth_plugin = password
memcached_servers = 172.22.0.218:11211
project_domain_id = d21d0715890447fb87f72e85dce6d4be
user_domain_id = d21d0715890447fb87f72e85dce6d4be
project_name = service
username = cinder
password = cinder
[oslo_concurrency]
lock_path = /var/lib/cinder/tmp
[oslo_messaging_rabbit]
rabbit_host = 172.22.0.218
rabbit_port = 5672
rabbit_userid = openstack
rabbit_password = openstack
[root@linux-node1 ~]# grep -n "^[a-Z]" /etc/cinder/cinder.conf
614:my_ip = 172.22.0.218
727:auth_strategy = keystone
731:enabled_backends = lvm
3059:rpc_backend = rabbit
3399:connection = mysql://cinder:cinder@172.22.0.218/cinder
3555:auth_uri = http://172.22.0.218:5000
3556:auth_url = http://172.22.0.218:35357
3557:auth_plugin = password
3558:memcached_servers = 172.22.0.218:11211
3559:project_domain_id = d21d0715890447fb87f72e85dce6d4be
3560:user_domain_id = d21d0715890447fb87f72e85dce6d4be
3561:project_name = service
3562:username = cinder
3563:password = cinder
3764:lock_path = /var/lib/cinder/tmp
3943:transport_url = rabbit://openstack:openstack@172.22.0.218
4010:rabbit_host = 172.22.0.218
4020:rabbit_port = 5672
4038:rabbit_userid = openstack
4045:rabbit_password = openstack
[root@linux-node1 ~]# vi /etc/nova/nova.conf
[cinder]
os_region_name = RegionOne

View Code

  2、同步数据库:  

[root@linux-node1 ~]# su -s /bin/sh -c "cinder-manage db sync" cinder
检查:
[root@linux-node1 ~]# mysql -ucinder -pcinder -e "use cinder;show tables;"
+----------------------------+
| Tables_in_cinder           |
+----------------------------+
| backups                    |
| cgsnapshots                |
| clusters                   |
| consistencygroups          |
| driver_initiator_data      |
| encryption                 |
| group_snapshots            |
| group_type_projects        |
| group_type_specs           |
| group_types                |
| group_volume_type_mapping  |
| groups                     |
| image_volume_cache_entries |
| messages                   |
| migrate_version            |
| quality_of_service_specs   |
| quota_classes              |
| quota_usages               |
| quotas                     |
| reservations               |
| services                   |
| snapshot_metadata          |
| snapshots                  |
| transfers                  |
| volume_admin_metadata      |
| volume_attachment          |
| volume_glance_metadata     |
| volume_metadata            |
| volume_type_extra_specs    |
| volume_type_projects       |
| volume_types               |
| volumes                    |
| workers                    |
+----------------------------+

View Code

  3、创建一个cinder用户,加入service项目,给予admin角色

[root@linux-node1 ~]# openstack user create --domain default --password-prompt cinder
Missing value auth-url required for auth plugin password
[root@linux-node1 ~]# source admin-openrc.sh
[root@linux-node1 ~]# openstack user create --domain default --password-prompt cinder
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | d21d0715890447fb87f72e85dce6d4be |
| enabled             | True                             |
| id                  | e86f70b51070480e877582499e946d43 |
| name                | cinder                           |
| password_expires_at | None                             |
+---------------------+----------------------------------+

View Code

  4、重启nova-api服务和启动cinder服务

root@linux-node1 ~]# systemctl restart openstack-nova-api.service
[root@linux-node1 ~]# systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-cinder-api.service to /usr/lib/systemd/system/openstack-cinder-api.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-cinder-scheduler.service to /usr/lib/systemd/system/openstack-cinder-scheduler.service.[root@linux-node1 ~]# systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service

View Code

  5、创建服务(包含V1和V2)

[root@linux-node1 ~]# openstack service create --name cinder   --description "OpenStack Block Storage" volume
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Block Storage          |
| enabled     | True                             |
| id          | b66ff1fce26541578a593ace098990ba |
| name        | cinder                           |
| type        | volume                           |
+-------------+----------------------------------+
[root@linux-node1 ~]#  openstack service create --name cinderv2   --description "OpenStack Block Storage" volumev2
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Block Storage          |
| enabled     | True                             |
| id          | 1fe87e672b714be0a278996bcce5cdf1 |
| name        | cinderv2                         |
| type        | volumev2                         |
+-------------+----------------------------------+

View Code

  6、分别对V1和V2创建三个环境(admin,internal,public)的endpoint

[root@linux-node1 ~]# openstack endpoint create --region RegionOne   volume public http://172.22.0.218:8776/v1/%\(tenant_id\)s
+--------------+-------------------------------------------+
| Field        | Value                                     |
+--------------+-------------------------------------------+
| enabled      | True                                      |
| id           | 9847cc9ba7754ec0adad1539f4d00147          |
| interface    | public                                    |
| region       | RegionOne                                 |
| region_id    | RegionOne                                 |
| service_id   | b66ff1fce26541578a593ace098990ba          |
| service_name | cinder                                    |
| service_type | volume                                    |
| url          | http://172.22.0.218:8776/v1/%(tenant_id)s |
+--------------+-------------------------------------------+
[root@linux-node1 ~]# openstack endpoint create --region RegionOne   volume internal http://172.22.0.218:8776/v1/%\(tenant_id\)s
+--------------+-------------------------------------------+
| Field        | Value                                     |
+--------------+-------------------------------------------+
| enabled      | True                                      |
| id           | 889fb8a25cca4ef69f43a6555ae54e77          |
| interface    | internal                                  |
| region       | RegionOne                                 |
| region_id    | RegionOne                                 |
| service_id   | b66ff1fce26541578a593ace098990ba          |
| service_name | cinder                                    |
| service_type | volume                                    |
| url          | http://172.22.0.218:8776/v1/%(tenant_id)s |
+--------------+-------------------------------------------+
[root@linux-node1 ~]# openstack endpoint create --region RegionOne   volume admin http://172.22.0.218:8776/v1/%\(tenant_id\)s
+--------------+-------------------------------------------+
| Field        | Value                                     |
+--------------+-------------------------------------------+
| enabled      | True                                      |
| id           | 20b783947c7a4f1d949042e86c90f792          |
| interface    | admin                                     |
| region       | RegionOne                                 |
| region_id    | RegionOne                                 |
| service_id   | b66ff1fce26541578a593ace098990ba          |
| service_name | cinder                                    |
| service_type | volume                                    |
| url          | http://172.22.0.218:8776/v1/%(tenant_id)s |
+--------------+-------------------------------------------+
[root@linux-node1 ~]# openstack endpoint create --region RegionOne   volumev2 public http://172.22.0.218:8776/v2/%\(tenant_id\)s
+--------------+-------------------------------------------+
| Field        | Value                                     |
+--------------+-------------------------------------------+
| enabled      | True                                      |
| id           | df0bd47a768c4e618118c32db1dd56c0          |
| interface    | public                                    |
| region       | RegionOne                                 |
| region_id    | RegionOne                                 |
| service_id   | 1fe87e672b714be0a278996bcce5cdf1          |
| service_name | cinderv2                                  |
| service_type | volumev2                                  |
| url          | http://172.22.0.218:8776/v2/%(tenant_id)s |
+--------------+-------------------------------------------+
[root@linux-node1 ~]# openstack endpoint create --region RegionOne   volumev2 internal http://172.22.0.218:8776/v2/%\(tenant_id\)s
+--------------+-------------------------------------------+
| Field        | Value                                     |
+--------------+-------------------------------------------+
| enabled      | True                                      |
| id           | 9e3d7909a63b4c4cb2865025361330c7          |
| interface    | internal                                  |
| region       | RegionOne                                 |
| region_id    | RegionOne                                 |
| service_id   | 1fe87e672b714be0a278996bcce5cdf1          |
| service_name | cinderv2                                  |
| service_type | volumev2                                  |
| url          | http://172.22.0.218:8776/v2/%(tenant_id)s |
+--------------+-------------------------------------------+
[root@linux-node1 ~]# openstack endpoint create --region RegionOne   volumev2 admin http://172.22.0.218:8776/v2/%\(tenant_id\)s
+--------------+-------------------------------------------+
| Field        | Value                                     |
+--------------+-------------------------------------------+
| enabled      | True                                      |
| id           | 42bf5096ab4346e9b9bbd940e9cd4ad1          |
| interface    | admin                                     |
| region       | RegionOne                                 |
| region_id    | RegionOne                                 |
| service_id   | 1fe87e672b714be0a278996bcce5cdf1          |
| service_name | cinderv2                                  |
| service_type | volumev2                                  |
| url          | http://172.22.0.218:8776/v2/%(tenant_id)s |
+--------------+-------------------------------------------+

View Code

  二)存储节点部署:

  1、添加硬盘  

[root@linux-node2 ~]# fdisk -l
Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00066457Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200    62914559    30407680   8e  Linux LVMDisk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/centos-root: 29.0 GB, 28982640640 bytes, 56606720 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/centos-swap: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
[root@linux-node2 ~]# systemctl start lvm2-lvmetad.service
创建一个pv和vg(名为cinder-volumes)
[root@linux-node2 ~]# pvcreate /dev/sdbPhysical volume "/dev/sdb" successfully created.
[root@linux-node2 ~]# vgcreate cinder-volumes /dev/sdbVolume group "cinder-volumes" successfully created
修改lvm的配置文件中添加filter,只有instance可以访问
[root@linux-node2 ~]# vim /etc/lvm/lvm.conf
devices {filter = [ "a/sdb/", "r/.*/"][root@linux-node2 ~]# systemctl enable lvm2-lvmetad.service
Created symlink from /etc/systemd/system/sysinit.target.wants/lvm2-lvmetad.service to /usr/lib/systemd/system/lvm2-lvmetad.service.[root@linux-node2 ~]# systemctl start lvm2-lvmetad.service

View Code

  2、从控制节点拷贝配置文件修改

[root@linux-node1 ~]# scp /etc/cinder/cinder.conf 172.22.0.209:/etc/cinder/cinder.conf
[lvm]     #自己添加
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_group = cinder-volumes
iscsi_protocol = iscsi
iscsi_helper = lioadm
[root@linux-node2 ~]# grep -n "^[a-Z]" /etc/cinder/cinder.conf
614:my_ip = 172.22.0.209
619:glance_api_servers = http://172.22.0.218:9292
727:auth_strategy = keystone
731:enabled_backends = lvm
3059:rpc_backend = rabbit
3399:connection = mysql://cinder:cinder@172.22.0.218/cinder
3555:auth_uri = http://172.22.0.218:5000
3556:auth_url = http://172.22.0.218:35357
3557:auth_plugin = password
3558:memcached_servers = 172.22.0.218:11211
3559:project_domain_id = d21d0715890447fb87f72e85dce6d4be
3560:user_domain_id = d21d0715890447fb87f72e85dce6d4be
3561:project_name = service
3562:username = cinder
3563:password = cinder
3764:lock_path = /var/lib/cinder/tmp
3943:transport_url = rabbit://openstack:openstack@172.22.0.218
4010:rabbit_host = 172.22.0.218
4020:rabbit_port = 5672
4038:rabbit_userid = openstack
4045:rabbit_password = openstack
4411:volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
4412:volume_group = cinder-volumes
4413:iscsi_protocol = iscsi
4414:iscsi_helper = lioadm

View Code

  3、添加服务

[root@linux-node2 ~]# systemctl enable openstack-cinder-volume.service target.service
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-cinder-volume.service to /usr/lib/systemd/system/openstack-cinder-volume.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/target.service to /usr/lib/systemd/system/target.service.
[root@linux-node2 ~]#
[root@linux-node2 ~]# systemctl start openstack-cinder-volume.service target.service

View Code

  4、查看云硬盘服务状态(如果是虚拟机作为宿主机,时间不同步,会产生无法发现存储节点)

[root@linux-node1 ~]# source admin-openrc.sh
[root@linux-node1 ~]# openstack volume service list
[root@linux-node1 ~]# openstack volume service list
+------------------+-----------------+------+---------+-------+----------------------------+
| Binary           | Host            | Zone | Status  | State | Updated At                 |
+------------------+-----------------+------+---------+-------+----------------------------+
| cinder-scheduler | linux-node1     | nova | enabled | up    | 2018-03-12T04:47:30.000000 |
| cinder-volume    | linux-node1     | nova | enabled | down  | 2018-03-12T03:43:19.000000 |
| cinder-volume    | linux-node2@lvm | nova | enabled | up    | 2018-03-12T04:47:21.000000 |
+------------------+-----------------+------+---------+-------+----------------------------+

View Code

至此可通过dashboard登录OpenStack查看云硬盘了!。

posted on 2018-03-19 09:30 Steward_Xu 阅读(...) 评论(...) 编辑 收藏

转载于:https://www.cnblogs.com/Steward-Xu/p/8599512.html

openstack安装newton版本dashboard+cinder(六)相关推荐

  1. openstack安装newton版本keyston部署(一)

    openstack安装newton版本keyston部署(一) 一.部署环境:     两台centos7,  内存2G 控制计算节点: Hostname1:                    i ...

  2. openstack 功能_2016年OpenStack的新功能:看一下Newton版本

    openstack 功能 OpenStack的发布周期为六个月,每个发行版都有一个代号,名称以字母的连续字母开头. 10月7日,OpenStack Newton发布了. 让我们看一下OpenStack ...

  3. newton版本linux,centos7.4下安装部署openstack newton版本 互联网技术圈 互联网技术圈...

    好消息OpenStack的爱好者,最新版本的OpenStack" Newton"已经发布了2016年10月6日,这是OpenStack的第14版本(开源云软件).以下是此版本中已注 ...

  4. OpenStack Ocata 安装(六)安装仪表盘(Dashboard)

    19.安装仪表盘(Dashboard) 修改配置文件(备份配置文件,此处无需删除该文件所有内容,只需修改即可,建议使用以下配置,注释需要修改的配置,防止出现失误): controller# cp /e ...

  5. OpenStack推出最新版本Newton,显著提升单一云平台 对虚拟化、裸机和容器的管理...

    2016年10月10日-北京- OpenStack社区日前发布其命名为"Newton"的第14个版本.OpenStack是用于构建云的部署最广泛的开源软件.此次推出的新功能包括:I ...

  6. OpenStack安装教程

    0.说明 本教程安装QueenS版本的OpenStack,采用all in one的方式安装(即:所有组件均安装在同一个机器上) 本教程亲测可用,已经部署完成 OpenStack官网安装手册:http ...

  7. Linux下基于Openstack安装部署私有云

    Openstack的帮助文档:https://docs.openstack.org/stein/ 一个购买私有云的网站:https://console.qingcloud.com/ 一.云计算 基本概 ...

  8. openstack安装和使用

    前言 本篇文章会介绍openstack的安装.openstack各组件的配置和功能.还会演示openstack云主机的创建流程,整篇文章花费一天时间完成,万字长文,需要的可以关注,相互学习,本篇文章总 ...

  9. openstack 安装windows系统

    openstack安装windows虚拟机的方法(Hyperisor为kvm) 2013-07-23 17:52:33 标签:openstack kvm windows win7系统 管理工具 原创作 ...

  10. 基于openstack安装部署私有云详细图文教程

    本文主要分享的是云计算.openstack的使用.私有云平台建设.云服务器云硬盘的构建和使用.从基本概念入手到私有云建设,信息量非常大.对于openstack的安装部署都是从官方文档中一步步的介绍,内 ...

最新文章

  1. 2018-12-10
  2. Fileupload-1.2.1使用简单样例
  3. 七十九、TodoList示例 深入Redux的工作流
  4. 上海内推 | 极氪智能科技百万年薪「氪学家」项目招聘规控/感知算法工程师
  5. zynqpl端时钟_第十二章 ZYNQ-MIZ702 PS读写PL端BRAM
  6. 经典面试题(32):以下代码将输出的结果是什么?
  7. 根本没人买!又一品牌宣布不再做手机了...
  8. linux使用什么ide编译安卓,抛弃IDE,使用gradle命令与vim构建安卓应用
  9. 对List.Sort的简单研究
  10. 不要抱怨,每个人的人生都不完美
  11. 勤哲Excel服务器在图书出版企业管理系统中的应用
  12. vue 倒计时插件_Vue的高性能和高精度倒计时插件
  13. 遥感导论网课_经典课程教材遥感导论.pdf
  14. excel导入mysql教程视频_excel数据导入SQL数据库的教程
  15. centos yum 安装php8 php8.0 使用remi源
  16. 服务器winsxs文件夹怎么清理工具,Winsxs文件夹内容怎么清理 Winsxs文件夹瘦身清理教程图解...
  17. 【Python实战】推文助手好用吗?真的能赚钱吗?教您一招,有了这款微信自动发送消息小助手,文字自动跳出来~赚麻了(赶紧收藏)
  18. LIDAR系列之2:用激光雷达检测车道线
  19. docker ss-pannel_如何构建Docker镜像
  20. 呕心沥血三天三夜整理出2021最新最全微信小程序开发资源汇总

热门文章

  1. 4200有linux版本么,如何检查Linux版本
  2. [Vue warn]: Error in render: “TypeError: Cannot read properties of undef
  3. java基础总结06-常用api类-api概述及jdk常用分类
  4. redis 字符串类型命令
  5. PHP REDIS 使用长连接多数据库存储到最后一个数据库中的问题解决
  6. 阶段1 语言基础+高级_1-3-Java语言高级_05-异常与多线程_第6节 Lambda表达式_8_Lambda省略格式Lambda使用前...
  7. el-dialog 一些问题 局中滚动
  8. LoggingFilter Session 以及Async
  9. openssl 升级
  10. weka连接mysql数据库