Skip to content

安装及配置Cinder服务

安装Cinder软件包

yum -y install openstack-cinder

创建Cinder数据库并授权

mysql -uroot -p000000 -e "create database cinder;"
mysql -uroot -p000000 -e "grant all privileges on cinder.* to cinder@localhost identified by '000000';"
mysql -uroot -p000000 -e "grant all privileges on cinder.* to cinder@'%' identified by '000000';"

修改Cinder配置文件

基本操作

cp /etc/cinder/cinder.conf /etc/cinder/cinder.conf.bak
grep -Ev '^$|#' /etc/cinder/cinder.conf.bak > /etc/cinder/cinder.conf

编辑

vi /etc/cinder/cinder.conf

修改[database]部分

[database]
connection = mysql+pymysql://cinder:000000@controller/cinder

修改[keystong_authtoken]

[keystong_authtoken]
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
username = cinder
password = 000000
project_name = project
user_domain_name = Default
project_domain_name = Default

修改[DEFAULT]

[DEFAULT]
auth_strategy = keystone
transport_url = rabbit://rabbitmq:000000@controller:5672

修改[oslo_concurrency]

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

修改Nova配置文件

vi /etc/nova/nova.conf
[cinder]
os_region_name = RegionOne

初始化数据库

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

检查数据库

mysql -uroot -p000000
use cinder;
show tables;

Cinder组件初始化

创建Cinder用户并分配角色

source admin.sh
openstack user create --domain default --password 000000 cinder
openstack role add --project project --user cinder admin

创建Cinder服务及服务端点

openstack service create --name cinderv3 volumev3
openstack endpoint create --region RegionOne cinderv3 public http://controller:8776/v3/%\(project_id\)s
openstack endpoint create --region RegionOne cinderv3 internal http://controller:8776/v3/%\(project_id\)s
openstack endpoint create --region RegionOne cinderv3 admin http://controller:8776/v3/%\(project_id\)s

启动控制节点的Cinder服务

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

检测控制节点的Cinder服务

查看端口占用情况

netstat -nutpl|grep 8776

配置计算cinder服务后执行以下命令

查看存储服务列表

openstack volume service list

使用命令创建卷,创建一个10G的卷,命名为volume1

openstack volume create --size 10 volume1

查看卷列表

openstack volume list

所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自linlink~文档