One, what is multipath
The normal computer host is a hard disk attached to a bus, here is a one-to-one relationship. In the case of a SAN environment with optical fiber, or an ipsan environment made up of iSCSI, the host and storage are connected by a fibre switch or multiple network cards and IP, which makes the relationship much more numerous. In other words, host-to-storage can have multiple paths to choose from. The IO between host-to-storage is selectable by multiple paths. Each host to the corresponding storage can go through a few different paths, if it is used at the same time, how I/O traffic allocation? One of the paths broke down, how to deal with it? Also in the operating system perspective, each path, the operating system will be considered to be an actual physical disk, but in fact only to the same physical disk of the different paths, which is in use, the user is confused. Multi-path software is to solve the above problems arose.
The main function of multipath is to work with storage devices to achieve the following functions:
1. Failover and recovery of faults
Load Balancing of 2.IO traffic
3. Virtualization of Disks
Because Multipath software is needed and stored together with the use of different vendors based on different operating systems, the different versions are available. And some vendors, software and hardware are not sold together, if you want to use multi-path software, you may also need to buy license to the manufacturer. For example, EMC's multi-path software under Linux requires a separate purchase of license. Fortunately The 2.6 kernel of Redhat and SuSE comes with free multipathing packages and is free to use, as well as a more generic package that supports most storage vendors ' devices, even if some are not famous, and can be supported and run nicely by making minor modifications to the configuration files.
Second, configure multi-path
1. Configure the Yum source
2. Installing the Multipath Software
Yum Install Device-mapper Device-mapper-multipath
3. Settings
3.1 Multipath Settings
Then through the command: MULTIPATH–LL view multipath status See if the module is loaded successfully
[[email protected] ~]# multipath–ll view multipath status
Mar 10 19:18:28 | /etc/multipath.conf does not exist, blacklisting all devices.
Mar 10 19:18:28 | A Sample multipath.conf file is located at
Mar 10 19:18:28 | /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf
Mar 10 19:18:28 | Can run/sbin/mpathconf to create or modify/etc/multipath.conf
Mar 10 19:18:28 | DM multipath Kernel driver not loaded----DM module not loaded
If the module does not load successfully use the following to initialize the DM, or restart the system
---Use the following commands to initialize and start DM for the first time:
Modprobe Dm-multipath
Modprobe Dm-round-robin
Service MULTIPATHD Start
Multipath–v2
After initialization, check whether the load succeeds with the MULTIPATH-LL command
[Email protected] ~]# Multipath-ll
Mar 10 19:21:14 | /etc/multipath.conf does not exist, blacklisting all devices.
Mar 10 19:21:14 | A Sample multipath.conf file is located at
Mar 10 19:21:14 | /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf
Mar 10 19:21:14 | Can run/sbin/mpathconf to create or modify/etc/multipath.conf
DM multipath Kernel driver not loaded----This hint does not indicate that the DM module has been loaded successfully.
As you can see from the tips above, the DM module is loaded successfully, but there is no multipath.conf configuration file under/etc/, and the next step is to configure the multipath.conf file.
3.2. Configure Multipath:
To create a multipath configuration file path through the VI command is/ETC/MULTIPATH.CONF, the simplest configuration to add multipath to the configuration file is as follows:
Vi/etc/multipath.conf
Blacklist { Devnode "^SDA" } Defaults { User_friendly_names Yes Path_grouping_policy Multibus failback Immediate No_path_retry fail } multipaths { multipath { Wwid 360080e50002c4bbc00000c8159836588 Alias Mpath1 } multipath { Wwid 360080e50002c4bbc00000c7f59836554 Alias Mpath2 } multipath { Wwid 360080e50002c4bbc00000c55597945ee Alias Mpath3 } multipath { Wwid 360080E50002C4DF200000C4359794EBC Alias Mpath4 } multipath { Wwid 360080E50002C4DF200000C4759794FF2 Alias Mpath5 } } |
Service MULTIPATHD Restart
Linux Multipath Multipath