OpenStack(7)-cinder服务部署

OpenStack Block Storage服务(Cinder)将持久存储添加到虚拟机。块存储提供用于管理卷的基础结构,并与OpenStack Compute交互以为实例提供卷。该服务还可以管理卷快照和卷类型。

块存储服务包含以下组件:

cinderAPI
接受API请求,并将它们路由到cinder-volumefor操作。
cinder卷
直接与Block Storage服务以及诸如之后的进程交互cinder-scheduler。它还通过消息队列与这些进程交互。该cinder-volume服务响应发送到块存储服务的读写请求以维持状态。它可以通过驱动程序体系结构与各种存储提供程序进行交互。
cinder-scheduler守护进程
选择要在其上创建卷的最佳存储提供程序节点。一个类似的组成部分nova-scheduler
cinder-backup守护进程
cinder-backup服务为备份存储提供程序提供任何类型的备份卷。与cinder-volume服务一样,它可以通过驱动程序体系结构与各种存储提供程序进行交互。
消息队列
          消息队列在块存储进程之间路由信息。
我们需要在存储节点添加一块硬盘sdb
我们先配置控制节点
1.创建cinder数据库;
mysql> CREATE DATABASE cinder;
Query OK, 1 row affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON cinder.* TO ‘cinder‘@‘localhost‘     ->   IDENTIFIED BY ‘123‘;
Query OK, 0 rows affected, 1 warning (0.15 sec)

mysql> GRANT ALL PRIVILEGES ON cinder.* TO ‘cinder‘@‘%‘     ->   IDENTIFIED BY ‘123‘;
Query OK, 0 rows affected, 1 warning (0.00 sec)

2.创建cinder用户;

[[email protected] ~]# openstack user create --domain default --password-prompt cinder
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | default                          |
| enabled             | True                             |
| id                  | c14cbc9906274a968452fbe7a3f67474 |
| name                | cinder                           |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+

3.将admin角色添加到cinder用户;

[[email protected] ~]# openstack role add --project service --user cinder admin

4.创建cinder服务cinderv2、cinderv3(因为有两个版本);

[[email protected] ~]# openstack service create --name cinderv2 >   --description "OpenStack Block Storage" volumev2
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Block Storage          |
| enabled     | True                             |
| id          | 049c3b344b134b5695a7223658a0c625 |
| name        | cinderv2                         |
| type        | volumev2                         |
+-------------+----------------------------------+
[[email protected] ~]# openstack service create --name cinderv3 >   --description "OpenStack Block Storage" volumev3
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Block Storage          |
| enabled     | True                             |
| id          | 896ebdd517f44b45bc9c5beb9e7e3192 |
| name        | cinderv3                         |
| type        | volumev3                         |
+-------------+----------------------------------+

5.创建Block Storage服务API端点;

卷2

[[email protected] ~]# openstack endpoint create --region RegionOne   volumev2 public http://192.168.88.101:8776/v2/%\(project_id\)s^C
[[email protected] ~]# openstack endpoint create --region RegionOne   volumev2 internal http://192.168.88.101:8776/v2/%\(project_id\)s^C
[[email protected] ~]# openstack endpoint create --region RegionOne   volumev2 admin http://192.168.88.101:8776/v2/%\(project_id\)s

卷3

[[email protected] ~]# openstack endpoint create --region RegionOne   volumev3 public http://192.168.88.101:8776/v3/%\(project_id\)s^C
[[email protected] ~]# openstack endpoint create --region RegionOne   volumev3 internal http://192.168.88.101:8776/v3/%\(project_id\)s^C
[[email protected] ~]# openstack endpoint create --region RegionOne   volumev3 admin http://192.168.88.101:8776/v3/%\(project_id\)s

6.安装cinder相关组件;

[[email protected] ~]# yum install openstack-cinder -y

7.配置cinder文件;

[[email protected] ~]# vim /etc/cinder/cinder.conf 

[DEFAULT]
transport_url = rabbit://openstack:[email protected]
auth_strategy = keystone

[database]
connection = mysql+pymysql://cinder:[email protected]/cinder

[keystone_authtoken]
www_authenticate_uri = http://192.168.88.101:5000
auth_url = http://192.168.88.101:5000
memcached_servers = 192.168.88.101:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = 123

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

8.初始化数据库(返回信息不用管);

[[email protected] ~]# su -s /bin/sh -c "cinder-manage db sync" cinder
Deprecated: Option "logdir" from group "DEFAULT" is deprecated. Use option "log-dir" from group "DEFAULT".

9.配置nova文件;

[[email protected] ~]# vim /etc/nova/nova.conf

[cinder]
os_region_name = RegionOne

10.重启nova服务;

[[email protected] ~]# systemctl restart openstack-nova-api.service

11.启动控制节点cinder服务(status查看服务状态);

[[email protected] ~]# 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.
[[email protected] ~]# systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service

我们来配置存储节点

1.安装cinder相关组件;

[[email protected] ~]# yum install lvm2 device-mapper-persistent-data -y

2.启动cinder服务;

