openstack核心组件-块存储 (Block Storage) : Cinder

cinder 介绍:

部署

控制节点

#mysql -uroot -p123

> 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';

创建用户

#openstack user create --domain default --password=cinder cinder

设为管理员

#openstack role add --project service --user cinder admin

创建2个服务

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

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

创建服务端点

#openstack endpoint create --region RegionOne \
volumev2 public http://pikachu1:8776/v2/%\(project_id\)s

#openstack endpoint create --region RegionOne \
volumev2 internal http://pikachu1:8776/v2/%\(project_id\)s

#openstack endpoint create --region RegionOne \
volumev2 admin http://pikachu1:8776/v2/%\(project_id\)s

#openstack endpoint create --region RegionOne \
volumev3 public http://pikachu1:8776/v3/%\(project_id\)s

#openstack endpoint create --region RegionOne \
volumev3 internal http://pikachu1:8776/v3/%\(project_id\)s

#openstack endpoint create --region RegionOne \
volumev3 admin http://pikachu1:8776/v3/%\(project_id\)s

安装cinder服务

#yum install openstack-cinder

修改配置文件

#cp /etc/cinder/cinder.conf /etc/cinder/cinder.conf.bak
#vim /etc/cinder/cinder.conf

[DEFAULT]
my_ip = 192.168.146.53
存储节点管理网ip
#glance_api_servers = http://controller:9292
auth_strategy = keystone
#enabled_backends = lvm
transport_url = rabbit://openstack:[email protected]

[backend]

[barbican]

[brcd_fabric_example]

[cisco_fabric_example]

[coordination]

[cors]

[cors.subdomain]

[database]
connection = mysql+pymysql://cinder:[email protected]/cinder

[fc-zone-manager]

[healthcheck]

[key_manager]

[keystone_authtoken]
auth_uri = http://pikachu1:5000
auth_url = http://pikachu1:35357
memcached_servers = pikachu1:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = cinder

[matchmaker_redis]

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

[oslo_messaging_amqp]

[oslo_messaging_kafka]

[oslo_messaging_notifications]

[oslo_messaging_rabbit]

[oslo_messaging_zmq]

[oslo_middleware]

[oslo_policy]

[oslo_reports]

[oslo_versionedobjects]

[profiler]

[ssl]

[lvm]
#volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
#volume_group = cinder-vg
#volumes_dir = $state_path/volumes
#iscsi_protocol = iscsi
#iscsi_helper = lioadm
#iscsi_ip_address = 172.16.254.63

同步数据库

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

计算节点(所有计算节点)

#vim /etc/nova/nova.conf

在这里插入图片描述

控制节点
#systemctl restart openstack-nova-api.service
计算节点
#systemctl restart openstack-nova-compute.service
控制节点
#systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service
#systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service


#nova service-list
#neutron agent-list

存储节点

#yum install lvm2

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

创建pv

#pvcreate /dev/sdb

#vgcreate cinder-volumes /dev/sdb

编辑配置文件

#vim /etc/lvm/lvm.conf

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

安装软件

#yum install openstack-cinder targetcli python-keystone -y

修改配置文件

#cp /etc/cinder/cinder.conf /etc/cinder/cinder.conf.bak
#vim /etc/cinder/cinder.conf

[DEFAULT]
my_ip = 192.168.146.53
glance_api_servers = http://pikachu1:9292
auth_strategy = keystone
enabled_backends = lvm
开启后端存储
transport_url = rabbit://openstack:[email protected]

[backend]

[barbican]

[brcd_fabric_example]

[cisco_fabric_example]

[coordination]

[cors]

[cors.subdomain]

[database]
connection = mysql+pymysql://cinder:[email protected]/cinder

[fc-zone-manager]

[healthcheck]

[key_manager]

[keystone_authtoken]
auth_uri = http://pikachu1:5000
auth_url = http://pikachu1:35357
memcached_servers = pikachu1:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = cinder

[matchmaker_redis]

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

[oslo_messaging_amqp]

[oslo_messaging_kafka]

[oslo_messaging_notifications]

[oslo_messaging_rabbit]

[oslo_messaging_zmq]

[oslo_middleware]

[oslo_policy]

[oslo_reports]

[oslo_versionedobjects]

[profiler]

[ssl]

[lvm]
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_group = cinder-volumes
volumes_dir = $state_path/volumes
iscsi_protocol = iscsi
iscsi_helper = lioadm
iscsi_ip_address = 192.168.146.53

启动

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

控制节点
#cinder service-list

注意控制节点第三块网卡(外网)
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

存储节点
在这里插入图片描述

创建虚拟机

在这里插入图片描述
在这里插入图片描述

创建网络
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/PpikachuP/article/details/89317423
0条评论
添加一条新回复