B14-openstack高可用(t版)-cinder控制节点集群
1. 创建cinder数据库
MariaDB [(none)]> CREATE DATABASE cinder;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' IDENTIFIED BY 'huayun';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' IDENTIFIED BY 'huayun';
2. 创建cinder-api
1)创建cinder用户
[root@controller01 ~]# openstack user create --domain default --password=huayun cinder
2)cinder赋权
[root@controller01 ~]# openstack role add --project service --user cinder admin
3)创建cinder服务实体
# cinder服务实体类型”volume”; # 创建v2/v3两个服务实体
[root@controller01 ~]# openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2
[root@controller01 ~]# openstack service create --name cinderv3 --description "OpenStack Block Storage" volumev3
4)创建cinder-api
[root@controller01 ~]# openstack endpoint create --region RegionOne volumev2 public http://10.100.214.200:8776/v2/%\(project_id\)s
[root@controller01 ~]# openstack endpoint create --region RegionOne volumev2 internal http://10.100.214.200:8776/v2/%\(project_id\)s
[root@controller01 ~]# openstack endpoint create --region RegionOne volumev2 admin http://10.100.214.200:8776/v2/%\(project_id\)s
[root@controller01 ~]# openstack endpoint create --region RegionOne volumev3 public http://10.100.214.200:8776/v3/%\(project_id\)s
[root@controller01 ~]# openstack endpoint create --region RegionOne volumev3 internal http://10.100.214.200:8776/v3/%\(project_id\)s
[root@controller01 ~]# openstack endpoint create --region RegionOne volumev3 admin http://10.100.214.200:8776/v3/%\(project_id\)s
3. 安装cinder
[root@controller01 ~]# yum install openstack-cinder -y
4. 配置cinder.conf
[root@controller01 ~]# egrep -v "^#|^$" /etc/cinder/cinder.conf
[DEFAULT]
transport_url = rabbit://openstack:huayun@10.100.214.200
auth_strategy = keystone
my_ip = 10.100.214.201
glance_api_servers = http://10.100.214.200:9292
osapi_volume_listen = $my_ip
osapi_volume_listen_port = 8776
log_dir = /var/log/cinder
[backend]
[backend_defaults]
[barbican]
[brcd_fabric_example]
[cisco_fabric_example]
[coordination]
[cors]
[database]
connection = mysql+pymysql://cinder:huayun@10.100.214.200/cinder
[fc-zone-manager]
[healthcheck]
[key_manager]
[keystone_authtoken]
www_authenticate_uri = http://10.100.214.200:5000
auth_url = http://10.100.214.200:5000
memcached_servers = 10.100.214.201:11211,10.100.214.202:11211,10.100.214.203:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = huayun
[nova]
[oslo_concurrency]
lock_path = /var/lib/cinder/tmp
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_middleware]
[oslo_policy]
[oslo_reports]
[oslo_versionedobjects]
[privsep]
[profiler]
[sample_castellan_source]
[sample_remote_file_source]
[service_user]
[ssl]
[vault]
将配置文件拷贝到另外两个节点,并修改相应配置
[root@controller01 ~]# scp /etc/cinder/cinder.conf 10.100.214.202:/etc/cinder/
[root@controller01 ~]# scp /etc/cinder/cinder.conf 10.100.214.203:/etc/cinder/
5. 配置nova.conf
[root@controller01 ~]# vim /etc/nova/nova.conf
[cinder]
os_region_name = RegionOne
6. 同步cinder数据库
[root@controller01 ~]# su -s /bin/sh -c "cinder-manage db sync" cinder
7. 启动服务
[root@controller01 ~]# systemctl restart openstack-nova-api.service
[root@controller01 ~]# systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service
[root@controller01 ~]# systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service
8. 验证
9. 设置pcs资源
[root@controller01 ~]# pcs resource create openstack-cinder-api systemd:openstack-cinder-api --clone interleave=true
[root@controller01 ~]# pcs resource create openstack-cinder-scheduler systemd:openstack-cinder-scheduler --clone interleave=true