linux 7 multipath多路径软件部署
【摘要】 multipath
操作系统版本信息:
CentOS Linux release 7.8.2003 (Core)
01,多路径软件安装
#软件安装
yum install device-mapper-multipath -y
#开机自动启动
systemctl enable multipathd.service
#加载模块
lsmod |grep multipath
modprobe dm-multipath
modprobe dm-round-robin
lsmod |grep multipath
正常模块加载信息:
[root@hecs-66a2 ~]# lsmod |grep multipath
dm_multipath 27792 4 dm_round_robin,dm_service_time
dm_mod 124501 3 dm_multipath
03,软件配置
#生成默认配置文件
/sbin/mpathconf --enable
修改默认参数
sed -i 's/find_multipaths/#find_multipaths/' /etc/multipath.conf
#参数说明
#find_multipaths如置为yes,则将为3种场景创建多路径设备(不在黑名单的两个路径的wwid相同;用户手动强制创建;一个路径的wwid与之前已经创建的多路径设备相同)
#user_friendly_names:如为yes,则用/etc/multipath/bindings中的设置命名;
04,启动多路径软件
#加载路径配置文件
multipath -r
#查看聚合路径信息
multipath -ll
#启动多路径软件
systemctl enable multipathd.service
systemctl restart multipathd.service
05,查看聚合磁盘信息
[root@hecs-66a2 multipath]# multipath -ll
mpathb (36001405a8111ea8e7e54c8fb25613092) dm-1 LIO-ORG ,disk02
size=20G features='0' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=1 status=active
`- 2:0:0:1 sdb 8:16 active ready running
mpatha (360014054170ebd76f8b4cd69600e1ba9) dm-0 LIO-ORG ,disk01
size=10G features='0' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=1 status=active
`- 2:0:0:0 sda 8:0 active ready running
[root@hecs-66a2 multipath]# pwd
/etc/multipath
[root@hecs-66a2 multipath]# cat bindings
# Multipath bindings, Version : 1.0
# NOTE: this file is automatically maintained by the multipath program.
# You should not need to edit this file in normal circumstances.
#
# Format:
# alias wwid
#
mpatha 360014054170ebd76f8b4cd69600e1ba9
mpathb 36001405a8111ea8e7e54c8fb25613092
[root@hecs-66a2 multipath]# cat
bindings wwids
[root@hecs-66a2 multipath]# cat wwids
# Multipath wwids, Version : 1.0
# NOTE: This file is automatically maintained by multipath and multipathd.
# You should not need to edit this file in normal circumstances.
#
# Valid WWIDs:
/360014054170ebd76f8b4cd69600e1ba9/
/36001405a8111ea8e7e54c8fb25613092/
[root@hecs-66a2 multipath]#
06,常用命令参考
#常用命令参考:
/usr/lib/udev/scsi_id -g -u /dev/sda(手动检查wwid)
multipath -r (修改multipath.conf配置文件之后重新加载)
multipath -ll (查看多路径状态)
multipath -v2 (格式化路径,检测路径,合并路径)
multipath -v3 (查看多路径详情blacklist、whitelist和设备wwid)
multipath -F (删除现有链路)
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)