[[email protected] ~]# systemctl enable lvm2-lvmetad.service
[[email protected] ~]# systemctl start lvm2-lvmetad.service
[[email protected] ~]# systemctl status lvm2-lvmetad.service
● lvm2-lvmetad.service - LVM2 metadata daemon
   Loaded: loaded (/usr/lib/systemd/system/lvm2-lvmetad.service; static; vendor preset: enabled)
   Active: active (running) since Mon 2019-09-09 07:28:32 EDT; 47min ago
     Docs: man:lvmetad(8)
 Main PID: 519 (lvmetad)
   CGroup: /system.slice/lvm2-lvmetad.service
           └─519 /usr/sbin/lvmetad -f

Sep 09 07:28:32 sxb3.103.com systemd[1]: Started LVM2 metadata daemon.

3.创建一个LVM;

[[email protected] ~]# pvcreate /dev/sdb
  Physical volume "/dev/sdb" successfully created.
[[email protected] ~]# vgcreate cinder-volumes /dev/sdb
  Volume group "cinder-volumes" successfully created

4.配置lvm文件;

[[email protected] ~]# vim /etc/lvm/lvm.conf 

devices {
        filter = [ "a/sdb/", "r/.*/"]

5.安装组件;

[[email protected] ~]# yum install openstack-cinder targetcli python-keystone -y

6.配置cinder文件;

[lvm]
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_group = cinder-volumes
target_protocol = iscsi
target_helper = lioadm

[DEFAULT]
transport_url = rabbit://openstack:[email protected]
auth_strategy = keystone
my_ip = 192.168.88.103
enabled_backends = lvm
glance_api_servers = http://192.168.88.101:9292

[database]
connection = mysql+pymysql://cinder:[email protected]/cinder

[keystone_authtoken]
www_authenticate_uri = http://192.168.88.101:5000
auth_url = http://192.168.88.101:5000
memcached_servers = 192.168.88.101:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = 123

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

7.启动cinder服务(status查看服务状态);

[[email protected] ~]# 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.
[[email protected] ~]# systemctl start openstack-cinder-volume.service target.service
[[email protected] ~]# systemctl status openstack-cinder-volume.service target.service
● openstack-cinder-volume.service - OpenStack Cinder Volume Server
   Loaded: loaded (/usr/lib/systemd/system/openstack-cinder-volume.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2019-09-09 08:53:33 EDT; 7s ago
 Main PID: 2592 (cinder-volume)
   CGroup: /system.slice/openstack-cinder-volume.service
           ├─2592 /usr/bin/python2 /usr/bin/cinder-volume --config-file /usr/sha...
           └─2631 /usr/bin/python2 /usr/bin/cinder-volume --config-file /usr/sha...

Sep 09 08:53:33 sxb3.103.com systemd[1]: Started OpenStack Cinder Volume Server.
Sep 09 08:53:37 sxb3.103.com cinder-volume[2592]: Deprecated: Option "logdir" f....
Sep 09 08:53:39 sxb3.103.com sudo[2632]:   cinder : TTY=unknown ; PWD=/ ; USER...on
Sep 09 08:53:39 sxb3.103.com sudo[2640]:   cinder : TTY=unknown ; PWD=/ ; USER...es
Sep 09 08:53:39 sxb3.103.com sudo[2649]:   cinder : TTY=unknown ; PWD=/ ; USER...ol
Sep 09 08:53:39 sxb3.103.com sudo[2658]:   cinder : TTY=unknown ; PWD=/ ; USER...on
Sep 09 08:53:40 sxb3.103.com sudo[2668]:   cinder : TTY=unknown ; PWD=/ ; USER...es
Sep 09 08:53:40 sxb3.103.com sudo[2677]:   cinder : TTY=unknown ; PWD=/ ; USER...ol

● target.service - Restore LIO kernel target configuration
   Loaded: loaded (/usr/lib/systemd/system/target.service; enabled; vendor preset: disabled)
   Active: active (exited) since Mon 2019-09-09 08:53:33 EDT; 7s ago
  Process: 2593 ExecStart=/usr/bin/targetctl restore (code=exited, status=0/SUCCESS)
 Main PID: 2593 (code=exited, status=0/SUCCESS)

Sep 09 08:53:33 sxb3.103.com systemd[1]: Starting Restore LIO kernel target co.....
Sep 09 08:53:33 sxb3.103.com target[2593]: No saved config file at /etc/target/...g
Sep 09 08:53:33 sxb3.103.com systemd[1]: Started Restore LIO kernel target con...n.
Hint: Some lines were ellipsized, use -l to show in full.

验证:

[[email protected] ~]# openstack volume service list
+------------------+------------------+------+---------+-------+----------------------------+
| Binary           | Host             | Zone | Status  | State | Updated At                 |
+------------------+------------------+------+---------+-------+----------------------------+
| cinder-scheduler | sxb1.101.com     | nova | enabled | up    | 2019-09-09T13:31:14.000000 |
| cinder-volume    | sxb3.103[email protected] | nova | enabled | up    | 2019-09-09T13:31:18.000000 |
+------------------+------------------+------+---------+-------+----------------------------+

原文地址:https://www.cnblogs.com/loganSxb/p/11493020.html

时间: 2024-10-15 04:18:36

OpenStack(7)-cinder服务部署的相关文章

Openstack 安装部署指南翻译系列 之 Cinder服务安装(Block Storage)

1.1.1.1. Cinder服务安装(Block Storage) 块存储服务(cinder)为访客实例提供块存储设备.存储设置方法由块存储驱动程序确定,或者在多后端配置的情况下确定驱动程序.有各种可用的驱动程序:NAS / SAN,NFS,iSCSI,Ceph等. 块存储API和调度器服务通常在控制器节点上运行.根据使用的驱动程序,卷服务可以在控制器节点,计算节点或独立存储节点上运行. 本节介绍如何为块存储服务安装和配置存储节点.为了简单起见,此配置引用一个具有空的本地块存储设备的存储节点.

openstack——cinder服务篇

一.cinder 介绍: 理解 Block Storage 操作系统获得存储空间的方式一般有两种: 通过某种协议(SAS,SCSI,SAN,iSCSI 等)挂接裸硬盘,然后分区.格式化.创建文件系统:或者直接使用裸硬盘存储数据(数据库) 通过 NFS.CIFS 等 协议,mount 远程的文件系统 第一种裸硬盘的方式叫做 Block Storage(块存储),每个裸硬盘通常也称作 Volume(卷) 第二种叫做文件系统存储.NAS 和 NFS 服务器,以及各种分布式文件系统提供的都是这种存储.

openstack M版安装 storage(cinder)服务篇

安装配置cinder服务 controller节点 一.创建数据库 [[email protected] ~]#  mysql -u root -p >>CREATE DATABASE cinder; >>GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost'   IDENTIFIED BY 'CINDER_DBPASS'; >>GRANT ALL PRIVILEGES ON cinder.* TO 'cinde

OpenStack Liberty Cinder对接商业存储华为S2600Tv1_FC

本文目录: 背景描述 架构参考 准备工作 控制节点 计算节点 功能测试 参考链接 ----------------------正文------------------------- 背景描述: 由于OpenStack的被接受程度越来越高,部署使用OpenStack的企业也越来越多,那承载虚机的存储使用什么成为企业考虑的重点因素,如果放在计算节点本地则无法实现快速的迁移等特性,对于宕机后的数据恢复也是挑战,所以企业数据基本都是放在共享存储上的. 传统的虚拟化例如VMware基本都是存储在商业存储上

OpenStack架构----cinder组件(六)

整个OpenStack是由控制节点,计算节点,网络节点,存储节点四大部分组成.上篇博文详细讲述了控制节点服务controller中的horizon组件,本篇博文将详解存储节点cinder的部署.分为两部分:控制节点和存储节点 OpenStack存储节点架构 存储节点包含Cinder,Swift等服务 Cinder:块存储服务,提供相应的块存储,简单来说,就是虚拟出一块磁盘,可以挂载到相应的虚拟机之上,不受文件系统等因素影响,对虚拟机来说,这个操作就像是新加了一块硬盘,可以完成对磁盘的任何操作,包

OpenStack多节点一键部署(超详细)

实验环境下OpenStack多节点一键部署(超详细) 前言 ? OpenStack项目是一个开源的云计算平台项目,是控制着计算.网络和存储三大资源的分布式系统.搭建这样的一个云平台系统,可以为我们提供IaaS(基础设施即服务)模式的云服务.本文核心不在相关的理论,因此有关云计算和OpenStack的概念等相关整体介绍可以参考下面的三篇文章: 云计算浅谈 OpenStack概念以及核心组件概述 OpenStack部署节点类型和架构 ? 本文旨在给出实验环境下多节点一键部署OpenStack的详细实

openstack icehouse 3节点部署遇到的问题和解决方法

刚接触openstack不久,参考官方文档实施3节点部署时遇到了一些问题,主要集中在compute node,还好有十几年的运维经验协助我把问题一一解决了.以下会用红字部分标识解决方法. 系统环境:CentOS 6.5 64位 各节点IP:完全按照官方文档中的IP进行了配置 官方文档:http://docs.openstack.org/icehouse/install-guide/install/zypper/content/ 日志记录日期:2014-7-6 问题部分: Controller N

OpenStack的容器服务体验

magnum 是用于 OpenStack 的容器服务.它有以下特点: 抽象的容器.节点.服务等 集成了用于容器技术的 Kubernetes 和 Docker 集成了多租户安全的 Keystone 继承了k8s多租户网络安全的 Neutron 环境准备 在VMware Workstations建台虚拟机,Ubuntu 14.04 LTS,CPU两个核以上,内存至少4G以上,硬盘100G,两个网卡(一个主机模式,另一个NAT模式). $ vi /etc/network/interfaces #仅主机

openstack 重启的服务命令

重启openstack的整个服务openstack-service restart 1. 重启dashboardservice httpd restart service memcached restart 2. 重启 ceilometer2.1 cinderservice mongod restart2.2 controllerservice openstack-ceilometer-api restart service openstack-ceilometer-notification r