Linux 主机设置

要确保在故障转移时恢复路径,建议使用某些设备映射器多路径 (DMMP) 设置以及将 Linux 主机连接至系统的 udev 规则。这些设置对 IBM System x、所有基于 Intel 或 AMD 的服务器及 Power 平台有效。

完成以下两个步骤后,您必须重新启动主机:

对于每个 Linux 分发版以及分发版中的发行版,针对 Red Hat 请参阅 [/usr/share/doc/device-mapper-multipath.*] 下的缺省设置,针对 Novell SuSE 则参阅 [/usr/share/doc/packages/multipath-tools] 下的缺省设置。确保添加到 multipath.conf 的条目与所需的 Linux 分发版的格式和语法相匹配。 仅使用相关分发版和发行版中的 multipath.conf。请不要在不同分发版或发行版之间复制 multipath.conf 文件。

对于某些操作系统级别,polling_interval 必需在 defaults 下,而不是在设备设置下。如果设备部分存在 polling_interval,请使用 # 键注释掉 polling_interval

例如:
Under Device Section
# 		polling_interval 30,

Under Defaults Section
defaults {
		user_friendly_names    yes
		polling_interval       30
}

适用于特定 Linux 分发版和发行版的多路径设置

使用以下参数编辑 /etc/multipath.conf,并通过输入以下内容来确认更改:
multipathd -k
multipathd> show config
Red Hat Linux V5.x、V6.0 和 V6.1
     vendor          "IBM"
     product                 "2145"
     path_grouping_policy "group_by_prio"
     path_selector "round-robin 0"
     prio_callout "/sbin/mpath_prio_alua /dev/%n" #Used by Red Hat 5.x
     prio "alua"
     path_checker "tur"
     failback "immediate"
     no_path_retry 5
     rr_weight uniform
     rr_min_io 1000
     dev_loss_tmo 120
Red Hat Linux V6.2 及更高版本
     vendor          "IBM"
     product                 "2145"
     path_grouping_policy "group_by_prio"
     path_selector "round-robin 0" # Used by Red Hat 6.2
     prio "alua"
     path_checker "tur"
     failback "immediate"
     no_path_retry 5
     rr_weight uniform
     rr_min_io_rq "1"
     dev_loss_tmo 120
Red Hat Linux V7.x
     vendor          "IBM"
     product                 "2145"
     path_grouping_policy "group_by_prio"
     path_selector "service-time 0" # Used by Red Hat 7.x
     prio "alua"
     path_checker "tur"
     failback "immediate"
     no_path_retry 5
     rr_weight uniform
     rr_min_io_rq "1"
     dev_loss_tmo 120
SUSE Linux V10.x 和 11.0 和 11 SP1
     vendor          "IBM"
     product                 "2145"
     path_grouping_policy "group_by_prio"
     path_selector "round-robin 0"
     prio "alua"
     path_checker "tur"
     failback "immediate"
     no_path_retry 5
     rr_weight uniform
     rr_min_io 1000
     dev_loss_tmo 120
SUSE Linux V11 SP2
     vendor          "IBM"
     product                 "2145"
     path_grouping_policy "group_by_prio"
     path_selector "round-robin 0" # Used by SLES 11 SP2
     prio "alua"
     path_checker "tur"
     failback "immediate"
     no_path_retry 5
     rr_weight uniform
     rr_min_io_rq "1"
     dev_loss_tmo 120
SUSE Linux V11 SP3+
     vendor          "IBM"
     product                 "2145"
     path_grouping_policy "group_by_prio"
     path_selector "service-time 0" # Used by SLES 11 SP3+
     prio "alua"
     path_checker "tur"
     failback "immediate"
     no_path_retry 5
     rr_weight uniform
     rr_min_io_rq "1"
     dev_loss_tmo 120
SUSE Linux V12+
     vendor          "IBM"
     product                 "2145"
     path_grouping_policy "group_by_prio"
     path_selector "service-time 0" 
     prio "alua"
     path_checker "tur"
     failback "immediate"
     retain_attached_hw_handler "yes"
     no_path_retry "queue"
     fast_io_fail_tmo 5
     rr_min_io 1000
     rr_min_io_rq 1
     rr_weight "uniform"	
Ubuntu
     vendor          "IBM"
     product                 "2145"
     path_grouping_policy "group_by_prio"
     path_selector "service-time 0" 
     prio "alua"
     path_checker "tur"
     failback "immediate"
     no_path_retry "queue"
     retain_attached_hw_handler "yes"
     fast_io_fail_tmo 5
     rr_min_io 1000
     rr_min_io_rq 1
     rr_weight "uniform"	

Udev 规则 SCSI 命令超时更改

设置 SCSI 命令超时的 udev 规则。

将 SCSI 命令超时设置为 120 秒。这是针对所有 Linux 版本的建议设置。

Udev 规则文件创建

要增加系统的 SCSI 命令超时,请创建以下 udev 规则:
udev rules file
cat /etc/udev/rules.d/99-ibm-2145.rules

# Set SCSI command timeout to 120s (default == 30 or 60) for IBM 2145 devices
SUBSYSTEM=="block", ACTION=="add", ENV{ID_VENDOR}=="IBM",ENV{ID_MODEL}=="2145", RUN+="/bin/sh -c 'echo 120 >/sys/block/%k/device/timeout'"

在设置卷之后,确认为其设置了 120 秒。通过从命令行运行 multipath -ll | grep sd 来查找块设备路径。然后,运行 cat /sys/block/sdX/device/timeout(其中 X 是每个 2145 块设备路径)。