在CentOS下部署Openstack-安装cinder块存储服务

安装

1
yum install openstack-cinder python-cinderclient python-oslo-db

创建数据库并提供权限

1
2
3
mysql -u root –p
CREATE DATABASE cinder;
GRANT ALL PRIVILEGES ON cinder.* TO'cinder'@'192.168.0.0/255.255.0.0' IDENTIFIED BY 'cinder';

修改配置文件

1
vim /etc/cinder/cinder.conf






初始化数据库

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

注册服务和api

1
2
keystone service-create --name cinderv2 --type volumev2 \
--description "OpenStack Block Storage"


1
2
3
4
5
keystone endpoint-create \
--service-id $(keystone service-list | awk '/ volumev2 / {print $2}') \
--publicurl http://192.168.1.103:8776/v2/%\(tenant_id\)s \
--internalurl http://192.168.1.103:8776/v2/%\(tenant_id\)s \
--adminurl http://192.168.1.103:8776/v2/%\(tenant_id\)s

安装nfs

1
2
3
yum install nfs-utils rpcbind
mkdir -p /data/nfs
vim /etc/exports


1
2
3
4
service rpcbind restart
service nfs restart
chkconfig rpcbind on
chkconfig nfs on

修改cinder.conf文件




1
vim /etc/cinder/nfs_shares

启动服务

1
2
3
4
5
6
service openstack-cinder-api restart
service openstack-cinder-volume restart
service openstack-cinder-scheduler restart
chkconfig openstack-cinder-api on
chkconfig openstack-cinder-volume on
chkconfig openstack-cinder-scheduler on

本文作者:Qiu Qingyu
版权声明:本博客所有文章除特别声明外,均采用CC BY-NC-SA 3.0 CN许可协议。转载请注明出处!
本文永久链接:http://qiuqingyu.cn/2015/12/12/在CentOS下部署Openstack-安装cinder块存储服务/