Home » Linux-Unix Admin » Linux Howto's » How to Setup DM-Multipath on RHEL & CentOS


Overview:

DM-Multipath stands for Device mapper multipathing. It allows us to configure multiple I/O paths between server  and storage arrays into asingle 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 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-<version>/multipath.conf /etc

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

devnode_blacklist {
devnode "*"
}

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

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 :

# multipath –ll

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


2 thoughts on “How to Setup DM-Multipath on RHEL & CentOS

  1. anuraja says:

    sir,
    Ur explanation is very good about multipath. i have a small doubt. my external usb hard disk is also detecting under multiptah. how to black list my external usb hard disk like my local disk. please help me.

    1. NextStep4it says:

      I think you have to blacklist external usb devices by wwid, device name, devnode or by vendor in the file /etc/multipath.conf.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>