cinder存储部署

环境前部署添加一块新的硬盘

第一步:下载逻辑卷服务
[root@zxw8 ~]# yum install lvm2 -y

第二步:启动lvm服务
[root@zxw8 ~]# systemctl start lvm2-lvmetad.service
[root@zxw8 ~]# systemctl enable lvm2-lvmetad.service

第三步:创建pv物理卷
[root@zxw8 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 19G 0 part
├─cl-root 253:0 0 17G 0 lvm /
└─cl-swap 253:1 0 2G 0 lvm [SWAP]
sdb 8:16 0 10G 0 disk
sr0 11:0 1 4.1G 0 rom /mnt
您在 /var/spool/mail/root 中有新邮件
[root@zxw8 ~]# pvcreate /dev/sdb
Physical volume "/dev/sdb" successfully created.


第四步:创建卷宗组
[root@zxw8 ~]# vgcreate vg_cinder /dev/sdb
Volume group "vg_cinder" successfully created

第五步:修改lvm的配置文件
devices {
filter = [ "a/sdb/", "r/.*/" ]


第六步:下载cinder存储
[root@zxw8 cinder]# yum install openstack-cinder targetcli python-keystone -y


第七步:配置cinder文件
[root@zxw8 cinder]# egrep -v '(#|^$)' cinder.conf

[DEFAULT]
my_ip = 172.16.254.63
glance_api_servers = http://controller:9292
auth_strategy = keystone
enabled_backends = lvm
transport_url = rabbit://openstack:admin@controller
 
[backend]
 
[barbican]
 
[brcd_fabric_example]
 
[cisco_fabric_example]
 
[coordination]
 
[cors]
 
[cors.subdomain]
 
[database]
connection = mysql+pymysql://cinder:CINDER_DBPASS@controller/cinder
 
[fc-zone-manager]
 
[healthcheck]
 
[key_manager]
 
[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
 
[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

 

 

 

第八步:启动服务。并开机自启
[root@zxw8 ~]# systemctl start openstack-cinder-volume.service target.service
[root@zxw8 ~]# systemctl enable openstack-cinder-volume.service target.service


访问
查看服务是否启动
[root@zxw6 ~]# cinder service-list
+------------------+----------+------+---------+-------+----------------------------+-----------------+
| Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
+------------------+----------+------+---------+-------+----------------------------+-----------------+
| cinder-scheduler | zxw6 | nova | enabled | up | 2019-08-03T01:25:14.000000 | - |
| cinder-volume | zxw8@lvm | nova | enabled | up | 2019-08-03T01:25:11.000000 | - |
+------------------+----------+------+---------+-------+----------------------------+-----------------+
查看卷
[root@zxw6 ~]# cinder list
+----+--------+------+------+-------------+----------+-------------+
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+----+--------+------+------+-------------+----------+-------------+

 

删除cinder不用的服务:

 

(1) 禁用服务
openstack volume service set --disable HOST_NAME BINARY_NAME
(2) 从数据库中删除节点
cinder-manage service remove BINARY_NAME HOST_NAME
(3) 查看服务:

 

posted on 2019-08-16 14:15  我就是我没毛病  阅读(490)  评论(0编辑  收藏  举报

导航