DM-Multipath stands for Device mapper multipathing. It allows us to configure multiple I/O paths between server and storage arrays into a single device. These I/O paths are physical SAN connections that can include separate cables, switches, and controllers.

Multipathing aggregates the I/O paths, creating a new device that consists of the aggregated paths and remove the Single Point of Failure Problem.

Why to use multipathing

Below are the two reasons why we are using DM-Multipath on Linux Servers:

  • Redundancy: In Case of active/passive multipathing we will be using two paths. One path will be used for I/O operations and the other will be in stand by. If any element of an I/O path (like cable, switch, or controller) fails, DM-Multipath switches to an alternate path or stand by path.
  • High Performance: In case of active/active multipathing , I/O operations are shared over available paths in round-robin fashion and provide improved performance.

Installation of DM-Multipath on RHEL/CentOS

“device-mapper-multipath” is the multipath rpm package.

# rpm -q device-mapper-multipath

if it is not installed then use the below yum command:

# yum install device-mapper-multipath

Setting up multipathing

‘/etc/multipath.conf’ is the default configuration file for multipathing, if this file doesn’t exists, copy the sample file:

# cp /usr/share/doc/device-mapper-multipath-/multipath.conf /etc

Now Edit the file /etc/multipath.conf and make sure following line exists and commented out:

devnode_blacklist {
devnode "*"
}

The above Section of multipath.conf file blacklists all the devices by default. We must comment it out to enable multipathing.

Starting the multipath service

Multipath is controlled by the multipathd service:

# service multipathd start ; chkconfig multipathd on

‘multipath -v2′ command scans, identifies, and configures multipath maps for devices that could have multiple paths to storage, as configured in /etc/multipath.conf.

To display the multipath

To display the current multipath status:

Note: In Case if Sample file doesn’t exist on above path, then we can use mpathconf utility which will create /etc/multipath.conf file from scratch.

To Enable Basic multipathing failover:

# mpathconf --enable --with_multipathd y

Now enable multipath, allow it to use user_friendly_names, as well as to find_multipaths.

# mpathconf --enable --user_friendly_names y --find_multipaths y

Restart the Service:

# service multipathd restart