RHEL5 multi-path Configuration

Source: Internet
Author: User

RHEL5 multi-path Configuration

1. Check whether the software package is installed.
[Root @ pcvmaster ~] # Rpm-qa | grep device-mapper
Device-mapper-libs-1.02.74-10.el6.x86_64
Device-mapper-event-libs-1.02.74-10.el6.x86_64
Device-mapper-multipath-0.4.9-56.el6.x86_64
Device-mapper-1.02.74-10.el6.x86_64
Device-mapper-event-1.02.74-10.el6.x86_64
Device-mapper-multipath-libs-0.4.9-56.el6.x86_64
2 install multipath
[Root @ pcvmaster ~] # Yum-yinstall multipath
3 boot
[Root @ pcvmaster ~] # Chkconfigmultipathd on
4. Edit the multipath configuration file
Vi/etc/multipath. conf
# This is a basicconfiguration file with some examples, for device mapper
# Multipath.
# For a complete list of thedefault configuration values, see
#/Usr/share/doc/device-mapper-multipath-0.4.9/multipath. conf. defaults
# For a list of configurationoptions with descriptions, see
#/Usr/share/doc/device-mapper-multipath-0.4.9/multipath. conf. annotated
#
# REMEMBER: After updatingmultipath. conf, you must run
#
# Service multipathd reload
#
# For the changes to takeeffect in multipathd
 
# By default, devices withvendor = "IBM" and product = "S/390. *" are
# Blacklisted. To enablemulitpathing on these devies, uncomment
# Following lines.
# Blacklist_exceptions {
# Device {
# Vendor "IBM"
# Product "S/390 .*"
#}
#}
 
# Use user friendly names, instead of using WWIDs as names.
Defaults {
User_friendly_names yes
}
##
# Here is an example of howto configure some standard options.
##
#
# Defaults {
# Udev_dir/dev
# Polling_interval 10
# Selector round-robin0"
# Path_grouping_policy multibus
# Getuid_callout "/lib/udev/scsi_id -- whitelisted -- device =/dev/% n"
# Prio alua
# Path_checker readsector0
# Rr_min_ I/o 100
# Max _ FDS 8192
# Rr_weight priorities
# Failback immediate
# No_path_retry fail
# User_friendly_names yes
#}
##
# The wwid line in thefollowing blacklist section is shown as an example
# Of how to blacklistdevices by wwid. The 2 devnode lines arethe
# Compiled in defaultblacklist. If you want to blacklist entire types
# Of devices, such as allscsi devices, you should use a devnode line.
# However, if you want toblacklist specific devices, you shocould use
# A wwid line. Since there is no guarantee that a specificdevice will
# Not change names on reboot (from/dev/sda to/dev/sdb for example)
# Devnode lines are notrecommended for blacklisting specific devices.
##
# Blacklist {
# Wwid 26353900f02796769
# Devnode "^ (ram | raw | loop | fd | md | dm-| sr | scd | st) [0-9] *"
# Devnode "^ hd [a-z]"
#}
# Multipaths {
# Multipath {
# Wwid 3600508b4000156d700012000000b0000
# Alias yellow
# Path_grouping_policy multibus
# Path_checker readsector0
# Path_selector "round-robin0"
# Failback manual
# Rr_weight priorities
# No_path_retry 5
#}
# Multipath {
# Wwid 1DEC_____321816758474
# Alias red
#}
#}
# Devices {
# Device {
# Vendor "COMPAQ"
# Product "HSV 110 (C) COMPAQ"
# Path_grouping_policy multibus
# Getuid_callout "/lib/udev/scsi_id -- whitelisted -- device =/dev/% n"
# Path_checker readsector0
# Path_selector "round-robin0"
# Hardware_handler "0"
# Failback 15
# Rr_weight priorities
# No_path_retry queue
#}
# Device {
# Vendor "COMPAQ"
# Product "MSA1000"
# Path_grouping_policy multibus
#}
#}
 
Blacklist {
Devnode "^ (ram | raw | loop | fd | md | dm-| sr | scd | st) [0-9] *"
Devnode "^ hd [a-z]"
}
Devices {
Device {
Vendor "Netapp"
Path_grouping_policymultibus
Features "1queue_if_no_path"
Path_checkerreadsector ()
Failback immediate
}
}
5. Start the service
[Root @ pcvmaster ~] #/Etc/init. d/multipathd start
6. Delete existing unused paths
[Root @ pcvmaster ~] # Multipath-F
7. format the path, check the path, and merge the path.
[Root @ pcvmaster ~] # Multipath-v2
8. view the multi-path status
[Root @ pcvmaster ~] # Multipath-ll
9 restart the system
[Root @ pcvmaster ~] # Reboot
10. Create multiple PV disks,
[Root @ pcvmaster ~] # Pvcreate/dev/mapper/mpath {d, f, e, p, t, k, j, c, s, q}
11 add multiple disks to Volbackup
[Root @ pcvmaster ~] # VgcreateVolbackup/dev/mapper/mpath {d, f, e, p, t, k, j, c, s, q}
12 create LV
[Root @ pcvmaster ~] # Lvcreate-l 1310780-n LogVol01 Volbackup
13 format LV
[Root @ pcvmaster ~] Mkfs. ext4/dev/Volbackup/LogVol01
14 Mount
[Root @ pcvmaster ~] # Mount/dev/Volbackup/LogVol01/backup
15FAQ
15.1 after the module is not loaded successfully
If the module is not loaded successfully, use the following command to initialize the DM or restart the system.
--- Use thefollowing commands to initialize and start DM for the first time:
# Modprobedm-multipath
# Modprobe dm-round-robin
# Servicemultipathd start
# Multipath-v2
15.2 introduction to multipath principles
1. device-mapper-multipath: multipath-tools. It mainly provides tools such as multipathd and multipath, and configuration files such as multipath. conf. These tools use the ioctr interface of device mapper to create and configure a multipath device (call the user space library of device-mapper. The created multi-path device will be in/dev/mapper ).
 
2. device-mapper: kernel and user. The kernel is mainly composed of the device mapper core (dm. ko) and some target driver (md-multipath.ko ). The core completes device ing, while the target processes the I/o from the mappered device based on the ing relationship and its own characteristics. At the same time, an interface is provided in the core section. You can use ioctr to communicate with the kernel section to guide kernel driver behavior, such as how to create mappered device and the divece attributes. The user space of linux device mapper mainly includes the device-mapper package. This includes the dmsetup tool and some libraries that help you create and configure mappered devices. These libraries are mainly abstracted and encapsulated interfaces for communication with ioctr to facilitate the creation and configuration of mappered devices. These libraries must be called in the multipath-tool program.
 
3. dm-multipath.ko and dm. ko: dm. ko is the devicemapper driver. It is the basis for multipath implementation. Dm-multipath is actually a target driver of dm.
 
4. scsi_id: Included in the udev package. You can configure this program in multipath. conf to obtain the serial number of the scsi device. By serial number, you can determine that multiple paths correspond to the same device. This is the key to multi-path implementation. Scsi_id is an inquery command that sends EVPD page80 or page83 to the device through the sg driver to query the ID of the scsi device. However, some devices do not support the EVPD inquery command, so they cannot be used to generate multipath devices. However, scsi_id can be rewritten to provide a virtual identifier for the device that cannot provide the scsi device identifier and output it to the standard output. When creating a multipath device, the multipath program calls scsi_id to obtain the scsi id of the device from its standard output. When rewriting, You need to modify the scsi_id program's return value to 0. In the multipath program, the system checks the result to determine whether the scsi id has been successfully obtained.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.