Skip to content

搭建存储节点(实践)

为计算节点增加一块120G的硬盘(关机状态下),取名字为cinder

创建卷组

查看磁盘信息

lsblk

创建LVM物理卷组

将硬盘初始化为物理卷

pvcreate /dev/sdb
vgcreate cinder-volumes /dev/sdb

编辑lvm配置文件

cp /etc/lvm/lvm.conf /etc/lvm/lvm.conf.back
vi /etc/lvm/lvm.conf

devices里添加一个filter

devices {
    filter = ["a/sdb/"]
}

启动LVM元数据服务

systemctl enable lvm2-lvmetad
systemctl start lvm2-lvmetad
systemctl status lvm2-lvmetad

安装及配置Cinder服务

安装相关软件包

yum -y install openstack-cinder targetcli python-keystone

备份及编辑文件

cp /etc/cinder/cinder.conf /etc/cinder/cinder.conf.back
grep -Ev '^$|#' /etc/cinder/cinder.conf.back > /etc/cinder/cinder.conf
vi /etc/cinder/cinder.conf

修改[database]部分

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

修改[DEFAULT]

[DEFAULT]
auth_strategy = keystone
enabled_backends = lvm
transport_url = rabbit://rabbitmq:000000@controller
glance_api_servers = http://controller:9292

修改[keystone_authtoken]

[keystone_authtoken]
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = project
username = cinder
password = 000000

修改[oslo_concurrency]

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

添加[lvm]

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

启动Cinder服务

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

所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自linlink~文档