|
This hands-on example shows how to setup multipathing.
A setup for SCSI disks looks like:
#load the zfcp module using the FCP cards
modprobe zfcp
#setting the FCP adapter online
echo 1 >> /sys/bus/ccw/devices/0.0.<fcp-port-address>/online
#adding a Storage Server (WWPN) to the FCP adapter
echo <wwpn-address> > /sys/bus/ccw/devices/0.0.<fcp-device>/port_add
#adding a disk, which is reached over fcp-port and
via wwpn-address
echo <disk> > /sys/bus/ccw/devices/0.0.<fcp-device>/<wwpn-address>/unit_add
Multipathing requires each disk to be attached over a different
path:
#setting the FCP card online
echo 1 >> /sys/bus/ccw/devices/0.0.1700/online
echo 1 >> /sys/bus/ccw/devices/0.0.1800/online
#adding a Storage Server (WWPN) to the FCP card
echo 0x500507630308c481 > /sys/bus/ccw/devices/0.0.1700/port_add
echo 0x500507630308c482 > /sys/bus/ccw/devices/0.0.1800/port_add
#adding a disk, which is reached over fcp-port and
via wwpn-address
echo 0x4014400300000000 > /sys/bus/ccw/devices/0.0.1700/0x500507630308c481/unit_add
echo 0x4014400300000000 > /sys/bus/ccw/devices/0.0.1800/0x500507630308c482/unit_add
Enabling multipathing:
#load the multipath module
modprobe dm-multipath
#issue the multipath command to look what was recognized
multipath -l
#for proper multipath work start the multipathd service
/etc/init.d/multipathd start
Multipathd can be started automatically after
every restart enabling the /etc/init.d/multipathd
script at startup.
Multipath output:
...
36005076303ffc4820000000000001403
[size=10 GB][features="0"][hwhandler="0"]
\_ round-robin 0 [active][best]
\_ 6:0:1:0 sdg 8:96 [active]
\_ round-robin 0 [enabled]
\_ 6:0:2:1 sdw 65:96 [active]
...
To see all disks, issue
multipath -F and multipath -l
for flushing and recreating the multipath configuration
To change the profile how to write to your SCSI disks, issue
multipath -p <profile multibus|failover|...>
Explanation of the above example:
Disk 36005076303ffc4820000000000001403 is
accessible over the sd-devices /dev/sdg or
/dev/sdw. It looks like two separate disks,
but each sd-device represents one path to this disk.
The multipath tools recognize the different paths to each
disk and create a device (in this example /dev/mapper/36005076303ffc4820000000000001403),
which takes over the access to this disk. The multipath
tools handle the utilization of the paths.
The output shows a "failover" mode usage. The
first path (sdg) is for primary I/O and the
second path (sdw) is only used in case the
first path fails.
Another commonly used mode is "multibus". For more
details read the man-page of the multipath tools.
|