Redhat multipath 解析(一)

关于multipath的安装在此不做过多介绍,主要就multipath的配置参数进行说明,因不同OS版本下multipath相关参数特性不一样,本次仅介绍Redhat5版本下multipath配置。

安装multipath后需要编辑/etc/multipath.conf文件,

devices {
        device {
                vendor                  "DGC"
                product                 ".*"
                product_blacklist       "LUN_Z"
                getuid_callout          "/sbin/scsi_id -g -u -s /block/%n"
                #prio_callout           "/sbin/mpath_prio_emc /dev/%n"
                prio_callout            "/sbin/mpath_prio_alua /dev/%n"
                #hardware_handler       "1 emc"
                hardware_handler        "1 alua"
                path_grouping_policy    group_by_prio
                failback                manual
                rr_weight               uniform
                no_path_retry           fail
                rr_min_io               1000
                path_checker            emc_clariion
        }
}

vendor:设备厂商

product:产品型号

product_blacklist:黑名单

getuid_callout:获取LUN的WWID

prio_callout:选取计算Priority值的算法,在/sbin目录下,有mpath_prio_alua,mpath_prio_emc,mpath_prio_hp_sw(关于根据存储的何特性计算优先等级值后续会专题介绍)

hardware_handler:指定硬件类型,有1 emc,1 alua, 1 hp_sw,1 rdac

path_grouping_policy :指定分组策略,failover,multibus,group_by_serial,group_by_prio,group_by_node_name

path_selector :指定IO通道选择算法,round-robin 0,queue-length 0,service-time 0

failback:定义故障恢复策略,immediate,manual,followover

rr_weight:定义权重,uniform,priorities

no_path_retry:指定使用fail路径尝试次数,fail,queue

rr_min_io:指定一个IO数量,达到这个数量IO将切换到下一个路径,默认1000

path_checker:指定确认路径状态方法,readsector0,tur,emc_clariion,hp_sw,rdac,directio

以下为摘自Redhat官方释义:

vendor  Specifies the vendor name of the storage device to which the device attributes apply, for example COMPAQ. 
product  Specifies the product name of the storage device to which the device attributes apply, for example HSV110 (C)COMPAQ. 
revision  Specifies the product revision identifier of the storage device. 
product_blacklist  Specifies a regular expression used to blacklist devices by product. 
hardware_handler 
Specifies a module that will be used to perform hardware specific actions when switching path groups or handling I/O errors. Possible values include: 
1 emc: hardware handler for EMC storage arrays. 
1 alua: hardware handler for SCSI-3 ALUA arrays. 
1 hp_sw: hardware handler for Compaq/HP controllers. 
1 rdac: hardware handler for the LSI/Engenio RDAC controllers. 
 
path_grouping_policy 
Specifies the default path grouping policy to apply to unspecified multipaths. Possible values include: 
failover = 1 path per priority group 
multibus = all valid paths in 1 priority group 
group_by_serial = 1 priority group per detected serial number 
group_by_prio = 1 priority group per path priority value 
group_by_node_name = 1 priority group per target node name 
 
getuid_callout  Specifies the default program and arguments to call out to obtain a unique path identifier. An absolute path is required. 
path_selector 
Specifies the default algorithm to use in determining what path to use for the next I/O operation. Possible values include: 
round-robin 0: Loop through every path in the path group, sending the same amount of I/O to each. 
queue-length 0: Send the next bunch of I/O down the path with the least number of outstanding I/O requests. 
service-time 0: Send the next bunch of I/O down the path with the shortest estimated service time, which is determined by dividing the total size of the outstanding I/O to each path by its relative throughput. 
 
path_checker 
Specifies the default method used to determine the state of the paths. Possible values include: 
readsector0: Read the first sector of the device. 
tur: Issue a TEST UNIT READY to the device. 
emc_clariion: Query the EMC Clariion specific EVPD page 0xC0 to determine the path. 
hp_sw: Check the path state for HP storage arrays with Active/Standby firmware. 
rdac: Check the path stat for LSI/Engenio RDAC storage controller. 
directio: Read the first sector with direct I/O. 
 
features 
The default extra features of multipath devices, using the format: "number_of_features_plus_arguments feature1 ...". 
Possible values for features include: 
queue_if_no_path, which is the same as setting no_path_retry to queue. For information on issues that may arise when using this feature, see Section 5.6, “Issues with queue_if_no_path feature”. 
retain_attached_hw_handler: (Red Hat Enterprise Linux Release 6.4 and later) If this parameter is set to yes and the scsi layer has already attached a hardware handler to the path device, multipath will not force the device to use the hardware_handler specified by the multipath.conf file. If the scsi layer has not attached a hardware handler, multipath will continue to use its configured hardware handler as usual. 
pg_init_retries n: Retry path group initialization up to n times before failing where 1 <= n <= 50. 
pg_init_delay_msecs n: Wait n milliseconds between path group initialization retries where 0 <= n <= 60000. 
 
prio 
Specifies the default function to call to obtain a path priority value. For example, the ALUA bits in SPC-3 provide an exploitable prio value. Possible values include: 
const: Set a priority of 1 to all paths. 
emc: Generate the path priority for EMC arrays. 
alua: Generate the path priority based on the SCSI-3 ALUA settings. As of Red Hat Enterprise Linux 6.8, if you specify prio "alua exclusive_pref_bit" in your device configuration, multipath will create a path group that contains only the path with the pref bit set and will give that path group the highest priority. 
tpg_pref: Generate the path priority based on the SCSI-3 ALUA settings, using the preferred port bit. 
ontap: Generate the path priority for NetApp arrays. 
rdac: Generate the path priority for LSI/Engenio RDAC controller. 
hp_sw: Generate the path priority for Compaq/HP controller in active/standby mode. 
hds: Generate the path priority for Hitachi HDS Modular storage arrays. 
 
failback 
Manages path group failback. 
A value of immediate specifies immediate failback to the highest priority path group that contains active paths. 
A value of manual specifies that there should not be immediate failback but that failback can happen only with operator intervention. 
A value of followover specifies that automatic failback should be performed when the first path of a path group becomes active. This keeps a node from automatically failing back when another node requested the failover. 
A numeric value greater than zero specifies deferred failback, expressed in seconds. 
 
rr_weight  If set to priorities, then instead of sending rr_min_io requests to a path before calling path_selector to choose the next path, the number of requests to send is determined by rr_min_io times the path's priority, as determined by the prio function. If set to uniform, all path weights are equal. 
no_path_retry 
A numeric value for this attribute specifies the number of times the system should attempt to use a failed path before disabling queuing. 
A value of fail indicates immediate failure, without queuing. 
A value of queue indicates that queuing should not stop until the path is fixed. 
 
rr_min_io  Specifies the number of I/O requests to route to a path before switching to the next path in the current path group. This setting is only for systems running kernels older that 2.6.31. Newer systems should use rr_min_io_rq. The default value is 1000. 
rr_min_io_rq  Specifies the number of I/O requests to route to a path before switching to the next path in the current path group, using request-based device-mapper-multipath. This setting should be used on systems running current kernels. On systems running kernels older than 2.6.31, use rr_min_io. The default value is 1. 
fast_io_fail_tmo  The number of seconds the SCSI layer will wait after a problem has been detected on an FC remote port before failing I/O to devices on that remote port. This value should be smaller than the value of dev_loss_tmo. Setting this to off will disable the timeout. 
dev_loss_tmo  The number of seconds the SCSI layer will wait after a problem has been detected on an FC remote port before removing it from the system. Setting this to infinity will set this to 2147483647 seconds,or 68 years. 
flush_on_last_del  If set to yes, the multipathd daemon will disable queuing when the last path to a device has been deleted. 
user_friendly_names  If set to yes, specifies that the system should use the /etc/multipath/bindings file to assign a persistent and unique alias to the multipath, in the form of mpathn. If set to no, specifies that the system should use use the WWID as the alias for the multipath. In either case, what is specified here will be overridden by any device-specific aliases you specify in the multipaths section of the configuration file. The default value is no. 
retain_attached_hw_handler  (Red Hat Enterprise Linux Release 6.4 and later) If this parameter is set to yes and the scsi layer has already attached a hardware handler to the path device, multipath will not force the device to use the hardware_handler specified by the multipath.conf file. If the scsi layer has not attached a hardware handler, multipath will continue to use its configured hardware handler as usual. 
detect_prio  (Red Hat Enterprise Linux Release 6.4 and later) If this is set to yes, multipath will first check if the device supports ALUA, and if so it will automatically assign the device the alua prioritizer. If the device does not support ALUA, it will determine the prioritizer as it always does. 
delay_watch_checks  (Red Hat Enterprise Linux Release 6.7 and later) If set to a value greater than 0, the multipathd daemon will watch paths that have recently become valid for the specified number of checks. If they fail again while they are being watched, when they next become valid they will not be used until they have stayed up for the number of consecutive checks specified with delay_wait_checks. This allows you to keep paths that may be unreliable from immediately being put back into use as soon as they come back online. 
delay_wait_checks  (Red Hat Enterprise Linux Release 6.7 and later) If set to a value greater than 0, when a device that has recently come back online fails again within the number of checks specified with delay_watch_checks, the next time it comes back online it will be marked and delayed and it will not be used until it has passed the number of checks specified in delay_wait_checks. 
skip_kpartx (Red Hat Enterprise Linux Release 6.9 and later) If set to yes, kpartx will not automatically create partitions on the device. This allows users to create a multipath device without creating partitions, even if the device has a partition table. 
max_sectors_kb (Red Hat Enterprise Linux Release 6.9 and later) Sets the max_sectors_kb device queue parameter to the specified value on all underlying paths of a multipath device before the multipath device is first activated. When a multipath device is created, the device inherits the max_sectors_kb value from the path devices. Manually raising this value for the multipath device or lowering this value for the path devices can cause multipath to create I/O operations larger than the path devices allow. Using the max_sectors_kb parameter is an easy way to set these values before a multipath device is created on top of the path devices and prevent invalid-sized I/O operations from being passed If this parameter is not set by the user, the path devices have it set by their device driver, and the multipath device inherits it from the path devices. 
all_devs When this parameter is set to yes, all of the options set in this device configuration will override the values for those options in all of the other device configurations, both the ones in the configuration file and the built-in defaults. 
 

猜你喜欢

转载自blog.csdn.net/haiziccc/article/details/89930344