openstack核心组件——cinder存储服务(11)
- 通过某种协议(SAS,SCSI,SAN,iSCSI 等)挂接裸硬盘,然后分区、格式化、创建文件系统;或者直接使用裸硬盘存储数据(数据库)
- 通过 NFS、CIFS 等 协议,mount 远程的文件系统
- 提供 REST API 使用户能够查询和管理 volume、volume snapshot 以及 volume type
- 提供 scheduler 调度 volume 创建请求,合理优化存储资源的分配
- 通过 driver 架构支持多种 back-end(后端)存储方式,包括 LVM,NFS,Ceph 和其他诸如 EMC、IBM 等商业存储产品和方案
![](http://learn.yunwei.edu/openstack-learn/cinder_files/640.jpg)
客户端可以将请求发送到 endponits 指定的地址,向 cinder-api 请求操作。 当然,作为最终用户的我们不会直接发送 Rest API 请求。OpenStack CLI,Dashboard 和其他需要跟 Cinder 交换的组件会使用这些 API。
cinder-api 接受哪些请求呢?简单的说,只要是 Volume 生命周期相关的操作,cinder-api 都可以响应。大部分操作都可以在 Dashboard 上看到。
通过 Driver 架构支持多种 Volume Provider
接着的问题是:现在市面上有这么多块存储产品和方案(volume provider),cinder-volume 如何与它们配合呢?
通过的 Driver 架构。 cinder-volume 为这些 volume provider 定义了统一的接口,volume provider 只需要实现这些接口,就可以 Driver 的形式即插即用到 OpenStack 系统中。
定期向 OpenStack 报告计算节点的状态
cinder-volume 会定期向 Cinder 报告存储节点的空闲容量来做筛选启动volume
实现 volume 生命周期管理
Cinder 对 volume 的生命周期的管理最终都是通过 cinder-volume 完成的,包括 volume 的 create、extend、attach、snapshot、delete 等。
![](http://learn.yunwei.edu/openstack-learn/cinder_files/Image%20[1].png)
![](http://learn.yunwei.edu/openstack-learn/cinder_files/640.png)
![](http://learn.yunwei.edu/openstack-learn/cinder_files/Image%20[2].png)
![](http://learn.yunwei.edu/openstack-learn/cinder_files/Image%20[3].png)
![](http://learn.yunwei.edu/openstack-learn/cinder_files/Image%20[4].png)
- 客户(可以是 OpenStack 最终用户,也可以是其他程序)向 API(cinder-api)发送请求:“帮我创建一个 volume”
- API 对请求做一些必要处理后,向 Messaging(RabbitMQ)发送了一条消息:“让 Scheduler 创建一个 volume”
- Scheduler(cinder-scheduler)从 Messaging 获取到 API 发给它的消息,然后执行调度算法,从若干计存储点中选出节点 A
- Scheduler 向 Messaging 发送了一条消息:“让存储节点 A 创建这个 volume”
- 存储节点 A 的 Volume(cinder-volume)从 Messaging 中获取到 Scheduler 发给它的消息,然后通过 driver 在 volume provider 上创建 volume。
- 对外提供统一接口,隐藏实现细节
- API 提供 REST 标准调用服务,便于与第三方系统集成
- 可以通过运行多个 API 服务实例轻松实现 API 的高可用,比如运行多个 cinder-api 进程
![](http://learn.yunwei.edu/openstack-learn/cinder_files/Image%20[5].png)
![](http://learn.yunwei.edu/openstack-learn/cinder_files/Image%20[6].png)
[DEFAULT]
my_ip = 172.16.254.63
glance_api_servers = http://controller:9292
auth_strategy = keystone
enabled_backends = lvm
transport_url = rabbit://openstack:admin@controller [backend] [barbican] [brcd_fabric_example] [cisco_fabric_example] [coordination] [cors] [cors.subdomain] [database]
connection = mysql+pymysql://cinder:CINDER_DBPASS@controller/cinder [fc-zone-manager] [healthcheck] [key_manager] [keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = cinder [matchmaker_redis] [oslo_concurrency]
lock_path = /var/lib/cinder/tmp [oslo_messaging_amqp] [oslo_messaging_kafka] [oslo_messaging_notifications] [oslo_messaging_rabbit] [oslo_messaging_zmq] [oslo_middleware] [oslo_policy] [oslo_reports] [oslo_versionedobjects] [profiler] [ssl] [lvm]
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_group = cinder-vg
volumes_dir = $state_path/volumes
iscsi_protocol = iscsi
iscsi_helper = lioadm
iscsi_ip_address = 172.16.254.63
cinder 控制节点部署
块存储,类似于磁盘
第一步:创建cinder的数据库和用户
[root@zxw6 ~]# mysql -uroot -p123
create database cinder;
grant all on cinder.* to cinder@'localhost' identified by 'zxw6';
Query OK, 0 rows affected (0.02 sec)
grant all on cinder.* to cinder@'%' identifiied by 'zxw6';
Query OK, 0 rows affected (0.00 sec)
登录到openstack
[root@zxw6 ~]# source openrc
第二步:创建openstack的cinder用户
[root@zxw6 ~]# openstack user create --domain default --password=zxw6 cinder
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | c6d19459b0354931a4e281bfc52b9a88 |
| name | cinder |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+
第四步:在service项目把cinder用户加入到admin角色
[root@zxw6 ~]# openstack role add --project service --user cinder admin
第五步:创建service项目cinderv2,cinderv3
[root@zxw6 ~]# openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Block Storage |
| enabled | True |
| id | d51dc5280e584c7b8a50f018a0041724 |
| name | cinderv2 |
| type | volumev2 |
+-------------+----------------------------------+
[root@zxw6 ~]# openstack service create --name cinderv3 --description "OpenStack Block Storage" volumev3
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Block Storage |
| enabled | True |
| id | c67f72e6c80942ef9baacc123feae8da |
| name | cinderv3 |
| type | volumev3 |
+-------------+----------------------------------+
第六步:创建服务v2,v3端点8776
openstack endpoint create --region RegionOne volumev2 public http://zxw6:8776/v2/%\(project_id\)s
openstack endpoint create --region RegionOne volumev2 internal http://zxw6:8776/v2/%\(project_id\)s
openstack endpoint create --region RegionOne volumev2 admin http://zxw6:8776/v2/%\(project_id\)s
openstack endpoint create --region RegionOne volumev3 public http://zxw6:8776/v3/%\(project_id\)s
openstack endpoint create --region RegionOne volumev3 internal http://zxw6:8776/v3/%\(project_id\)s
openstack endpoint create --region RegionOne volumev3 admin http://zxw6:8776/v3/%\(project_id\)s
第七步:下载cinder服务
[root@zxw6 ~]# yum install openstack-cinder -y
第八步:编辑配置文件cinder
vim /etc/cinder/cinder.conf
root@zxw6 cinder]# egrep -v '(#|^$)' cinder.conf
[DEFAULT]
my_ip = 192.168.126.6
transport_url = rabbit://openstack:zxw6@zxw6
auth_strategy = keystone
[backend]
[barbican]
[brcd_fabric_example]
[cisco_fabric_example]
[coordination]
[cors]
[cors.subdomain]
[database]
connection = mysql+pymysql://cinder:zxw6@zxw6/cinder
[fc-zone-manager]
[healthcheck]
[key_manager]
[keystone_authtoken]
auth_uri = http://zxw6:5000
auth_url = http://zxw6:35357
memcached_servers = zxw6:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = zxw6
[matchmaker_redis]
[oslo_concurrency]
lock_path = /var/lib/cinder/tmp
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_messaging_zmq]
[oslo_middleware]
[oslo_policy]
[oslo_reports]
[oslo_versionedobjects]
[profiler]
[ssl]
第九步:导入cinder数据库
[root@zxw6 ~]# su -s /bin/sh -c "cinder-manage db sync" cinder
第十步:编辑nova服务
[root@zxw6 ~]# vim /etc/nova/nova.conf
[cinder]
os_region_name = RegionOne
第十一步:重启nova-api服务
[root@zxw6 ~]# systemctl restart openstack-nova-api.service
第十二步 :启动cinder服务并开机自启
[root@zxw6 ~]# systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service
[root@zxw6 ~]# systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service
cinder存储节点部署
环境前部署添加一块新的硬盘
第一步:下载逻辑卷服务
[root@zxw8 ~]# yum install lvm2 -y
第二步:启动lvm服务
[root@zxw8 ~]# systemctl start lvm2-lvmetad.service
[root@zxw8 ~]# systemctl enable lvm2-lvmetad.service
第三步:创建pv物理卷
[root@zxw8 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 19G 0 part
├─cl-root 253:0 0 17G 0 lvm /
└─cl-swap 253:1 0 2G 0 lvm [SWAP]
sdb 8:16 0 10G 0 disk
sr0 11:0 1 4.1G 0 rom /mnt
您在 /var/spool/mail/root 中有新邮件
[root@zxw8 ~]# pvcreate /dev/sdb
Physical volume "/dev/sdb" successfully created.
第四步:创建卷宗组
[root@zxw8 ~]# vgcreate vg_cinder /dev/sdb
Volume group "vg_cinder" successfully created
第五步:修改lvm的配置文件
devices {
filter = [ "a/sdb/", "r/.*/" ]
第六步:下载cinder存储
[root@zxw8 cinder]# yum install openstack-cinder targetcli python-keystone -y
第七步:配置cinder文件
[root@zxw8 cinder]# egrep -v '(#|^$)' cinder.conf
![](https://common.cnblogs.com/images/copycode.gif)
[DEFAULT]
my_ip = 172.16.254.63
glance_api_servers = http://controller:9292
auth_strategy = keystone
enabled_backends = lvm
transport_url = rabbit://openstack:admin@controller [backend] [barbican] [brcd_fabric_example] [cisco_fabric_example] [coordination] [cors] [cors.subdomain] [database]
connection = mysql+pymysql://cinder:CINDER_DBPASS@controller/cinder [fc-zone-manager] [healthcheck] [key_manager] [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 = cinder [matchmaker_redis] [oslo_concurrency]
lock_path = /var/lib/cinder/tmp [oslo_messaging_amqp] [oslo_messaging_kafka] [oslo_messaging_notifications] [oslo_messaging_rabbit] [oslo_messaging_zmq] [oslo_middleware] [oslo_policy] [oslo_reports] [oslo_versionedobjects] [profiler] [ssl] [lvm]
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_group = cinder-vg
volumes_dir = $state_path/volumes
iscsi_protocol = iscsi
iscsi_helper = lioadm
iscsi_ip_address = 172.16.254.63
![](https://common.cnblogs.com/images/copycode.gif)
第八步:启动服务。并开机自启
[root@zxw8 ~]# systemctl start openstack-cinder-volume.service target.service
[root@zxw8 ~]# systemctl enable openstack-cinder-volume.service target.service
访问
查看服务是否启动
[root@zxw6 ~]# cinder service-list
+------------------+----------+------+---------+-------+----------------------------+-----------------+
| Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
+------------------+----------+------+---------+-------+----------------------------+-----------------+
| cinder-scheduler | zxw6 | nova | enabled | up | 2019-08-03T01:25:14.000000 | - |
| cinder-volume | zxw8@lvm | nova | enabled | up | 2019-08-03T01:25:11.000000 | - |
+------------------+----------+------+---------+-------+----------------------------+-----------------+
查看卷
[root@zxw6 ~]# cinder list
+----+--------+------+------+-------------+----------+-------------+
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+----+--------+------+------+-------------+----------+-------------+
openstack核心组件——cinder存储服务(11)的更多相关文章
- 云计算openstack核心组件——cinder存储服务(11)
一.cinder 介绍: 理解 Block Storage 操作系统获得存储空间的方式一般有两种: 通过某种协议(SAS,SCSI,SAN,iSCSI 等)挂接裸硬盘,然后分区.格式化.创建文件系 ...
- OpenStack核心组件-cinder存储服务
1. cinder 介绍 Block Storage 操作系统获得存储空间的方式一般有两种: 1) 通过某种协议(SAS,SCSI,SAN,iSCSI 等)挂接裸硬盘,然后分区.格式化.创建文 ...
- 云计算OpenStack核心组件---cinder存储服务(10)
一.cinder介绍 1.Block Storage 操作系统获得存储空间的方式一般有两种: (1)通过某种协议(SAS,SCSI,SAN,iSCSI 等)挂接裸硬盘,然后分区.格式化.创建文件系统: ...
- openstack核心组件--cinder存储服务(6)
一.cinder 介绍: 理解 Block Storage 操作系统获得存储空间的方式一般有两种: 通过某种协议(SAS,SCSI,SAN,iSCSI 等)挂接裸硬盘,然后分区.格式化.创建文件系 ...
- OpenStack组件——cinder存储服务
1.cinder 介绍 1)理解 Block Storage 操作系统获得存储空间的方式一般有两种: (1)通过某种协议(SAS,SCSI,SAN,iSCSI 等)挂接裸硬盘,然后分区.格式化.创建文 ...
- CentOS7安装OpenStack(Rocky版)-09.安装Cinder存储服务组件(控制节点)
本文分享openstack的Cinder存储服务组件,cinder服务可以提供云磁盘(卷),类似阿里云云盘 ----------------------- 完美的分隔线 -------------- ...
- openstack核心组件——glance— 镜像服务(6)
云计算openstack核心组件——glance— 镜像服务(6) 一.glance介绍: Glance是Openstack项目中负责镜像管理的模块,其功能包括虚拟机镜像 ...
- openstack核心组件——nova计算服务(7)
云计算openstack核心组件——nova计算服务(7) 一.nova介绍: Nova 是 OpenStack 最核心的服务,负责维护和管理云环境的计算资源.OpenStack 作为 ...
- openstack核心组件——neutron网络服务(8)
云计算openstack核心组件——neutron网络服务(8) 一.neutron 介绍: Neutron 概述 传统的网络管理方式很大程度上依赖于管理员手工配置和维护各种网络硬件设备:而云 ...
随机推荐
- 【期外】 (一)关于LSH :局部敏感哈希算法
LSH是我同学的名字,平时我会亲切的称呼他为离骚,老师好,左移(leftshift),小骚骚之类的,最近他又多了一个新的外号:局部敏感哈希(Locally sensitive hashing). 好了 ...
- NOIP2007 树网的核 [提高组]
题目:树网的核 网址:https://www.luogu.com.cn/problem/P1099 题目描述 设 T=(V,E,W)T=(V,E,W) 是一个无圈且连通的无向图(也称为无根树),每条边 ...
- SpringCloudAlibaba-服务网关Gateway
一:网关简介 在微服务架构中,一个系统会被拆分为很多个微服务.那么作为客户端要如何去调用这么多的微服务呢?如果没有网关的存在,我们只能在客户端记录每个微服务的地址,然后分别去调用.这样的话会产生很多问 ...
- 为什么 max() 应该写成 b < a ? a : b 呢?
在 < C++ Templates 2nd Edition >Chapter 1 中,作者将 max() 模板定义如下: template <typename T> T max ...
- Robot Framework(6)——案例分层
上一篇以gogomall的登录为例,记录了一个简单的登录流程的脚本,在实际应用中,当流程发生一些小的变动,或者前端代码改变,导致元素选择器失效,我们维护脚本的成本就比较大,需要一个一个去修改,所以,有 ...
- Neurosurgeon: Collaborative Intelligence Between the Cloud and Mobile Edge
郑重声明:原文参见标题,如有侵权,请联系作者,将会撤销发布! ASPLOS ’17, April 08-12, 2017, Xi’an, China Abstract 如今的智能个人助理,如Apple ...
- Python语言中的关键字(自己做的读书笔记)
电脑配置:联想笔记本电脑 windows8系统 Python版本:2.7.8 本文章撰写时间:2015.1.1 作者:陈东陈 阅读说明: 1.本文都是先解释,后放图片: 2.文中斜体部分要么为需要输入 ...
- Java算法——递归思想
描述递归(recursion):程序调用自身的编程技巧. 递归满足2个条件:1)有反复执行的过程(调用自身)2)有跳出反复执行过程的条件(递归出口) 递归与栈的关系下面演示的是求n的阶乘 int Fa ...
- Arduboy基本操作(二)
Arduboy基本操作(二) 方向键控制物体移动 #include<Arduboy.h> Arduboy arduboy; int i,j; void setup() { arduboy. ...
- python sqlite3简单操作
python sqlite3简单操作(原创)import sqlite3class CsqliteTable: def __init__(self): pass def linkSqlite3(sel ...