㈠ linux什麼情況下用到多路徑
1、安裝多路徑軟體包:
device-mapper-1.02.67-2.el5
device-mapper-event-1.02.67.2.el5
device-mapper-multipath-0.4.7-48.el5
[plain] view plain print?
[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、設置開機啟動,並檢查安裝包是否正常:
chkconfig --level 345 multipathd on
lsmod |grep dm_multipath
[plain] view plain print?
[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、配置multipathd 使其正常工作,編輯/etc/multipath.conf,開放如下內容:
[plain] view plain print?
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、並關閉如下內容
[plain] view plain print?
#blacklist {
# devnode "*"
#}
#defaults {
27 # user_friendly_names yes
28 #}
5、完成之後執行如下命令發現多路徑:
[plain] view plain print?
[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
正在關閉multipathd 埠監控程序: [確定]
正在啟動守護進程multipathd: [確定]
[root@RKDB01 Server]# multipath -v2
[root@RKDB01 Server]# multipath -v2
[root@RKDB01 Server]# multipath -ll
mpath1 () dm-0 TOYOU,NetStor_iSUM510
[size=3.3T][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、重啟伺服器後,我們可以看到多路徑信息了:
[plain] view plain print?
[root@RKDB01 ~]# ll /dev/mapper/
總計 0
crw------- 1 root root 10, 60 11-05 22:35 control
brw-rw---- 1 root disk 253, 0 11-05 22:35 mpath1
brw-rw---- 1 root disk 253, 1 11-05 22:35 mpath2
[root@RKDB01 ~]# multipath -ll
mpath2 () dm-1 TOYOU,NetStor_iSUM510
[size=3.2T][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 () 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、通過fdisk 看可以生成了DM-0/DM-1兩個盤,正是上面sdc/sde,sdb/sdd多路徑後出來的:
[plain] view plain print?
[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、我們同時也可以在/dev/mapper目錄中查看到多路徑映射的信息:
[plain] view plain print?
[root@RKDB01 ~]# ll /dev/mapper/
總計 0
crw------- 1 root root 10, 60 11-06 00:49 control
brw-rw---- 1 root disk 253, 2 11-06 00:49 data-data001
brw-rw---- 1 root disk 253, 0 11-06 00:49 mpath1
brw-rw---- 1 root disk 253, 1 11-06 00:49 mpath2
㈡ 如何使用Linux自帶多路徑DM
一、多路徑解釋
多路徑,顧名思義就是有多種選擇的路徑。在SAN或IPSAN環境,主機和存儲之間外加了光纖交換機,這就導致主機和存儲之間交換速度和效率增強,一條路徑肯定是不行的,也是不安全不穩定的。多路徑就是要來解決從主機到磁碟之間最快,最高效的問題。主要實現如下幾個功能
故障的切換和恢復
IO流量的負載均衡
磁碟的虛擬化
多路徑之前一直是存儲廠商負責解決,竟來被拆分出來單獨賣錢了。
構架基本是這樣的:存儲,多路徑軟體,光纖交換機,主機,主機系統。
二、LINUX下的multipath
1、查看是否自帶安裝?
1
2
3
4
5
6
[root@web2 multipath]# rpm -qa|grep device
device-mapper-1.02.39-1.el5
device-mapper-1.02.39-1.el5
device-mapper-multipath-0.4.7-34.el5
device-mapper-event-1.02.39-1.el5
[root@web2 multipath]#
2、安裝
1
2
3
4
5
6
rpm -ivh device-mapper-1.02.39-1.el5.rpm #安裝映射包
rpm -ivh device-mapper-multipath-0.4.7-34.el5.rpm #安裝多路徑包
外加加入開機啟動
chkconfig –level 2345 multipathd on #設置成開機自啟動multipathd
lsmod |grep dm_multipath #來檢查安裝是否正常
3、配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# on the default devices.
blacklist {
devnode "^(ram|raw|loop|fd|md|dm-|sr|sr|scd|st)[0-9]*"
devnode "^hd[a-z]"
}
devices {
device {
vendor "HP"
path_grouping_policy multibus
features "1 queue_if_no_path"
path_checker readsector()
failback immediate
}
}<br><br>完整的配置如下:
blacklist {
devnode "^sda"
}
defaults {
user_friendly_names no
}
multipaths {
multipath {
wwid
alias iscsi-dm0
path_grouping_policy multibus
path_checker tur
path_selector "round-robin 0"
}
multipath {
wwid
alias iscsi-dm1
path_grouping_policy multibus
path_checker tur
path_selector "round-robin 0"
}
multipath {
wwid
alias iscsi-dm2
path_grouping_policy multibus
path_checker tur
path_selector "round-robin 0"
}
multipath {
wwid
alias iscsi-dm3
path_grouping_policy multibus
path_checker tur
path_selector "round-robin 0"
}
}
devices {
device {
vendor "iSCSI-Enterprise"
proct "Virtual disk"
path_grouping_policy multibus
getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
path_checker readsector0
path_selector "round-robin 0"
}
}
4、命令
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
[root@web2 ~]# multipath -h
multipath-tools v0.4.7 (03/12, 2006)
Usage: multipath [-v level] [-d] [-h|-l|-ll|-f|-F|-r]
[-p failover|multibus|group_by_serial|group_by_prio]
[device]
-v level verbosity level
0 no output
1 print created devmap names only
2 default verbosity
3 print debug information
-h print this usage text
-b file bindings file location
-d dry run, do not create or update devmaps
-l show multipath topology (sysfs and DM info)
-ll show multipath topology (maximum info)
-f flush a multipath device map
-F flush all multipath device maps
-r force devmap reload
-p policy force all maps to specified policy :
failover 1 path per priority group
multibus all paths in 1 priority group
group_by_serial 1 priority group per serial
group_by_prio 1 priority group per priority lvl
group_by_node_name 1 priority group per target node
device limit scope to the device's multipath
(udev-style $DEVNAME reference, eg /dev/sdb
or major:minor or a device map name)
[root@web2 ~]#
5、啟動關閉
1
2
3
4
# /etc/init.d/multipathd start #開啟mulitipath服務
service multipath start
service multipath restart
service multipath shutdown
6、如何獲取wwid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
1、
[root@vxfs01 ~]# cat /var/lib/multipath/bindings
# Multipath bindings, Version : 1.0
# NOTE: this file is automatically maintained by the multipath program.
# You should not need to edit this file in normal circumstances.
#
# Format:
# alias wwid
#
mpath0
mpath1
mpath2
mpath3
mpath4
2、
[root@vxfs01 ~]# multipath -v3 |grep 3600
sdb: uid = (callout)
sdc: uid = (callout)
sdd: uid = (callout)
sde: uid = (callout)
1:0:0:0 sdb 8:16 0 [undef][ready] DGC,RAI
1:0:1:0 sdc 8:32 1 [undef][ready] DGC,RAI
2:0:0:0 sdd 8:48 1 [undef][ready] DGC,RAI
2:0:1:0 sde 8:64 0 [undef][ready] DGC,RAI
Found matching wwid [] in bindings file.
比較詳細的文字:
http://zhumeng8337797.blog.163.com/blog/static/1007689142013416111534352/
http://blog.csdn.net/wuweilong/article/details/14184097
RHEL官網資料:
http://www.prudentwoo.com/wp-content/uploads/downloads/2013/11/Red_Hat_Enterprise_Linux-5-DM_Multipath-en-US.pdf
http://www.prudentwoo.com/wp-content/uploads/downloads/2013/11/Red_Hat_Enterprise_Linux-5-DM_Multipath-zh-CN.pdf
http://www.prudentwoo.com/wp-content/uploads/downloads/2013/11/Red_Hat_Enterprise_Linux-6-DM_Multipath-en-US.pdf
http://www.prudentwoo.com/wp-content/uploads/downloads/2013/11/Red_Hat_Enterprise_Linux-6-DM_Multipath-zh-CN.pdf
㈢ linux上安裝RAC時不使用asmlib的多路徑怎麼配置
如果使用了 多路徑方案, 可以直接使用multipath 綁定設備名 不需要用培鏈賣到 asmlib或UDEV
請直接參考 文配逗檔:Configuring non-raw multipath devices for Oracle Clusterware 11g (11.1.0, 11.2.0) on RHEL5/OL5 [ID 605828.1]
[root@vrh1 ~]# for i in `cat /proc/partitions | awk '{print $4}' |grep sd | grep [a-z]$`; do echo "### $i: `scsi_id -g -u -s /block/$i`"; done
### sda: SATA_VBOX_HARDDISK_VB83d4445f-b8790695_
### sdb: SATA_VBOX_HARDDISK_VB0db2f233-269850e0_
### sdc: SATA_VBOX_HARDDISK_VBa56f2571-0dd27b33_
### sdd: SATA_VBOX_HARDDISK_VBf6b74ff7-871d1de8_
### sde: SATA_VBOX_HARDDISK_VB5a531910-25f4eb9a_
### sdf: SATA_VBOX_HARDDISK_VB4915e6e3-737b312e_
### sdg: SATA_VBOX_HARDDISK_VB512c8f75-37f4a0e9_
### sdh: SATA_VBOX_HARDDISK_VBc0115ef6-a48bc15d_
### sdi: SATA_VBOX_HARDDISK_VB3a556907-2b72391d_
### sdj: SATA_VBOX_HARDDISK_VB7ec8476c-08641bd4_
### sdk: SATA_VBOX_HARDDISK_VB743e1567-d0009678_
[root@vrh1 ~]# grep -v ^# /etc/multipath.conf
defaults {
user_friendly_names yes
}
defaults {
udev_dir /dev
polling_interval 10
selector "round-robin 0"
path_grouping_policy failover
getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
prio_callout /bin/喚攜true
path_checker readsector0
rr_min_io 100
rr_weight priorities
failback immediate
#no_path_retry fail
user_friendly_name yes
}
devnode_blacklist {
devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
devnode "^hd[a-z]"
devnode "^cciss!c[0-9]d[0-9]*"
}
multipaths {
multipath {
wwid SATA_VBOX_HARDDISK_VB0db2f233-269850e0_
alias voting1
path_grouping_policy failover
}
multipath {
wwid SATA_VBOX_HARDDISK_VBa56f2571-0dd27b33_
alias voting2
path_grouping_policy failover
}
multipath {
wwid SATA_VBOX_HARDDISK_VBf6b74ff7-871d1de8_
alias voting3
path_grouping_policy failover
}
multipath {
wwid SATA_VBOX_HARDDISK_VB5a531910-25f4eb9a_
alias ocr1
path_grouping_policy failover
}
multipath {
wwid SATA_VBOX_HARDDISK_VB4915e6e3-737b312e_
alias ocr2
path_grouping_policy failover
}
multipath {
wwid SATA_VBOX_HARDDISK_VB512c8f75-37f4a0e9_
alias ocr3
path_grouping_policy failover
}
}
[root@vrh1 ~]# multipath
[root@vrh1 ~]# multipath -ll
mpath2 (SATA_VBOX_HARDDISK_VB3a556907-2b72391d_) dm-9 ATA,VBOX HARDDISK
size=5.0G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
`- 8:0:0:0 sdi 8:128 active ready running
mpath1 (SATA_VBOX_HARDDISK_VBc0115ef6-a48bc15d_) dm-8 ATA,VBOX HARDDISK
size=5.0G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
`- 7:0:0:0 sdh 8:112 active ready running
ocr3 (SATA_VBOX_HARDDISK_VB512c8f75-37f4a0e9_) dm-7 ATA,VBOX HARDDISK
size=5.0G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
`- 6:0:0:0 sdg 8:96 active ready running
ocr2 (SATA_VBOX_HARDDISK_VB4915e6e3-737b312e_) dm-6 ATA,VBOX HARDDISK
size=5.0G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
`- 5:0:0:0 sdf 8:80 active ready running
ocr1 (SATA_VBOX_HARDDISK_VB5a531910-25f4eb9a_) dm-5 ATA,VBOX HARDDISK
size=5.0G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
`- 4:0:0:0 sde 8:64 active ready running
voting3 (SATA_VBOX_HARDDISK_VBf6b74ff7-871d1de8_) dm-4 ATA,VBOX HARDDISK
size=40G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
`- 3:0:0:0 sdd 8:48 active ready running
voting2 (SATA_VBOX_HARDDISK_VBa56f2571-0dd27b33_) dm-3 ATA,VBOX HARDDISK
size=40G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
`- 2:0:0:0 sdc 8:32 active ready running
voting1 (SATA_VBOX_HARDDISK_VB0db2f233-269850e0_) dm-2 ATA,VBOX HARDDISK
size=40G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
`- 1:0:0:0 sdb 8:16 active ready running
mpath4 (SATA_VBOX_HARDDISK_VB743e1567-d0009678_) dm-11 ATA,VBOX HARDDISK
size=5.0G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
`- 10:0:0:0 sdk 8:160 active ready running
mpath3 (SATA_VBOX_HARDDISK_VB7ec8476c-08641bd4_) dm-10 ATA,VBOX HARDDISK
size=5.0G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
`- 9:0:0:0 sdj 8:144 active ready running
[root@vrh1 ~]# dmsetup ls | sort
mpath1 (253, 8)
mpath2 (253, 9)
mpath3 (253, 10)
mpath4 (253, 11)
ocr1 (253, 5)
ocr2 (253, 6)
ocr3 (253, 7)
VolGroup00-LogVol00 (253, 0)
VolGroup00-LogVol01 (253, 1)
voting1 (253, 2)
voting2 (253, 3)
voting3 (253, 4)
[root@vrh1 ~]# ls -l /dev/mapper/*
crw------- 1 root root 10, 62 Oct 17 09:58 /dev/mapper/control
brw-rw---- 1 root disk 253, 8 Oct 19 00:11 /dev/mapper/mpath1
brw-rw---- 1 root disk 253, 9 Oct 19 00:11 /dev/mapper/mpath2
brw-rw---- 1 root disk 253, 10 Oct 19 00:11 /dev/mapper/mpath3
brw-rw---- 1 root disk 253, 11 Oct 19 00:11 /dev/mapper/mpath4
brw-rw---- 1 root disk 253, 5 Oct 19 00:11 /dev/mapper/ocr1
brw-rw---- 1 root disk 253, 6 Oct 19 00:11 /dev/mapper/ocr2
brw-rw---- 1 root disk 253, 7 Oct 19 00:11 /dev/mapper/ocr3
brw-rw---- 1 root disk 253, 0 Oct 17 09:58 /dev/mapper/VolGroup00-LogVol00
brw-rw---- 1 root disk 253, 1 Oct 17 09:58 /dev/mapper/VolGroup00-LogVol01
brw-rw---- 1 root disk 253, 2 Oct 19 00:11 /dev/mapper/voting1
brw-rw---- 1 root disk 253, 3 Oct 19 00:11 /dev/mapper/voting2
brw-rw---- 1 root disk 253, 4 Oct 19 00:11 /dev/mapper/voting3
[root@vrh1 ~]# ls -l /dev/dm*
brw-rw---- 1 root root 253, 0 Oct 17 09:58 /dev/dm-0
brw-rw---- 1 root root 253, 1 Oct 17 09:58 /dev/dm-1
brw-rw---- 1 root root 253, 10 Oct 19 00:11 /dev/dm-10
brw-rw---- 1 root root 253, 11 Oct 19 00:11 /dev/dm-11
brw-rw---- 1 root root 253, 2 Oct 19 00:11 /dev/dm-2
brw-rw---- 1 root root 253, 3 Oct 19 00:11 /dev/dm-3
brw-rw---- 1 root root 253, 4 Oct 19 00:11 /dev/dm-4
brw-rw---- 1 root root 253, 5 Oct 19 00:11 /dev/dm-5
brw-rw---- 1 root root 253, 6 Oct 19 00:11 /dev/dm-6
brw-rw---- 1 root root 253, 7 Oct 19 00:11 /dev/dm-7
brw-rw---- 1 root root 253, 8 Oct 19 00:11 /dev/dm-8
brw-rw---- 1 root root 253, 9 Oct 19 00:11 /dev/dm-9
[root@vrh1 ~]# ls -l /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root 15 Oct 17 09:58 scsi-SATA_VBOX_HARDDISK_VB0db2f233-269850e0 -> ../../asm-diskb
lrwxrwxrwx 1 root root 15 Oct 17 09:58 scsi-SATA_VBOX_HARDDISK_VB3a556907-2b72391d -> ../../asm-diski
lrwxrwxrwx 1 root root 15 Oct 17 09:58 scsi-SATA_VBOX_HARDDISK_VB4915e6e3-737b312e -> ../../asm-diskf
lrwxrwxrwx 1 root root 15 Oct 17 09:58 scsi-SATA_VBOX_HARDDISK_VB512c8f75-37f4a0e9 -> ../../asm-diskg
lrwxrwxrwx 1 root root 15 Oct 17 09:58 scsi-SATA_VBOX_HARDDISK_VB5a531910-25f4eb9a -> ../../asm-diske
lrwxrwxrwx 1 root root 15 Oct 17 09:58 scsi-SATA_VBOX_HARDDISK_VB743e1567-d0009678 -> ../../asm-diskk
lrwxrwxrwx 1 root root 15 Oct 17 09:58 scsi-SATA_VBOX_HARDDISK_VB7ec8476c-08641bd4 -> ../../asm-diskj
lrwxrwxrwx 1 root root 9 Oct 17 09:58 scsi-SATA_VBOX_HARDDISK_VB83d4445f-b8790695 -> ../../sda
lrwxrwxrwx 1 root root 10 Oct 17 09:58 scsi-SATA_VBOX_HARDDISK_VB83d4445f-b8790695-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Oct 17 09:58 scsi-SATA_VBOX_HARDDISK_VB83d4445f-b8790695-part2 -> ../../sda2
lrwxrwxrwx 1 root root 15 Oct 17 09:58 scsi-SATA_VBOX_HARDDISK_VBa56f2571-0dd27b33 -> ../../asm-diskc
lrwxrwxrwx 1 root root 15 Oct 17 09:58 scsi-SATA_VBOX_HARDDISK_VBc0115ef6-a48bc15d -> ../../asm-diskh
lrwxrwxrwx 1 root root 15 Oct 17 09:58 scsi-SATA_VBOX_HARDDISK_VBf6b74ff7-871d1de8 -> ../../asm-diskd
Report Abuse Like (0)
2. Re: asm磁碟使用鏈路聚合設備名,IO性能只有非聚合設備的1/6!
LiuMaclean(劉相兵)
Expert
LiuMaclean(劉相兵) Jul 21, 2013 11:09 AM (in response to 13628)
step 1:
[oracle@vrh8 mapper]$ cat /etc/multipath.conf
multipaths {
multipath {
wwid SATA_VBOX_HARDDISK_VBf6b74ff7-871d1de8_
alias asm-disk1
mode 660
uid 501
gid 503
}
multipath {
wwid SATA_VBOX_HARDDISK_VB0db2f233-269850e0_
alias asm-disk2
mode 660
uid 501
gid 503
}
multipath {
wwid SATA_VBOX_HARDDISK_VBa56f2571-0dd27b33_
alias asm-disk3
mode 660
uid 501
gid 503
}
}
第二步:
reboot or service multipathd restart
第三步:
[oracle@vrh8 mapper]$ ls -l /dev/mapper/asm-disk*
brw-rw---- 1 grid asmadmin 253, 4 Jul 21 07:02 /dev/mapper/asm-disk1
brw-rw---- 1 grid asmadmin 253, 2 Jul 21 07:02 /dev/mapper/asm-disk2
brw-rw---- 1 grid asmadmin 253, 3 Jul 21 07:02 /dev/mapper/asm-disk3
㈣ Linux系統怎麼配置多路徑
Linux多路徑指的是除了主機和硬碟一條路徑的連接,還包括了主機和網路伺服器的連接形成的主機一對多的路徑連接關系。通過多路徑的連接,實現了磁碟的虛擬化。
1、安裝多路徑軟體包:
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、設置開機啟動,並檢查安裝包是否正常:
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、配置multipathd 使其正常工作,編輯/etc/multipath.conf,開放如下內容:
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、並關閉如下內容
#blacklist {
# devnode 「*」
#}
#defaults {
27 # user_friendly_names yes
28 #}
5、完成之後執行如下命令發現多路徑:
[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
正在關閉multipathd 埠監控程序: [確定]
正在啟動守護進程multipathd: [確定]
[root@RKDB01 Server]# multipath -v2
[root@RKDB01 Server]# multipath -v2
[root@RKDB01 Server]# multipath -ll
mpath1 () dm-0 TOYOU,NetStor_iSUM510
[size=3.3T][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、重啟伺服器後,可以看到多路徑信息了:
[root@RKDB01 ~]# ll /dev/mapper/
總計 0
crw------- 1 root root 10, 60 11-05 22:35 control
brw-rw---- 1 root disk 253, 0 11-05 22:35 mpath1
brw-rw---- 1 root disk 253, 1 11-05 22:35 mpath2
[root@RKDB01 ~]# multipath -ll
mpath2 () dm-1 TOYOU,NetStor_iSUM510
[size=3.2T][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 () 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、通過fdisk 看可以生成了DM-0/DM-1兩個盤,正是上面sdc/sde,sdb/sdd多路徑後出來的:
[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、同時也可以在/dev/mapper目錄中查看到多路徑映射的信息:
[root@RKDB01 ~]# ll /dev/mapper/
總計 0
crw------- 1 root root 10, 60 11-06 00:49 control
brw-rw---- 1 root disk 253, 2 11-06 00:49 data-data001
brw-rw---- 1 root disk 253, 0 11-06 00:49 mpath1
brw-rw---- 1 root disk 253, 1 11-06 00:49 mpath2