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 等商业存储产品和方案


客户端可以将请求发送到 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 等。





- 客户(可以是 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 进程


[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

[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

第八步:启动服务。并开机自启
[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 概述 传统的网络管理方式很大程度上依赖于管理员手工配置和维护各种网络硬件设备:而云 ...
随机推荐
- JVM的方法执行引擎-entry point栈帧
接着上一篇去讲,回到JavaCalls::call_helper()中: address entry_point = method->from_interpreted_entry(); entr ...
- C++开发时字符编码的选择
最近看了很多有关字符编码的讨论帖子, 自己也做了很多尝试, 针对linux和windows上字符编码的选择做了个简单整理, 在此做个记录 首先是基础编码知识, 下面我列出的4个编码方式或字符集是我们应 ...
- Jmeter 常用函数(16)- 详解 __split
如果你想查看更多 Jmeter 常用函数可以在这篇文章找找哦 https://www.cnblogs.com/poloyy/p/13291704.htm 作用 根据分隔符分割传递给它的字符串 语法格式 ...
- 2 Spark角色介绍及运行模式
第2章 Spark角色介绍及运行模式 2.1 集群角色 从物理部署层面上来看,Spark主要分为两种类型的节点,Master节点和Worker节点:Master节点主要运行集群管理器的中心化部分,所承 ...
- win10中搭建Linux子系统
win10自带的Linux子系统,简称WSL(Windows Subsystem for Linux).优点是打通了Linux系统和windows系统,改变了传统虚拟机/双系统造成的两个系统相互隔绝的 ...
- web渗透测试之sqlmap拿到数据库信息
通过扫描我们发现目标网站存在sql注入漏洞,我们访问该里面后发现该网站里面有个表格提交参数.确实存在没有过滤 使用sqlmap扫描发现漏洞的确存在,这里是布尔盲注 查看当前数据库名 查看表名得到以下信 ...
- 使用ClickHouse表函数将MySQL数据导入到ClickHouse
#clickhouse-client :create database dw; :use dw; --导入数据: CREATE TABLE Orders ENGINE = MergeTree ORDE ...
- “大地主”IPV6的邻居发现BD
引入 因为当初设计IPv4的时候,没有考虑到网络发展的速度这么快,到今现在IPv4有很多不足,32位的 IPv4地址不够用,现在128位的IPv6能完全够用,据说可以地球上每一粒沙子都分配一个地址,而 ...
- 外贸网站SEO优化哪家公司好
http://www.wocaoseo.com/thread-98-1-1.html 随着b2c的崛起,越来越多的企业已经放弃挂在第三方面台销售,而是选择去建独立的商场,拥有一个属于自已 ...
- Promise对象入门
简介 promise对象可以获取异步操作的消息,提供统一的API,各个异步操作都可以用同样的方法进行处理. promise对象不受外界影响,其有三种状态:pending(进行中).fulfilled( ...