os: centos 7.6
如果需要确保不同服务器上的 multipath 名称一致,就需要使用 bindings 文件方法或者 multipaths 的 alias.
user_friendly_names 设置为 no
确保所有节点 /etc/multipath.conf 的 user_friendly_names 设置为 no,这很重要
bindings 文件
第一步: 在一台服务器上设定 multipath 设备
# cat /etc/multipath/wwids
3600508b4000156d700012000000b0000
3600508b4000156d700012000000b0001
# vi /etc/multipath/bindings
asmdisk01 3600508b4000156d700012000000b0000
asmdisk02 3600508b4000156d700012000000b0001
第二步: 其余节点禁用 multipath 设备
# systemctl stop multipathd.service;
# multipath -F
第三步: 然后把 bindings 文件拷贝到其余的机器上
# scp /etc/multipath/bindings node2:/etc/multipath/
第四步: 其余节点再启用 multipath 设备
# systemctl start multipathd.service;
采用 bindings 文件方法,就不需要修改 multipath.conf 的 alias
multipath.conf 文件 multipaths 的 alias
这种方法就不需要修改 bindings,直接修改 multipath.conf
# vi /etc/multipath.conf
multipaths {
multipath {
wwid 3600508b4000156d700012000000b0000
gid 0
uid 0
mode 0600
alias asmdisk01
path_grouping_policy multibus
path_selector "round-robin 0"
}
multipath {
wwid 3600508b4000156d700012000000b0001
gid 0
uid 0
mode 0600
alias asmdisk02
path_grouping_policy multibus
path_selector "round-robin 0"
}
}
重新加载
# multipath -r
参考:
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/dm_multipath/index
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/dm_multipath/config_file_defaults
https://access.redhat.com/documentation/zh-cn/red_hat_enterprise_linux/7/html/dm_multipath/multipath_consistent_names