码迷,mamicode.com
首页 > 其他好文 > 详细

Centos7.4安装openstack(queens)详细安装部署(七)块存储服务

时间:2020-07-16 21:03:39      阅读:72      评论:0      收藏:0      [点我收藏+]

标签:ack   end   localhost   serve   url   虚拟机   块存储   enc   同步   

一、基本概念

  1.1、概述:OpenStack块存储服务(cinder)为虚拟机添加持久的存储,块存储提供一个基础设施为了管理卷,以及和OpenStack计算服务交互,为实例提供卷。此服务也会激活管理卷的快照和卷类型的功能。

  1.2、基本组件

    cinder-api 接受API请求,并将其路由到``cinder-volume``执行。

    cinder-volume:与块存储服务和例如``cinder-scheduler``的进程进行直接交互。它也可以与这些进程通过一个消息队列进行交互。``cinder-volume``服务响应送到块存储服务的读写请求来维持状态。它也可以和多种存储提供者在驱动架构下进行交互。

    cinder-scheduler守护进程:选择最优存储提供节点来创建卷。其与``nova-scheduler``组件类似。

    cinder-backup守护进程:cinder-backup服务提供任何种类备份卷到一个备份存储提供者。就像``cinder-volume``服务,它与多种存储提供者在驱动架构下进行交互。

二、安装服务

  1、创库授权

mysql -u root -pADMIN_PASS

CREATE DATABASE cinder;

GRANT ALL PRIVILEGES ON cinder.* TO cinder@localhost IDENTIFIED BY ADMIN_PASS;

GRANT ALL PRIVILEGES ON cinder.* TO cinder@% IDENTIFIED BY ADMIN_PASS;

  2、在keysonte上创建系统用户

openstack user create --domain default --password ADMIN_PASS cinder

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

  3、在keysonte上创建服务和注册api

openstack service create --name cinder  --description "OpenStack Block Storage" volume         创建cinder服务实体

openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2      创建cinderv2服务实体

创建块设备存储服务的 API 入口点
openstack endpoint create --region RegionOne volume public http://controller:8776/v1/%\(tenant_id\)s
  
openstack endpoint create --region RegionOne volume internal http://controller:8776/v1/%\(tenant_id\)s
  
openstack endpoint create --region RegionOne volume admin http://controller:8776/v1/%\(tenant_id\)s
  
openstack endpoint create --region RegionOne volumev2 public http://controller:8776/v2/%\(tenant_id\)s
  
openstack endpoint create --region RegionOne volumev2 internal http://controller:8776/v2/%\(tenant_id\)s
  
openstack endpoint create --region RegionOne volumev2 admin http://controller:8776/v2/%\(tenant_id\)s

openstack service create --name cinderv3 --description "OpenStack Block Storage" volumev3

openstack endpoint create --region RegionOne volumev3 public http://controller:8776/v2/%\(tenant_id\)s

openstack endpoint create --region RegionOne volumev3 internal http://controller:8776/v2/%\(tenant_id\)s

openstack endpoint create --region RegionOne volumev3 admin http://controller:8776/v2/%\(tenant_id\)s

  4、安装服务

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
yum makecache
yum install centos-release-openstack-queens.noarch -y
yum install openstack-cinder -y
yum install openstack-utils -y

   5、修改配置文件

cp /etc/cinder/cinder.conf{,.bak}
grep -Ev ^$|# /etc/cinder/cinder.conf.bak >/etc/cinder/cinder.conf

openstack-config --set /etc/cinder/cinder.conf DEFAULT rpc_backend rabbit
openstack-config --set /etc/cinder/cinder.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/cinder/cinder.conf DEFAULT my_ip 10.0.0.11
openstack-config --set /etc/cinder/cinder.conf database connection  mysql+pymysql://cinder:ADMIN_PASS@controller/cinder
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_uri http://controller:5000
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_url http://controller:35357
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken memcached_servers controller:11211
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_type password
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken project_domain_name default
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken user_domain_name default
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken project_name service
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken username cinder
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken password ADMIN_PASS
openstack-config --set /etc/cinder/cinder.conf oslo_concurrency lock_path /var/lib/cinder/tmp
openstack-config --set /etc/cinder/cinder.conf oslo_messaging_rabbit rabbit_host controller
openstack-config --set /etc/cinder/cinder.conf oslo_messaging_rabbit rabbit_userid openstack
openstack-config --set /etc/cinder/cinder.conf oslo_messaging_rabbit rabbit_password ADMIN_PASS

  6、配置计算节点以使用块设备存储

[cinder]
os_region_name = RegionOne

  7、同步数据库

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

  8、重启服务

    控制节点重启计算API 服务

systemctl restart openstack-nova-api.service

    计算节点重启openstack-nova-compute服务

systemctl restart openstack-nova-compute.service

   9、启动服务

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

   10、验证服务,web页面会多出一个卷管理

技术图片

 

Centos7.4安装openstack(queens)详细安装部署(七)块存储服务

标签:ack   end   localhost   serve   url   虚拟机   块存储   enc   同步   

原文地址:https://www.cnblogs.com/aqicheng/p/13324007.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!