cinder是openstack中提供块存储服务的组件,主要是为虚拟机实例提供虚拟磁盘。

通过某种协议(SAS,SCSI,SAN,iSCSI等)挂接裸硬盘,然后分区、格式化创建的文件,或者直接使用裸硬盘存储数据的方式叫做块存储,每个裸硬盘通常也叫做Volume(卷)。

通过nfs,cifs等协议,需要挂载的远程文件系统,叫做文件系统存储。

cinder流程

 1)用户 向 API 发送请求

    2)api对请求做一些必要的处理后,向messaging(rabbitmq)发送信息,让scheduler创建一个volume

3) scheduler从messaging获取到api发送的消息,然后执行调度算法,从若干存储节点选出节点A

4) scheduler向messaging发送一条消息,让存储节点创建volume

5)存储节点的volume 从messaging中获取到scheduler发给它的消息,然后通过driver在volume provider上创建volume

以下部分在controller节点进行配置

cinder暂时只做了controller节点部分

在安装和配置Block Storage 服务之前,必须创建数据库,服务凭证,和API节点并授予合适的权限:

cinder配置

在控制节点上创建数据库,并授权用户,参考命令

MariaDB [(none)]> CREATE DATABASE cinder;

为cinder数据库授权

MariaDB [(none)]> GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' \
IDENTIFIED BY 'CINDER_DBPASS';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' \
IDENTIFIED BY 'CINDER_DBPASS'; 'CINDER_DBPASS' 设置自己的密码

取得管理员凭据,以访问仅管理员的CLI命令:

$ . admin-openrc       这是个脚本文件,你之前需要添加的所有系统环境变量  没有可以新建一个

创建一个cinder用户

$ openstack 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角色到用户cinder中

$ openstack role add --project service --user cinder admin

创建cinderv2和cinderv3服务实体:

$ openstack 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 |
+-------------+----------------------------------+

Note:

块存储服务需要两个服务实体。

创建块存储服务API端点:

$ 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 |
+--------------+------------------------------------------+

volumev3:

$ 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 |
+--------------+------------------------------------------+ $ 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 |
+--------------+------------------------------------------+ $ 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

编辑配置文件/etc/cinder/cinder.conf

在【database】节点,配置数据库访问入口

[database]
# ...
connection = mysql+pymysql://cinder:CINDER_DBPASS@controller/cinder CINDER_DBPASS改为cinder数据库的密码

在【DEFAULT】节点,配置RabbitMQ消息队列访问

[DEFAULT]
# ...
transport_url = rabbit://openstack:RABBIT_PASS@controller openstack:RABBIT_PASS 改为消息队列里创建的用户名和密码

在[DEFAULT]和[keystone_authtoken]部分中,配置身份服务访问:

[DEFAULT]
# ...
auth_strategy = keystone [keystone_authtoken]
# ...
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:
auth_type = password
project_domain_id = default
user_domain_id = default
project_name = service
username = cinder
password = CINDER_PASS //改为cinder的密码

在[DEFAULT]部分中,配置my_ip选项以使用控制器节点的管理接口IP地址:

[DEFAULT]
# ...
my_ip = 10.0.0.11 //controller节点IP

在[oslo_concurrency]部分中,配置锁定路径:

[oslo_concurrency]
# ...
lock_path = /var/lib/cinder/tmp

填充数据库

# su -s /bin/sh -c "cinder-manage db sync" cinder

如果出现上述结果,属于正常。

配置计算服务以使用块存储

编辑/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.service

# systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service

