作用
1 cinder 需要连接 ceph 进行云硬盘存储
2 cinder 需要连接 keystone 进行用户验证
3 cinder 需要连接 rabbitmq 处理消息队列
默认下 openstack 提供卷驱动, 支持下面的块存储类型
LVM/iSCSI
ThinLVM
NFS
NetAPP NFS
Red Hat Storage (Gluster)
Dell EqualLogic
CEPH
配置
配置 keystone 验证
# openstack-config --set /etc/cinder/cinder.conf DEFAULT auth_strategy keystone
# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_host 240.10.130.25
# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken admin_tenant_name service
# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken admin_user cinder
# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken admin_password cinder
# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken identity_uri http://240.10.130.25:35357
数据库配置
# openstack-config --set /etc/cinder/cinder.conf DEFAULT sql_connection mysql://cinder:cinder@240.10.130.25/cinder
# cinder-manage db sync
执行 db sync 之后, 正常会在数据库中看到下面一堆表
mysql> use cinder;
Database changed
mysql> show tables;
+--------------------------+
| Tables_in_cinder |
+--------------------------+
| backups |
| encryption |
| iscsi_targets |
| migrate_version |
| quality_of_service_specs |
| quota_classes |
| quota_usages |
| quotas |
| reservations |
| services |
| snapshot_metadata |
| snapshots |
| transfers |
| volume_admin_metadata |
| volume_glance_metadata |
| volume_metadata |
| volume_type_extra_specs |
| volume_types |
| volumes |
+--------------------------+
19 rows in set (0.00 sec)
配置 cinder 服务配置
cpu 配置
设定 cinder 的进程数量 cores = cpu 个数
# CORES=16
# openstack-config --set /etc/cinder/cinder.conf DEFAULT osapi_volume_workers $CORES
cinder 连接 rabbitmq
设定 rabbitmq 作为 rpc 后台
# openstack-config --set /etc/cinder/cinder.conf DEFAULT rpc_backend cinder.openstack.common.rpc.impl_kombu
cinder 连接 rabbitmq 方法
# openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_host 240.10.130.25
# openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_virtual_host /
# openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_port 5672
# openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_userid guest
# openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_password openstack
cinder 与 ceph 连接
参考 openstack 管理二十二 - cinder 连接多个存储 backend
注: 默认情况下, 当 cinder 成功使用, 并在创建云硬盘时候, 会自动地连接 ceph, 不需要人为手动挂载
配置 token 验证 (可选, 不影响 cinder create 1)
# openstack-config --set /etc/cinder/api-paste.ini filter:authtoken paste.filter_factory keystoneclient.middleware.auth_token:filter_factory
注: 假如上述 token 不配置, 则在 /var/log/cinder/api.log 中会经常看见下面警告
2014-10-04 15:40:35.830 63155 WARNING keystoneclient.middleware.auth_token [-] Configuring auth_uri to point to the public identity endpoint is required; clients may not be able to authenticate against an admin endpoint
2014-10-04 15:40:35.873 63155 WARNING keystoneclient.middleware.auth_token [-] Configuring auth_uri to point to the public identity endpoint is required; clients may not be able to authenticate against an admin endpoint
而下面警告可忽略, 官方提出这个可能是一个 bug, 并在下一个版本会修复
2014-10-04 15:41:05.370 63170 WARNING cinder.context [-] Arguments dropped when creating context: {'user': None, 'tenant': None, 'user_identity': u'- - - - -'}
2014-10-04 15:42:05.372 63170 WARNING cinder.context [-] Arguments dropped when creating context: {'user': None, 'tenant': None, 'user_identity': u'- - - - -'}