• 存储节点单独配置,由于限制问题,故此安装到control节点上

    • 安装软件
yum install lvm2 device-mapper-persistent-data -y

systemctl enable lvm2-lvmetad.service
systemctl start lvm2-lvmetad.service
  • 创建LVM物理卷/dev/sdb
pvcreate /dev/sdb
  • 创建LVM卷组cinder-volumes
vgcreate cinder-volumes /dev/sdb
  • 配置LVM

    • 如果已使用LVM,则需要把其他的磁盘都添加到过滤器中
vim /etc/lvm/lvm.conf

devices {
...
filter = [ "a/sdb/", "r/.*/"]
  • 安装软件包
yum install targetcli python-keystone -y
# 此部分已安装,无需安装,如控制节点和存储节点不在一起,需安装yum install openstack-cinder -y
  • 配置
vim /etc/cinder/cinder.conf

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

[DEFAULT]
transport_url = rabbit://openstack:openstack@controller
auth_strategy = keystone
my_ip = 10.0.19.133
enabled_backends = lvm
glance_api_servers = http://controller:9292

[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = xxxxxxx

[lvm]
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_group = cinder-volumes
target_protocol = iscsi
target_helper = lioadm

[oslo_concurrency]
# ...
lock_path = /var/lib/cinder/tmp
  • 开机自启和启动
systemctl enable openstack-cinder-volume.service target.service
systemctl start openstack-cinder-volume.service target.service
  • 安装配置备份服务(可选)
# 此部分已安装,无需安装,如控制节点和存储节点不在一起,需安装yum install openstack-cinder -y
yum install openstack-cinder -y
  • 配置
vim /etc/cinder/cinder.conf

[DEFAULT]
# ...
backup_driver = cinder.backup.drivers.swift.SwiftBackupDriver
backup_swift_url = SWIFT_URL
openstack catalog show object-store
  • 开机自启和启动
systemctl enable openstack-cinder-backup.service
systemctl start openstack-cinder-backup.service