Using MPath devices
After the mapping is generated with multipath, multiple devices pointing to the same link are generated in the/dev directory:
/dev/mapper/mpathn
/dev/mpath/mpathn
/dev/dm-n
But their origins are completely different:
/DEV/MAPPER/MPATHN is a multipath virtual multi-path device, we should use this device;
/dev/mpath/mpathn is created by Udev Device Manager, which is actually pointing to the dm-n device below, which can not be used to mount for convenience only;
/dev/dm-n is the internal use of the software itself, can not be used outside the software, can not be mounted.
In simple terms, we should use the device characters under/dev/mapper/. The device can be partitioned with Fdisk or created as PV.
Test Multpath Path
Then use Iostat to observe the flow and state of each channel to determine whether the failover or load balancing mode is normal:
# dd If=/dev/zero Of=/dev/mapper/mpath0
# iostat-k 2
Fault Tolerant Mode:
When the MPATH18 device reads and writes, SDAF, SDV will be in an active state with data streams, but SDB, SDL's link is enabled, as a ready case. This is the case for failover (primary standby)
Modify Multipath Mode
By default, Multipath already supports most common storage models (visible multipath.conf.defaults), but different versions of multipath may be different. At this point, it is recommended that you refer to the official documentation for storage:
In the previous configuration, we have configured a multipath default path_grouping_policy for Multibus in/etc/mulitpah.conf. Sometimes, however, if more than one store is connected to the same machine, the default rule may not be fully applicable. At this point, we can tailor the policies for the specific storage to the multiple path compliance.
devices {
Device {
Vendor "HITACHI"//Manufacturer name
Product "OPEN-V"//model
Path_grouping_policy Group_by_prio//default path Group Policy
Path_grouping_policy failover
#getuid_callout "/sbin/scsi_id-p 0x80-g-u-s/block/%n"//Get the default program used for unique device numbers
Path_checker READSECTOR0//Decision Path State method
Path_checker Tur
Path_selector "Round-robin 0"//Select the path for the next IO operation method
Prio_callout "/sbin/mpath_prio_alua/dev/%n"//Get the default program for finite-value use
Failback immediate//Failure Recovery mode
#hardware_handler "0"//confirm the module used to perform specific operations when the path switches and IO errors.
#no_path_retry Queue//number of times the system tried to use a failed path before Disablequeue
#rr_min_io 100///number of IO requests before switching to another path in the current user group
}
}
※ Never write wrong path_checker (possible values are: Readsector0, Tur, Emc_clariion, HP_SW, Directio). Not clear, can be viewed from the stored official information
This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/