Jump to Navigation

263 - Multipath

To be able to support failover connections to a device one needs multiple paths to that device.
If we have a iSCSI disk connected to an ethernet network and we want to make sure that we can reach the disk from a host
even when we disconnect one ethernet cable we need two network cables running from the host to the disk and we need a piece of software
that makes sure when one link failes the other one is used.  This last piece of software is called multipath on GNU/Linux systems.

1. Setup Multipath package

The following package is required to establish multipath.

# rpm -ivh device-mapper-multipath-0.4.5-31.el4.x86_64.rpm

 

# vi /etc/multipath.conf

Uncomment the defaults & insert some lines :

==========================================================

defaults {
        udev_dir                /dev
        polling_interval        10
        selector                "round-robin 0"
        path_grouping_policy    multibus
        getuid_callout          "/sbin/scsi_id -g -u -s /block/%n"
        prio_callout            none
        path_checker            readsector0
        rr_min_io               100
        max_fds                 8192
        rr_weight               priorities
        failback                immediate
        no_path_retry           fail
        user_friendly_names     yes
}

blacklist {
        devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
        devnode "^(hd|xvd)[a-z]*"
}
blacklist_exceptions {
        wwid "36000d310005109000000000000000007"
        wwid "36000d310005109000000000000000008"
}
multipaths {
        multipath {
                wwid                    "36000d310005109000000000000000007"
                alias                   "oradata1"
        }
        multipath {
                wwid                    "36000d310005109000000000000000008"
                alias                   "oradata2"
        }
}

devices {
        device {
                vendor                  "COMPELNT"
                product                 "Compellent Vol"
                path_checker            tur
                no_path_retry           queue
        }

==========================================================

 

2. Start the service

Once the disk is unused, unpresent the disk from the SAN, rescan to remove no-longer existing disks,
then restart multipathd (/etc/init.d/multipathd restart).

# service multipathd start

or

# /etc/init.d/multipathd restart

3. Check scsi

* Search scsi

# echo "- - -" >> /sys/class/scsi_host/host0/scan
# echo "- - -" >> /sys/class/scsi_host/host1/scan
# echo "- - -" >> /sys/class/scsi_host/host2/scan

* View the scsi configuration

# cat /proc/scsi/scsi

# lsscsi

* Get wwid

# scsi_id -g -u -s /block/sdc

36000d310005109000000000000000003

3. Querying the multipath IO status & maps outputs

# multipath -d -l.

-d dry run, do not create or update devmaps
-l show multipath topology (sysfs and DM info)

# multipath -ll        (show multipath topology (maximum info))

* To test that the configuration is correct, a dry run of the multipath command shows what
  configuration changes would be made if the command was run.

# multipath -v2 -d

create: mpath0 (36d4ae5209d0b550017f42c5e1a85032f)  DELL,PERC H710P
[size=1.8T][features=0][hwhandler=0][n/a]
\_ round-robin 0 [prio=1][undef]
 \_ 0:2:0:0 sda 8:0   [undef][ready]

-v level        verbosity level

# multipath -F                (flush all multipath device maps)

4. Format & Mount

* Multipathing is managed at the device level. Multipath device can be accessed by /dev/mapper/
* The target device must support multipathing.
* Multiple physical connections exist between host bus adapters in the server and the target.
  The should be checked: typical connection problems involve faulty adapters, cables, or controllers.

# mkfs.ext4 /dev/mapper/oradata1

# mount -t ext4 /dev/mapper/oradata1 /d01

 

 

 



Main menu 2

Story | by Dr. Radut