Multipath 安装
不知道,不了解 multipath 的可以看下这个文档(看到 Overview 就差不多了),介绍的很不错:
1. 安装 device-mapper-multipath RPM 包
检查安装包是否存在(不同 Linux 环境显示的结果不一样):
[root@controller ~]# rpm -qa | grep device-mapper-multipath
device-mapper-multipath-libs-0.4.9-77.el7.x86_64
device-mapper-multipath-0.4.9-77.el7.x86_64
- 1
- 2
- 3
如果不存在,安装该 RPM 包:
[root@controller ~]# yum install device-mapper-multipath
- 1
2. 手动生成 /etc/multipath.conf 文件,命令如下:
[root@controller ~]# mpathconf --enable
- 1
3. 编辑 multipath.conf 文件(非必选)
根据自己的配置需求编辑这个配置文件,最简单的是不改文件。
vim /etc/multipath.conf
defaults {
user_friendly_names yes
path_grouping_policy multibus
find_multipaths yes
no_path_retry fail
failback immediate
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
4. 重启 multipath 服务
请务必确认服务的状态!
[root@controller ~]# systemctl restart multipathd.service
[root@controller ~]# systemctl status multipathd.service
- 1
- 2
如果服务为 failed,请先排查错误,确认状态正常之后再做后面的配置:
Ps: 很多小伙伴都没有这个习惯,导致很多事情做完之后才发现前面的有问题,然后导致连锁问题。
[root@controller ~]# systemctl status multipathd.service
multipathd.service - Device-Mapper Multipath Device Controller
Loaded: loaded (/usr/lib/systemd/system/multipathd.service; enabled)
Active: active (running) since Fri 2016-12-30 13:35:18 CST; 1 weeks 2 days ago
Process: 551 ExecStart=/sbin/multipathd (code=exited, status=0/SUCCESS)
Process: 534 ExecStartPre=/sbin/multipath -A (code=exited, status=0/SUCCESS)
Process: 498 ExecStartPre=/sbin/modprobe dm-multipath (code=exited, status=0/SUCCESS)
Main PID: 558 (multipathd)
CGroup: /system.slice/multipathd.service
└─558 /sbin/multipathd
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
Openstack Nova + Cinder 配置
1. 修改 nova 以及 cinder 配置文件
(1) 修改 nova.conf
Use multipath connection of the iSCSI or FC volume (boolean value)
编辑 nova.conf,libvirt 下配置 iscsi_use_multipath=true
[root@controller ~]# grep multipath /etc/nova/nova.conf
# Use multipath connection of the iSCSI volume (boolean value)
#iscsi_use_multipath=false
iscsi_use_multipath=true
# Use multipath connection of the iSER volume (boolean value)
#iser_use_multipath=false
- 1
- 2
- 3
- 4
- 5
- 6
(2) 修改 cinder.conf
Do we attach/detach volumes in cinder using multipath for volume to image and image to volume transfers? (boolean value)
编辑 cinder.conf,在使用的 backend 中配置 use_multipath_for_image_xfer=true
# Do we attach/detach volumes in cinder using multipath for volume to image and
# image to volume transfers? (boolean value)
#use_multipath_for_image_xfer = false
# If this is set to True, attachment of volumes for image transfer will be
# aborted when multipathd is not running. Otherwise, it will fallback to single
# path. (boolean value)
#enforce_multipath_for_image_xfer = false
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
2. 重启 nova 和 cinder 相关服务
(1) 重启 nova-compute 服务(attach multipath)
systemctl restart openstack-nova-compute.service
(2) 重启 cinder-volume 服务(cinder multipath)
systemctl restart openstack-cinder-volume.service