RHEL7 多路径multipath配置

multipath的高级配置

映射设备的名称,multipath负载均衡的方法都是默认设置。那有没有按照我们自己定义的方法来配置multipath呢,当可以。

1、multipath.conf文件的配置

接下来的工作就是要编辑/etc/multipath.conf的配置文件

multipath.conf主要包括blacklist、multipaths、devices三部份的配置

#blacklist配置

blacklist {

devnode "^sda"

}

 

#Multipaths部分配置multipaths和devices两部份的配置。

multipaths {

multipath {

wwid **************** #此值multipath -v3可以看到

alias iscsi-dm0 #映射后的别名,可以随便取

path_grouping_policy multibus #路径组策略

path_checker tur #决定路径状态的方法

path_selector "round-robin 0" #选择那条路径进行下一个IO操作的方法

}

}

 

#Devices部分配置

devices {

device {

vendor "iSCSI-Enterprise" #厂商名称

product "Virtual disk" #产品型号

path_grouping_policy multibus #默认的路径组策略

getuid_callout "/sbin/scsi_id -g -u -s /block/%n" #获得唯一设备号使用的默认程序

prio_callout "/sbin/acs_prio_alua %d" #获取有限级数值使用的默认程序

path_checker readsector0 #决定路径状态的方法

path_selector "round-robin 0" #选择那条路径进行下一个IO操作的方法

failback immediate #故障恢复的模式

no_path_retry queue #在disable queue之前系统尝试使用失效路径的次数的数值

rr_min_io 100 #在当前的用户组中,在切换到另外一条路径之前的IO请求的数目

}

}

 如下是一个完整的配置文件

blacklist {

devnode "^sda"

}

 

defaults {

user_friendly_names no

}

 

multipaths {

multipath {

wwid 14945540000000000a67854c6270b4359c66c272e2f356321

alias iscsi-dm0

path_grouping_policy multibus

path_checker tur

path_selector "round-robin 0"

}

multipath {

wwid 14945540000000000dcca2eda91d70b81edbcfce2357f99ee

alias iscsi-dm1

path_grouping_policy multibus

path_checker tur

path_selector "round-robin 0"

}

multipath {

wwid 1494554000000000020f763489c165561101813333957ed96

alias iscsi-dm2

path_grouping_policy multibus

path_checker tur

path_selector "round-robin 0"

}

multipath {

wwid 14945540000000000919ca813020a195422ba3663e1f03cc3

alias iscsi-dm3

path_grouping_policy multibus

path_checker tur

path_selector "round-robin 0"

}

}

 

devices {

device {

vendor "iSCSI-Enterprise"

product "Virtual disk"

path_grouping_policy multibus

getuid_callout "/sbin/scsi_id -g -u -s /block/%n"

path_checker readsector0

path_selector "round-robin 0"

}

}

 

获取wwid的方法:

(1)默认情况下,将使用/var/lib/multipath/bindings 内的配置设定具体每个多路径设备名,如果在/etc/multipath.conf中有设定各wwid 别名,别名会覆盖此设定。

[root@vxfs01 ~]# cat /var/lib/multipath/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
#
mpath0 36006016051d50e0035744871c912de11
mpath1 36006016051d50e0034744871c912de11
mpath2 36006016051d50e0032744871c912de11
mpath3 36006016051d50e0039744871c912de11
mpath4 36006016051d50e003a744871c912de11


(2)# multipath -v3命令查找

[root@vxfs01 ~]# multipath -v3 |grep 3600
sdb: uid = 36006016051d50e003a744871c912de11 (callout)
sdc: uid = 36006016051d50e003a744871c912de11 (callout)
sdd: uid = 36006016051d50e003a744871c912de11 (callout)
sde: uid = 36006016051d50e003a744871c912de11 (callout)
36006016051d50e003a744871c912de11 1:0:0:0 sdb 8:16 0 [undef][ready] DGC,RAI
36006016051d50e003a744871c912de11 1:0:1:0 sdc 8:32 1 [undef][ready] DGC,RAI
36006016051d50e003a744871c912de11 2:0:0:0 sdd 8:48 1 [undef][ready] DGC,RAI
36006016051d50e003a744871c912de11 2:0:1:0 sde 8:64 0 [undef][ready] DGC,RAI
Found matching wwid [36006016051d50e003a744871c912de11] in bindings file.

 


########################
#/sbin/mpathconf /检查多路径服务状态
multipath is enabled
find_multipaths is disabled
user_friendly_names is enabled
dm_multipath module is loaded
multipathd is chkconfiged on

 

 

 

你可能感兴趣的:(Linux)