cinder-api:  接受和响应外部有关块存储请求

cinder-volume:  提供存储空间

cinder-scheduler:  调度器,决定将要分配的空间由哪一个cinder-volume提供

cinder-backup:  备份存储

1、数据库创库授权

 CREATE DATABASE cinder;
GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' \
  IDENTIFIED BY 'CINDER_DBPASS';
GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' \
  IDENTIFIED BY 'CINDER_DBPASS'; 

2、在keystone创建系统用户(glance,nova,neutron)关联角色

openstack user create --domain default --password CINDER_PASS cinder
openstack role add --project service --user cinder admin

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

openstack service create --name cinder \
  --description "OpenStack Block Storage" volume
openstack service create --name cinderv2 \
  --description "OpenStack Block Storage" volumev2
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

4、安装服务相应的软件包

 yum install openstack-cinder -y 

5、修改相应服务的配置文件

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:[email protected]/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  CINDER_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  RABBIT_PASS

6、同步数据库

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

vim /etc/nova/nova.conf

[cinder]
os_region_name = RegionOne

7、启动服务

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


在存储节点上:(在控制节点也可以 ,这里安装在控制节点)

(LVM性能不如标准分区,优点是可以随时扩展分区大小)

LVM逻辑卷:

cinder块存储服务安装

先决条件

 yum install lvm2 -y 
 systemctl enable lvm2-lvmetad.service
systemctl start lvm2-lvmetad.service 
(添加两块盘  一块30G ssd   50Gsata)

扫描

 echo '- - -' >/sys/class/scsi_host/host0/scan  

fdisk -l  查看

创建物理卷

pvcreate  /dev/sdb

pvcreate  /dev/sdc

创建卷组

 vgcreate cinder-ssd /dev/sdb

vgcreate cinder-sata /dev/sdc

vim /etc/lvm/lvm.conf

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

在130行下加入

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

安装配置组件

yum install openstack-cinder targetcli python-keystone -y

配置

[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
my_ip = 10.0.0.31
glance_api_servers = http://10.0.0.32:9292
enabled_backends = ssd,sata
[BACKEND]
[BRCD_FABRIC_EXAMPLE]
[CISCO_FABRIC_EXAMPLE]
[COORDINATION]
[FC-ZONE-MANAGER]
[KEYMGR]
[cors]
[cors.subdomain]
[database]
connection = mysql+pymysql://cinder:[email protected]/cinder
[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_PASS
[matchmaker_redis]
[oslo_concurrency]
lock_path = /var/lib/cinder/tmp
[oslo_messaging_amqp]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS
[oslo_middleware]
[oslo_policy]
[oslo_reports]
[oslo_versionedobjects]
[ssl]
[ssd]
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_group = cinder-ssd
iscsi_protocol = iscsi
iscsi_helper = lioadm
[sata]
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_group = cinder-sata
iscsi_protocol = iscsi

iscsi_helper = lioadm

启动

systemctl start openstack-cinder-volume.service target.service

systemctl enable openstack-cinder-volume.service target.servic






相关文章: