openstack controller ha测试环境搭建记录(十三)——配置cinder(控制节点)
Posted 多看多学多记多实践
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了openstack controller ha测试环境搭建记录(十三)——配置cinder(控制节点)相关的知识,希望对你有一定的参考价值。
在任一控制节点创建用户:
mysql -u root -p
CREATE DATABASE cinder;
GRANT ALL PRIVILEGES ON cinder.* TO ‘cinder‘@‘localhost‘ IDENTIFIED BY ‘123456‘;
GRANT ALL PRIVILEGES ON cinder.* TO ‘cinder‘@‘%‘ IDENTIFIED BY ‘123456‘;
在任一控制节点创建相关用户:
source admin-openrc.sh
keystone user-create --name cinder --pass 123456
keystone user-role-add --user cinder --tenant service --role admin
keystone service-create --name cinder --type volume --description "OpenStack Block Storage"
keystone service-create --name cinderv2 --type volumev2 --description "OpenStack Block Storage"
keystone endpoint-create \
--service-id $(keystone service-list | awk ‘/ volume / {print $2}‘) \
--publicurl http://myvip:8776/v1/%\(tenant_id\)s \
--internalurl http://myvip:8776/v1/%\(tenant_id\)s \
--adminurl http://myvip:8776/v1/%\(tenant_id\)s \
--region regionOne
keystone endpoint-create \
--service-id $(keystone service-list | awk ‘/ volumev2 / {print $2}‘) \
--publicurl http://controller:8776/v2/%\(tenant_id\)s \
--internalurl http://controller:8776/v2/%\(tenant_id\)s \
--adminurl http://controller:8776/v2/%\(tenant_id\)s \
--region regionOne
在每个控制节点安装软件:
yum install -y openstack-cinder python-cinderclient python-oslo-db
在每个控制节点修改配置文件:
openstack-config --set /etc/cinder/cinder.conf database connection mysql://cinder:[email protected]/cinder
openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_password 123456
openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_hosts controller1:5672,controller2:5672,controller3:5672
openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_retry_interval 1
openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_retry_backoff 2
openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_max_retries 0
openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_durable_queues true
openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_ha_queues true
openstack-config --set /etc/cinder/cinder.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_uri http://myvip:5000/v2.0
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken identity_uri http://myvip:35357
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken admin_user cinder
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken admin_tenant_name service
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken admin_password 123456
openstack-config --set /etc/cinder/cinder.conf DEFAULT my_ip 10.0.0.10
openstack-config --set /etc/cinder/cinder.conf DEFAULT verbose True
在任一控制节点初始化cinder数据库:
su -s /bin/sh -c "cinder-manage db sync" cinder
尝试在拥有VIP资源的节点启动cinder服务:
systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service
以上是关于openstack controller ha测试环境搭建记录(十三)——配置cinder(控制节点)的主要内容,如果未能解决你的问题,请参考以下文章
openstack controller ha测试环境搭建记录——配置neutron(计算节点)
openstack controller ha测试环境搭建记录——配置neutron(网络节点)