Configure multi-path in Linux
1. Install the multi-path software package:
Device-mapper-1.02.67-2.el5
Device-mapper-event-1.02.67.2.el5
Device-mapper-multipath-0.4.7-48.el5
[Root @ RKDB01 Server] # rpm-ivh device-mapper-1.02.67-2.el5.x86_64.rpm
Warning: device-mapper-1.02.67-2.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ######################################## ### [100%]
Package device-mapper-1.02.67-2.el5.x86_64 is already installed
[Root @ RKDB01 Server] # rpm-ivh device-mapper-event-1.02.67-2.el5.x86_64.rpm
Warning: device-mapper-event-1.02.67-2.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ######################################## ### [100%]
Package device-mapper-event-1.02.67-2.el5.x86_64 is already installed
[Root @ RKDB01 Server] # rpm-ivh device-mapper-multipath-0.4.7-48.el5.x86_64.rpm
Warning: device-mapper-multipath-0.4.7-48.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ######################################## ### [100%]
Package device-mapper-multipath-0.4.7-48.el5.x86_64 is already installed
2. Set boot and check whether the installation package is normal:
Chkconfig -- level 345 multipathd on
Lsmod | grep dm_multipath
[Root @ RKDB01 Server] # chkconfig -- level 345 multipathd on
[Root @ RKDB01 Server] # lsmod | grep dm_multipath
Dm_multipath 58969 0
Scsi_dh 42561 1 dm_multipath
Dm_mod 102417 4 dm_mirror, dm_multipath, dm_raid45, dm_log
[Root @ RKDB01 Server] #
3. Configure multipathd to make it work normally. edit/etc/multipath. conf and open the following content:
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 {
Wwid 26353900f02796769
Devnode "^ (ram | raw | loop | fd | md | dm-| sr | scd | st) [0-9] *"
Devnode "^ hd [a-z]"
}
4. Disable the following content:
# Blacklist {
# Devnode "*"
#}
# Defaults {
27 # user_friendly_names yes
28 #}
5. Execute the following command to find the multi-path:
[Root @ RKDB01 Server] # modprobe dm-multipath
[Root @ RKDB01 Server] # multipath-F
[Root @ RKDB01 Server] # multipath dm-multipath
[Root @ RKDB01 Server] # multipath dm-round-robin
[Root @ RKDB01 Server] # service multipathd restart
Shutting down the multipathd port monitoring program: [OK]
Starting the daemon multipathd: [OK]
[Root @ RKDB01 Server] # multipath-v2
[Root @ RKDB01 Server] # multipath-v2
[Root @ RKDB01 Server] # multipath-ll
Mpath1 (3600d02310000011b16a5d57c6a1bd99a) dm-0 TOYOU, NetStor_iSUM510
[Size = 3.3 T] [features = 0] [hwhandler = 0] [rw]
\ _ Round-robin 0 [prio = 2] [ena bled]
\ _ 1: 0: 0: 0 sdb 8: 16 [failed] [ready]
\ _ 1: 0: 1: 0 sdc 8: 32 [failed] [ready]
[Root @ RKDB01 Server] #
6. After the server is restarted, we can see the multi-path information:
[Root @ RKDB01 ~] # Ll/dev/mapper/
Total 0
Crw ------- 1 root 10, 60 11-05 control
Brw-rw ---- 1 root disk 253, 0 11-05 mpath1
Brw-rw ---- 1 root disk 253, 1 11-05 mpath2
[Root @ RKDB01 ~] # Multipath-ll
Mpath2 (3600d02310000011b76128b9c63138cf4) dm-1 TOYOU, NetStor_iSUM510
[Size = 3.2 T] [features = 0] [hwhandler = 0] [rw]
\ _ Round-robin 0 [prio = 2] [active]
\ _ 1: 0: 0: 1 sdc 8: 32 [active] [ready]
\ _ 1: 0: 1: 1 sde 8: 64 [active] [ready]
Mpath1 (3600d02310000011b16a5d57c6a1bd99a) dm-0 TOYOU, NetStor_iSUM510
[Size = 20G] [features = 0] [hwhandler = 0] [rw]
\ _ Round-robin 0 [prio = 2] [active]
\ _ 1: 0: 0: 0 sdb 8: 16 [active] [ready]
\ _ 1: 0: 1: 0 sdd 8: 48 [active] [ready]
7, through the fdisk can be seen to generate a DM-0/DM-1 two disks, is the above sdc/sde, sdb/sdd multi path after the out:
[Root @ RKDB01 ~] # Fdisk-l
Disk/dev/sda: 299.4 GB, 299439751168 bytes
255 heads, 63 sectors/track, 36404 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Device Boot Start End Blocks Id System
/Dev/sda1*1 38 305203 + 83 Linux
/Dev/sda2 39 13092 104856255 83 Linux
/Dev/sda3 13093 19619 52428127 + 83 Linux
/Dev/sda4 19620 36404 134825512 + 5 Extended
/Dev/sda5 19620 26146 52428096 83 Linux
/Dev/sda6 26147 28757 20972826 83 Linux
/Dev/sda7 28758 30324 12586896 82 Linux swap/Solaris
/Dev/sda8 30325 36404 48837568 + 83 Linux
Disk/dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Disk/dev/sdb doesn' t contain a valid partition table
Disk/dev/sdc: 3568.4 GB, 3568429957120 bytes
255 heads, 63 sectors/track, 433836 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Disk/dev/sdc doesn' t contain a valid partition table
Disk/dev/sdd: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Disk/dev/sdd doesn't contain a valid partition table
Disk/dev/sde: 3568.4 GB, 3568429957120 bytes
255 heads, 63 sectors/track, 433836 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Disk/dev/sde doesn't contain a valid partition table
Disk/dev/dm-0: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Disk/dev/dm-0 doesn't contain a valid partition table
Disk/dev/dm-1: 3568.4 GB, 3568429957120 bytes
255 heads, 63 sectors/track, 433836 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Disk/dev/dm-1 doesn't contain a valid partition table
Disk/dev/sdf: 4009 MB, 4009754624 bytes
255 heads, 63 sectors/track, 487 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Device Boot Start End Blocks Id System
/Dev/sdf4*1 488 3915744 + B W95 FAT32
Partition 4 has different physical/logical endings:
Phys = (486,254, 63) logical = (487,125, 22)
[Root @ RKDB01 ~] #
8. You can also view the multi-path ing information in the/dev/mapper directory:
[Root @ RKDB01 ~] # Ll/dev/mapper/
Total 0
Crw ------- 1 root 10, 60 11-06 control
Brw-rw ---- 1 root disk 253, 2 11-06 data-data001
Brw-rw ---- 1 root disk 253, 0 11-06 mpath1
Brw-rw ---- 1 root disk 253, 1 11-06 mpath2
9. Reference:
Red_Hat_Enterprise_Linux-5-DM_Multipath-en-US.pdf
Red_Hat_Enterprise_Linux-5-DM_Multipath-zh-CN.pdf
Red_Hat_Enterprise_Linux-6-DM_Multipath-en-US.pdf
Red_Hat_Enterprise_Linux-6-DM_Multipath-zh-CN.pdf
This article permanently updates the link address: