Multipath configuration meaning analysis

By default, multipath already supports most common storage models (see multipath.conf.defaults), but different multipath versions may be slightly different. At this time, it is recommended to refer to the official documentation of the storage, but sometimes, if more than one storage is connected to the same machine, the default rules may not be fully applicable. At this time, we can customize the strategy of multi-path compliance for specific storage.

  The template of the configuration file is located in /usr/share/doc/device-mapper-multipath-xxx/multipath.conf (x is the actual version number of multipath) by default. When configuring the multipath configuration file, you can copy the file to / etc / multipath .conf, then, in the custom configuration.

Configure Linux (suse and redhat; redhat7 or above is not applicable, see next article for details)

vi /etc/multipath.conf

defaults {
        user_friendly_names yes
        polling_interval  30
}
devices {  
        device {
                vendor "NETAPP"
                product "LUN.*"
                path_grouping_policy "group_by_prio"
                path_checker "tur"
                features "3 queue_if_no_path pg_init_retries 50"
                hardware_handler "1 alua"
                prio "alua"
                failback "immediate"
                rr_weight "uniform"
                rr_min_io 128
                dev_loss_tmo "infinity"
                retain_attached_hw_handler "yes"
                detect_prio "yes"
                path_selector  "round-robin 0"
                no_path_retry  18                
        }
} 

blacklist {
    device {
        vendor ".*"
    }
}
blacklist_exceptions {
    device {
        vendor "^NETAPP"
    }
}
 First, the configuration file field

  1) defaults: The default settings of global properties.

  2) multipaths: Multipath related configuration

  3) devices: storage device related configuration.

  4) blacklist: blacklist, multipath will ignore the devices in the blacklist.

  5) blacklist_exceptions: Exempt from the blacklist, add to the blacklist, but the devices included here will not be ignored, it is a list of devices for multi-path management.

Second, the configuration file field details

 1. Available attributes of defaults

  1) polling_interval: The time interval of the path check, in seconds (s).

  2) max_polling_interval: The maximum time interval for path checking, the default is 4 times of polling_interval, in seconds (s).

  3) multipath_dir: The path of the multipath shared library, which is related to the system. The default is / lib / multipath or / lib64 / multipath.

  4) find_multipaths: The default value is no, which will create multipath devices for all devices outside the blacklist. If set to yes, multi-path devices will be created for 3 scenarios:

  The wwids of the two paths that are not in the blacklist are the same; the user manually creates them manually; the wwid of one path is the same as the multipath device that has been created before.

  5) Verbosity: information output level, the lowest is 0, the highest is 6, and the default is 2.

  6) path_selector: path selection algorithm, where "round-robin 0" means to continuously cycle among multiple paths; "queue-length 0" means to select the path with the least number of IOs currently processed;

  "Service-time 0" indicates that the path with the shortest IO service time is selected.

  7) path_grouping_policy: path grouping strategy, where "failover" indicates a path and a group (default); "multibus" indicates that all paths are in a group;

  "Group_by_serial" means grouping by serial number; "group_by_prio" means grouping by priority; "group_by_node_name" means grouping by name.

  8) uid_attribute: Which attribute of udev uniquely identifies a device, the default value is ID_SERIAL.

  9) prio: Path priority acquisition method, where "const" returns 1 (default value); "emc" generates priority for emc disk array; "alua" generates priority based on SCSI-3 ALUA configuration;

  "Ontap" generates priority for NetAPP disk array; "rdac" generates priority for LSI / Engenio / NetApp E-Series RDAC controller; "hp_sw" according to Compaq / HP controller

  Active / standby mode generates priority;

  "Hds" generates priority for Hitachi HDS modular array; "random" randomly generates priority, its value is between 1 and 10; "weightedpath" is based on regular expression and prio_args

  Parameter value generation priority.

  10) prio_args: calculate the parameters of the priority function.

  11) Features: Specify the features of Device Mapper, where “queue_if_no_path” indicates that when there is no available path, the request is added to the queue; “no_partitions” indicates that it is forbidden

  Use kpartx to generate partitions.

  12) path_checker: path check method, where “readsector0” means to determine the path status by reading the first sector of the device, which is obsolete and replaced by directio; “tur” means

  Run the "TEST UNIT READY" command to determine the path status; "emc_clariion" means execute "EMC Clariion specific EVPD page 0xC0" to determine the path status

  "Hp_sw" means check the HP Active / Standby disk array;

  "Rdac" means checking the status of the "LSI / Engenio / NetApp E-Series RDAC" storage controller; "direction" means reading the first sector of the device with DirectIO.

  13) failback: The method of restoring the path, where “Immediate” means to restore immediately to the high priority path group containing the active path; “manual” means to manually restore (default value);

  "Followover" means that only the first path of the path group will be restored; "values> 0" means delayed recovery.

  14) rr_min_io: the number of IOs before switching to the next path in the current path group, only used for the core version number of 2.6.31, the default value is 1000.

  15) rr_min_io_rq: IO count before switching to the next path in the current path group, only used for the core version number of 2.6.31 and later, the default value is 1.

  16) no_path_retry: the number of times the system retries before disabling the queue, "fail" means directly return an error, "queue" means all join the queue, the default is 0

  17) user_friendly_names: if yes, use the settings in / etc / multipath / bindings; if no, use wwid naming (can be overridden by the settings in multipaths),

  The default value is no.

  18) max_fds: The maximum number of file descriptors that multipathd and multipath can open.

  19) checker_timeout: timeout time for path check, in seconds (s), the default value is / sys / block / sd <x> / device / timeout value.

  20) fast_io_fail_tmo: SCSI IO error timeout, should be smaller than dev_loss_tmo, if off, disable timeout.

  21) dev_loss_tmo: SCSI device removal timeout, the default under Linux is 300, unit seconds (s).

  22) queue_without_daemon: if set to no, if multipathd is not started, all devices' IO are prohibited from joining the queue.

  23) bindings_file: When user_friendly_names is set, the path of the name binding file, the default value is / etc / multipath / bindings.

  24) wwids_file: wwids tracking file path, the default is / etc / multipath / wwids.

  25) log_checker_err: Logging method when the path check error occurs, the default is always.

  26) reservation_key: The key specified for the mpathpersist command.

  27) retain_attached_hw_handler: Whether to continue to use hardware_handler, the default is no.

  28) detect_prio: If set to yes, first try to use alua detection, the default is no.

  29) hw_str_match: If set to yes, the string matching name, manufacturer and other information will be used first, the default is no.

  30) force_sync: If set to yes, it will force the use of synchronization mode to check the path, the default is no.

  31) deferred_remove: If set to yes, the device with no path is deferred, the default is no.

  32) config_dir: Specify the directory of the configuration file. If it is not "", search the * .conf file in the directory in alphabetical order, and read it like using /etc/multipath.conf,

  The default is /etc/multipath/conf.d.

  33) delay_watch_checks: if it is greater than 0, it is considered valid only when the continuous delay_watch_checks check path is valid, and the default is no.

  34) delay_wait_checks: If it is greater than 0, after delay_watch_check check is valid, it will be officially re-enabled after delaying delay_wait_checks checks.

  35) missing_uev_msg_delay: When a new device is created, it starts to receive udev information after a delay of missing_uev_msg_delay seconds. The default value is 30.

2. Multipaths configuration, multipaths individually configure a single path, each path uses a multipath subsection separately, which can contain the following attributes:

  1) wwid: Path WWID (required), available with command / lib / udev / scsi_id -g -u / dev / sdX.

  2) alias: device alias.

  3)path_grouping_policy

  4)path_selector

  5) prion

  6)prio_args

  7)failback

  8)rr_weight

  9)flush_on_last_del

  10)no_path_retry

  11) rr_min_io

  12) rr_min_io_q

  13)features

  14)reservation_key

  15)deferred_remove

  16)delay_watch_checks

  17)delay_wait_checks

3. Devices configuration, each device subsection in the devices section is used to describe a device, and its main attributes are as follows:

  1) vendor: manufacturer (required).

  2) product: product model.

  3) revision: version number.

  4) product_blacklist: product model blacklist.

  5) alias_prefix: device name prefix, the default is mapth.

  6) hardware_handler: hardware-related operation models, mainly:

  "emc":Hardware handler for EMC storage arrays.

  "rdac":Hardware handler for LSI/Engenio/NetApp E-Series RDAC storage controller.

  "hp_sw":Hardware handler for Compaq/HP storage arrays in active/standby mode.

  "alua":Hardware handler for SCSI-3 ALUA compatible arrays.

4. Blacklist configuration. The devices in blacklist will be ignored by multipath. There are three formats:

  1) wwid followed by the WWID of the device;

  2) A regular expression followed by devnode followed by the device name;

  3) The device description, which is a subsection, contains vendor and product. For details, please refer to the description of the devices section.

  The syntax of blacklist_exceptions is the same as that of blacklist, which means to cancel the ignorance of the devices in blacklist.

Published 59 original articles · 69 praises · 270,000+ views

Guess you like

Origin blog.csdn.net/pansaky/article/details/105405540