一、组网图
无
二、问题描述
RedHat 7 服务器两条路径挂载存储的卷,将当前单路径使用方式修改为多路径,且文件系统挂载点不变。
如下命令结果:sdb、sdc是两个路径对应的块设备,挂载点是/test。
[root@BCK-Server ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 40G 0 disk ├─sda1 8:1 0 200M 0 part /boot └─sda2 8:2 0 39.8G 0 part ├─rhel_bck--server-swap 253:0 0 4G 0 lvm [SWAP] └─rhel_bck--server-root 253:1 0 35.8G 0 lvm / sdb 8:16 0 16G 0 disk └─sdb1 8:17 0 16G 0 part /test sdc 8:32 0 16G 0 disk └─sdc1 8:33 0 16G 0 part sr0 11:0 1 3.5G 0 rom
然后安装multipath软件,修改聚合配置文件,启动multipathd服务,执行如下命令发现没有聚合成功:
[root@BCK-Server ~]# multipath -ll 查看当前多路径聚合结果,没有成功 [root@BCK-Server ~]# multipath -v2 刷新多路径配置信息 May 15 13:11:07 | mpatha: ignoring map May 15 13:11:07 | mpatha: ignoring map [root@BCK-Server ~]# multipath -r 重新加载多路径配置信息 May 15 13:11:12 | mpatha: ignoring map May 15 13:11:12 | mpatha: ignoring map
三、过程分析
查看当前块设备和多路径聚合详细情况,执行命令:
[root@BCK-Server ~]# multipath -v3 打印信息较多,参考如下: May 15 13:42:17 | loading /lib64/multipath/libcheckdirectio.so checker May 15 13:42:17 | loading /lib64/multipath/libprioconst.so prioritizer …… ===== paths list ===== uuid hcil dev dev_t pri dm_st chk_st vend/pro 0:0:0:0 sda 8:0 1 undef ready VMware 3600b342396448b6dffafd2fc6d0000d2 33:0:0:0 sdb 8:16 10 undef ready MacroSAN 3600b342396448b6dffafd2fc6d0000d2 34:0:0:0 sdc 8:32 50 undef ready MacroSAN …… May 15 13:42:17 | 3600b342396448b6dffafd2fc6d0000d2: alias_prefix = mpath (internal default) May 15 13:42:17 | Found matching wwid [3600b342396448b6dffafd2fc6d0000d2] in bindings file. Setting alias to mpatha May 15 13:42:17 | sdb: ownership set to mpatha May 15 13:42:17 | sdb: not found in pathvec May 15 13:42:17 | sdb: mask = 0xc May 15 13:42:17 | sdb: path state = running May 15 13:42:17 | sdb: get_state May 15 13:42:17 | sdb: state = up May 15 13:42:17 | reported target port group is 1 May 15 13:42:17 | aas = 01 [active/non-optimized] May 15 13:42:17 | sdb: alua prio = 10 May 15 13:42:17 | sdc: ownership set to mpatha May 15 13:42:17 | sdc: not found in pathvec May 15 13:42:17 | sdc: mask = 0xc May 15 13:42:17 | sdc: path state = running May 15 13:42:17 | sdc: get_state May 15 13:42:17 | sdc: state = up May 15 13:42:17 | reported target port group is 2 May 15 13:42:17 | aas = 00 [active/optimized] May 15 13:42:17 | sdc: alua prio = 50 …… May 15 13:42:17 | mpatha: assembled map [1 queue_if_no_path 0 2 1 round-robin 0 1 1 8:32 1 round-robin 0 1 1 8:16 1] May 15 13:42:17 | mpatha: set ACT_CREATE (map does not exist) May 15 13:42:17 | mpatha: domap (0) failure for create/reload map May 15 13:42:17 | mpatha: ignoring map
结合multipath -v3打印信息可以看出,两条路径正常识别,并分配别名mpatha,但是生成map失败。
失败原因与当前设备存在挂载点有关,需要卸载后,再进行聚合生成。
四、解决方法
1、卸载当前卷上边的分区挂载点。
[root@BCK-Server ~]# umount /test [root@BCK-Server ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 40G 0 disk ├─sda1 8:1 0 200M 0 part /boot └─sda2 8:2 0 39.8G 0 part ├─rhel_bck--server-swap 253:0 0 4G 0 lvm [SWAP] └─rhel_bck--server-root 253:1 0 35.8G 0 lvm / sdb 8:16 0 16G 0 disk └─sdb1 8:17 0 16G 0 part sdc 8:32 0 16G 0 disk └─sdc1 8:33 0 16G 0 part sr0 11:0 1 3.5G 0 rom /mnt
2、再次执行加载多路径配置命令。
[root@BCK-Server ~]# multipath -v2 生成聚合信息 create: mpatha (3600b342396448b6dffafd2fc6d0000d2) undef MacroSAN,LU size=16G features='1 queue_if_no_path' hwhandler='0' wp=undef |-+- policy='round-robin 0' prio=50 status=undef | `- 34:0:0:0 sdc 8:32 undef ready running `-+- policy='round-robin 0' prio=10 status=undef `- 33:0:0:0 sdb 8:16 undef ready running [root@BCK-Server ~]# multipath -r 重新加载 reload: mpatha (3600b342396448b6dffafd2fc6d0000d2) undef MacroSAN,LU size=16G features='1 queue_if_no_path' hwhandler='0' wp=undef |-+- policy='round-robin 0' prio=50 status=undef | `- 34:0:0:0 sdc 8:32 active ready running `-+- policy='round-robin 0' prio=10 status=undef `- 33:0:0:0 sdb 8:16 active ready running [root@BCK-Server ~]# multipath -ll mpatha (3600b342396448b6dffafd2fc6d0000d2) dm-2 MacroSAN,LU size=16G features='1 queue_if_no_path' hwhandler='0' wp=rw |-+- policy='round-robin 0' prio=50 status=active | `- 34:0:0:0 sdc 8:32 active ready running `-+- policy='round-robin 0' prio=10 status=enabled `- 33:0:0:0 sdb 8:16 active ready running
3、将聚合后的分区挂载值原有挂载点。
[root@BCK-Server ~]# mount /dev/mapper/mpatha1 /test [root@BCK-Server ~]# df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/mapper/rhel_bck--server-root xfs 36G 8.5G 28G 24% / devtmpfs devtmpfs 3.9G 0 3.9G 0% /dev tmpfs tmpfs 3.9G 80K 3.9G 1% /dev/shm tmpfs tmpfs 3.9G 17M 3.9G 1% /run tmpfs tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup /dev/sda1 xfs 197M 104M 94M 53% /boot /dev/sr0 iso9660 3.5G 3.5G 0 100% /mnt /dev/mapper/mpatha1 ext4 16G 45M 15G 1% /test
五、风险提示
单路径切换为多路径,对于已经存在挂载点的块设备,需要停业务,卸载挂载点,才能聚合成功。
六、关键字
multipath,单路径,ignoring