cinder安装与配置的更多相关文章

  1. (八)OpenStack---M版---双节点搭建---Cinder安装和配置

    ↓↓↓↓↓↓↓↓视频已上线B站↓↓↓↓↓↓↓↓ >>>>>>传送门 1.创建数据库并授权 2.获得admin凭证执行管理员命令并创建服务证书 3.创建块存储设备AP ...

  2. Openstack入门篇(十七)之Cinder服务-->安装并配置一个本地存储节点

    怎样为块存储服务安装并配置存储节点.为简单起见,这里配置一个有一个空的本地块存储设备的存储节点.这个向导用的是 /dev/sdb,此处选用linux-node1节点作为存储节点,需要在vmware中添 ...

  3. Openstack块存储cinder安装配置

    openstack service create --name cinderv2 \ --description "OpenStack Block Storage" volumev ...

  4. 理解 OpenStack Swift (1):OpenStack + 三节点Swift 集群+ HAProxy + UCARP 安装和配置

    本系列文章着重学习和研究OpenStack Swift,包括环境搭建.原理.架构.监控和性能等. (1)OpenStack + 三节点Swift 集群+ HAProxy + UCARP 安装和配置 ( ...

  5. OpenStack-Ocata版+CentOS7.6 云平台环境搭建 —9.块存储服务(cinder)部署配置

    块存储服务部署相关块存储服务(cinder)为实例提供块存储.存储的分配和消耗是由块存储驱动器,或者多后端配置的驱动器决定的.还有很多驱动程序可用:NAS/SAN,NFS,ISCSI,Ceph等.典型 ...

  6. OpenStack-Ocata版+CentOS7.6 云平台环境搭建 — 6.在计算节点上安装并配置计算服务Nova

    安装和配置计算节点这个章节描述如何在计算节点上安装和配置计算服务. 计算服务支持几种不同的 hypervisors.为了简单起见,这个配置在计算节点上使用 :KVM <kernel-based ...

  7. 【OpenStack Cinder】Cinder安装时遇到的一些坑

    最近需要安装Cinder组件,然后遇到了两个比较蛋疼的错误导致controller节点输入cinder service-list一直不能显示cinder节点上的cinder-volume服务. 错误1 ...

  8. S1_搭建分布式OpenStack集群_09 cinder 控制节点配置

    一.创建数据库创建数据库以及用户:# mysql -uroot -p12345678MariaDB [(none)]> CREATE DATABASE cinder;MariaDB [(none ...

  9. 025-Cinder服务-->安装并配置一个本地存储节点(ISCSI)

    一:Cinder提供块级别的存储服务,块存储提供一个基础设施为了管理卷,以及和OpenStack计算服务交互,为实例提供卷.此服务也会激活管理卷的快照和卷类型的功能,块存储服务通常包含下列组件:cin ...

随机推荐

  1. getElementById()

    getElementById():方法的用途是寻找一个有着给定id属性值得元素: element = document.getElementById(ID); 这个方法将返回一个有着给定id属性值得元 ...

  2. IDEA 更改提示一键补全快捷键

    偏好设置-->KeyMap-->用关键字搜索可以用下面图中的任意词只要能定位到就是可以的 (Choose Lookup Item Replace)然后增加想用的键,个人喜欢直接加一个空格

  3. webpack4.0(二)--热更新

    webpack4.0---热更新 使用webpack可帮助我们的开发以及打包,在开发过程中,有时候我们只修改了部分代码并想不必刷新整个页面即可看到更改后的效果,这时候 webpack-dev-serv ...

  4. 洛谷 题解 P5595 【【XR-4】歌唱比赛】

    本蒟蒻又双叒叕被爆踩了. 考试时一遍过 其实这题还是很简单的,难度不会大于普及组T1. CSP 2019 RP++ 看开始看到题目,觉得特别长,不想看... 我来和你们分析分析题目,你们就都可以秒了. ...

  5. 高质量iOS博客推荐

    https://www.jianshu.com/p/ea9fabdc12ed 原文地址 原作者记录了一些高质量ios博客地址,本文只做收藏使用.

  6. git 使用详解(10)-- 远程分支

    远程分支 远程分支(remote branch)是对远程仓库中的分支的索引.它们是一些无法移动的本地分支:只有在Git 进行网络交互时才会更新.远程分支就像是书签,提醒着你上次连接远程仓库时上面各分支 ...

  7. 【数据结构05】红-黑树基础----二叉搜索树(Binary Search Tree)

    目录 1.二分法引言 2.二叉搜索树定义 3.二叉搜索树的CRUD 4.二叉搜索树的两种极端情况 5.二叉搜索树总结 前言 在[算法04]树与二叉树中,已经介绍过了关于树的一些基本概念以及二叉树的前中 ...

  8. java概述和java环境按照,java开发体验

    java概述: Java的发展可以归纳如下的几个阶段. (1)第一阶段(完善期):JDK 1.0 ( 1995年推出)一JDK 1.2 (1998年推出,Java更名为Java 2): (2)第二阶段 ...

  9. 《JavaScript 正则表达式迷你书》知识点小抄本

    介绍 这周开始学习老姚大佬的<JavaScript 正则表达式迷你书> , 然后习惯性的看完一遍后,整理一下知识点,便于以后自己重新复习. 我个人觉得:自己整理下来的资料,对于知识重现,效 ...

  10. forEach()和for/in循环的缺点与for-of循环

    以数组为例,JavaScript 提供多种遍历语法.最原始的写法就是for循环. for (var index = 0; index < myArray.length; index++) { c ...