1、LINUX多路径配置LINUX操作系统多路径配置 在Linux和AIX平台都有一部分存储产品使用操作系统自带的多路径软件,包括最常见的HP和IBM的部分存储产品,在Linux自带的多路径软件叫做 multipath,这篇文章以IBM N系列存储在Linux平台的使用为例,讨论Linux平台multipath的使用。1.确保安装以下的包: device-mapper device-mapper-multipath 2.编辑配置文件/etc/multipath.conf RHEL6.4配置文件在/usr/share/doc/device-mapper-multipath-0.4.9/multipa
2、th.conf复制一份到/etc目录 3.启动multipathd服务,及设置其自动启动。 执行以下的命令: #service multipathd restart #chkconfig -level 345 multipathd on #chkconfig -list | grep multipathd 4、修改配置文件rootrac01 # vi /etc/multipath.conf # This is a basic configuration file with some examples, for device mapper# multipath.# For a complete
3、list of the default configuration values, see# /usr/share/doc/device-mapper-multipath-0.4.7/multipath.conf.defaults# For a list of configuration options with descriptions, see# /usr/share/doc/device-mapper-multipath-0.4.7/multipath.conf.annotated# Blacklist all devices by default. Remove this to ena
4、ble multipathing# on the default devices. #排除本地磁盘,不做多路径blacklist devnode sda# By default, devices with vendor = IBM and product = S/390.* are# blacklisted. To enable mulitpathing on these devies, uncomment the# following lines.#blacklist_exceptions # device # vendor IBM# product S/390.*# # Use user
5、friendly names, instead of using WWIDs as names.#defaults # user_friendly_names yes# Here is an example of how to configure some standard options.#defaults udev_dir /dev polling_interval 10 selector round-robin 0 path_grouping_policy multibus getuid_callout /sbin/scsi_id -g -u -s /block/%n prio_call
6、out /bin/true path_checker readsector0 rr_min_io 100 max_fds 8192 rr_weight priorities failback immediate no_path_retry fail user_friendly_names yes# The wwid line in the following blacklist section is shown as an example# of how to blacklist devices by wwid. The 2 devnode lines are the# compiled in
7、 default blacklist. If you want to blacklist entire types# of devices, such as all scsi devices, you should use a devnode line.# However, if you want to blacklist specific devices, you should use# a wwid line. Since there is no guarantee that a specific device will# not change names on reboot (from
8、/dev/sda to /dev/sdb for example)# devnode lines are not recommended for blacklisting specific devices.#blacklist # wwid 26353900f02796769# devnode (ram|raw|loop|fd|md|dm-|sr|scd|st)0-9*# devnode hda-z#multipaths # multipath # wwid 3600508b4000156d700012000000b0000# alias yellow# path_grouping_polic
9、y multibus# path_checker readsector0# path_selector round-robin 0# failback manual# rr_weight priorities# no_path_retry 5# # multipath # wwid 1DEC_321816758474# alias red# #devices # device # vendor COMPAQ # product HSV110 (C)COMPAQ# path_grouping_policy multibus# getuid_callout /sbin/scsi_id -g -u
10、-s /block/%n# path_checker readsector0# path_selector round-robin 0# hardware_handler 0# failback 15# rr_weight priorities# no_path_retry queue# # device # vendor COMPAQ # product MSA1000 # path_grouping_policy multibus# #下面的注释配置不是必须的,配置之后可以固定系统设备的名称,这在服务器重启设备文件对应的磁盘设备发生变化的情况下使用。multipaths multipath
11、 wwid 36005076305ffd648000000000000101d alias data1 multipath wwid 36005076305ffd6480000000000001028 alias data2 multipath wwid 36005076305ffd648000000000000101e alias data3 multipath wwid 36005076305ffd6480000000000001029 alias data4 multipath wwid 36005076305ffd648000000000000101f alias data5 mult
12、ipath wwid 36005076305ffd648000000000000102a alias data6 multipath wwid 36005076305ffd648000000000000102b alias data7 multipath wwid 36005076305ffd648000000000000102c alias data8 multipath wwid 36005076305ffd648000000000000102d alias data9 补充如何获取磁盘WWID rootjceqdw1 # multipath -v3 |grep undef36005076
13、305ffd648000000000000101e 6:0:0:1 sdc 8:32 1 undef ready IBM,2107936005076305ffd648000000000000102b 6:0:0:6 sdh 8:112 1 undef ready IBM,2107936005076305ffd648000000000000101f 6:0:0:2 sdd 8:48 1 undef ready IBM,2107936005076305ffd6480000000000001028 6:0:0:3 sde 8:64 1 undef ready IBM,2107936005076305
14、ffd648000000000000101d 6:0:0:0 sdb 8:16 1 undef ready IBM,2107936005076305ffd648000000000000102d 6:0:0:8 sdj 8:144 1 undef ready IBM,2107936005076305ffd6480000000000001029 6:0:0:4 sdf 8:80 1 undef ready IBM,2107936005076305ffd648000000000000102c 6:0:0:7 sdi 8:128 1 undef ready IBM,2107936005076305ff
15、d648000000000000102a 6:0:0:5 sdg 8:96 1 undef ready IBM,2107936005076305ffd648000000000000101d 7:0:0:0 sdk 8:160 1 undef ready IBM,2107936005076305ffd648000000000000101e 7:0:0:1 sdl 8:176 1 undef ready IBM,2107936005076305ffd6480000000000001028 7:0:0:3 sdn 8:208 1 undef ready IBM,2107936005076305ffd
16、648000000000000101f 7:0:0:2 sdm 8:192 1 undef ready IBM,2107936005076305ffd6480000000000001029 7:0:0:4 sdo 8:224 1 undef ready IBM,2107936005076305ffd648000000000000102b 7:0:0:6 sdq 65:0 1 undef ready IBM,2107936005076305ffd648000000000000102a 7:0:0:5 sdp 8:240 1 undef ready IBM,2107936005076305ffd6
17、48000000000000102c 7:0:0:7 sdr 65:16 1 undef ready IBM,2107936005076305ffd648000000000000102d 7:0:0:8 sds 65:32 1 undef ready IBM,21079或者使用multipath -llrootjceqdw1 # multipath -llDec 12 17:46:35 | multipath.conf line 33, duplicate keyword: defaultsDec 12 17:46:35 | multipath.conf line 36, invalid ke
18、yword: selectorDec 12 17:46:35 | multipath.conf line 39, invalid keyword: prio_calloutdata9 (36005076305ffd648000000000000102d) dm-5 IBM,2107900size=536G features=0 hwhandler=0 wp=rw-+- policy=round-robin 0 prio=1 status=active |- 6:0:0:8 sdj 8:144 active ready running - 7:0:0:8 sds 65:32 active rea
19、dy runningdata8 (36005076305ffd648000000000000102c) dm-7 IBM,2107900size=536G features=0 hwhandler=0 wp=rw-+- policy=round-robin 0 prio=1 status=active |- 6:0:0:7 sdi 8:128 active ready running - 7:0:0:7 sdr 65:16 active ready runningdata7 (36005076305ffd648000000000000102b) dm-1 IBM,2107900size=536
20、G features=0 hwhandler=0 wp=rw-+- policy=round-robin 0 prio=1 status=active |- 6:0:0:6 sdh 8:112 active ready running - 7:0:0:6 sdq 65:0 active ready runningdata6 (36005076305ffd648000000000000102a) dm-8 IBM,2107900size=536G features=0 hwhandler=0 wp=rw-+- policy=round-robin 0 prio=1 status=active |
21、- 6:0:0:5 sdg 8:96 active ready running - 7:0:0:5 sdp 8:240 active ready runningdata5 (36005076305ffd648000000000000101f) dm-2 IBM,2107900size=536G features=0 hwhandler=0 wp=rw-+- policy=round-robin 0 prio=1 status=active |- 6:0:0:2 sdd 8:48 active ready running - 7:0:0:2 sdm 8:192 active ready runn
22、ingdata4 (36005076305ffd6480000000000001029) dm-6 IBM,2107900size=536G features=0 hwhandler=0 wp=rw-+- policy=round-robin 0 prio=1 status=active |- 6:0:0:4 sdf 8:80 active ready running - 7:0:0:4 sdo 8:224 active ready runningdata3 (36005076305ffd648000000000000101e) dm-0 IBM,2107900size=536G featur
23、es=0 hwhandler=0 wp=rw-+- policy=round-robin 0 prio=1 status=active |- 6:0:0:1 sdc 8:32 active ready running - 7:0:0:1 sdl 8:176 active ready runningdata2 (36005076305ffd6480000000000001028) dm-3 IBM,2107900size=536G features=0 hwhandler=0 wp=rw-+- policy=round-robin 0 prio=1 status=active |- 6:0:0:
24、3 sde 8:64 active ready running - 7:0:0:3 sdn 8:208 active ready runningdata1 (36005076305ffd648000000000000101d) dm-4 IBM,2107900size=536G features=0 hwhandler=0 wp=rw-+- policy=round-robin 0 prio=1 status=active |- 6:0:0:0 sdb 8:16 active ready running - 7:0:0:0 sdk 8:160 active ready running5.检查m
25、ultipath聚合后的设备名,以及设备对应的链路情况。 rootrac2 # multipath -ll mpath2 (360a9800065344e6f465a6d5773747545) dm-3 NETAPP,LUN size=2.0G features=1 queue_if_no_path hwhandler=0 wp=rw -+- policy=round-robin 0 prio=1 status=active |- 1:0:0:5 sdf 8:80 active ready running - 2:0:0:5 sdp 8:240 active ready running mpa
26、th1 (360a9800065344e6f465a6d5773746878) dm-1 NETAPP,LUN size=2.0G features=1 queue_if_no_path hwhandler=0 wp=rw -+- policy=round-robin 0 prio=1 status=active |- 1:0:0:3 sdd 8:48 active ready running - 2:0:0:3 sdn 8:208 active ready running mpath0 (360a9800065344e6f465a6d5773745558) dm-0 NETAPP,LUN s
27、ize=2.0G features=1 queue_if_no_path hwhandler=0 wp=rw -+- policy=round-robin 0 prio=1 status=active |- 1:0:0:1 sdb 8:16 active ready running - 2:0:0:1 sdl 8:176 active ready running mpath9 (360a9800065344e6e536f6d586d33666e) dm-9 NETAPP,LUN size=3.9T features=1 queue_if_no_path hwhandler=0 wp=rw -+
28、- policy=round-robin 0 prio=1 status=active |- 1:0:0:10 sdk 8:160 active ready running - 2:0:0:10 sdu 65:64 active ready running mpath8 (360a9800065344e6e536f6d586d32766b) dm-7 NETAPP,LUN size=150G features=1 queue_if_no_path hwhandler=0 wp=rw -+- policy=round-robin 0 prio=1 status=active |- 1:0:0:8
29、 sdi 8:128 active ready running - 2:0:0:8 sds 65:32 active ready running mpath7 (360a9800065344e6e536f6d586d313851) dm-6 NETAPP,LUN size=2.0G features=1 queue_if_no_path hwhandler=0 wp=rw -+- policy=round-robin 0 prio=1 status=active |- 1:0:0:6 sdg 8:96 active ready running - 2:0:0:6 sdq 65:0 active
30、 ready running mpath6 (360a9800065344e6e536f6d586d307464) dm-4 NETAPP,LUN size=2.0G features=1 queue_if_no_path hwhandler=0 wp=rw -+- policy=round-robin 0 prio=1 status=active |- 1:0:0:4 sde 8:64 active ready running - 2:0:0:4 sdo 8:224 active ready running mpath5 (360a9800065344e6e536f6d586d306630) dm-2 NETAPP,LUN size=2.0G features=1 queue_if_no_path
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1