openstack-pike安装cinder使用cinder做后端存储

在控制节点安装

1、首先进入数据库创建cinder库,并赋予权限

mysql -u root -p
CREATE DATABASE cinder;
GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' \
IDENTIFIED BY 'CINDER_DBPASS';
GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' \

IDENTIFIED BY 'CINDER_DBPASS';

2、创建cinder用户并且添加赋予权限

openstack user create --domain default --password-prompt cinder
openstack role add --project service --user cinder admin

3、创建cinderv2和cinderv3服务

openstack service create --name cinderv2 \
  --description "OpenStack Block Storage" volumev2
openstack service create --name cinderv3 \
  --description "OpenStack Block Storage" volumev3

4、创建块存储服务API

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

5、安装cinder软件

yum install openstack-cinder

6、编辑配置文件/etc/cinder/cinder.conf

[database]
connection = mysql+pymysql://cinder:CINDER_DBPASS@controller/cinder
[DEFAULT]
transport_url = rabbit://openstack:RABBIT_PASS@controller
[DEFAULT]
auth_strategy = keystone
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = CINDER_PASS
[DEFAULT]
my_ip = 10.0.0.11
[oslo_concurrency]
lock_path = /var/lib/cinder/tmp

7、同步数据库

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

8、配置compute使用cinder存储

在控制节点配置/etc/nova/nova.conf
[cinder]
os_region_name = RegionOne

9、重启nova API服务

 systemctl restart openstack-nova-api.service

10、启动cinder存储服务,并且加入开机自启动

systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service
systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service

安装配置存储节点

1、安装支持软件包

yum install lvm2 device-mapper-persistent-data

2、启动lvm2-lvmetad.service服务并且加入开机自启动服务

systemctl enable lvm2-lvmetad.service
systemctl start lvm2-lvmetad.service

3、创建LVM物理卷/dev/sdb

pvcreate /dev/sdb

4、创建LVM卷组cinder-volumes:

vgcreate cinder-volumes /dev/sdb

5、修改配置文件/etc/lvm/lvm.conf添加以下内容

devices {
...
filter = [ "a/sdb/", "r/.*/"]

6、安装cider软件包

yum install openstack-cinder targetcli python-keystone

7、修改配置文件/etc/cinder/cinder.conf

[database]
connection = mysql+pymysql://cinder:CINDER_DBPASS@controller/cinder
[DEFAULT]
transport_url = rabbit://openstack:RABBIT_PASS@controller
[DEFAULT]
auth_strategy = keystone
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = CINDER_PASS
[DEFAULT]
my_ip = MANAGEMENT_INTERFACE_IP_ADDRESS
[lvm]
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_group = cinder-volumes
iscsi_protocol = iscsi
iscsi_helper = lioadm
[DEFAULT]
enabled_backends = lvm
[DEFAULT]
glance_api_servers = http://controller:9292
[oslo_concurrency]
lock_path = /var/lib/cinder/tmp

8、启动cinder服务

systemctl enable openstack-cinder-volume.service target.service
systemctl start openstack-cinder-volume.service target.service

9、验证

openstack volume service list

你可能感兴趣的:(openstack-pike安装cinder使用cinder做后端存储)