linux multipath.log,Linux Multipath配置
關(guān)于Linux Multipath配置,網(wǎng)上還是很多的,自己再來梳理一下,當(dāng)前環(huán)境為RedHat6,HP P2000存儲(chǔ)
1. 安裝軟件。
查看是否安裝 rpm -qa |grep device-mapper
device-mapper-multipath-libs-0.4.9-31.el6.x86_64
device-mapper-event-libs-1.02.53-8.el6.x86_64
device-mapper-event-1.02.53-8.el6.x86_64
device-mapper-1.02.53-8.el6.x86_64
device-mapper-multipath-0.4.9-31.el6.x86_64
如果沒有安裝,請(qǐng)安裝,命令如下
# yum –y install device-mapper device-mapper-multipath
# chkconfig multipathd on
2. 初始化模塊。
# modprobe dm-multipath
# modprobe dm-round-robin
# lsmod |grep dm_multipath
dm_multipath??? 17756??? 3??? dm_round_robin
dm_mod????????? 82839??? 38??? dm_multipath,dm_mirror,dm_log
3. 查找 HBA 卡的 wwid.
# multipath -v3 | grep uid
Aug 14 09:39:30 | sda: getuid = /lib/udev/scsi_id --whitelisted --device=/dev/%n (controller setting)
Aug 14 09:39:30 | sda: uid = 3600c0ff0001982fa95fcfe5101000000 (callout)
Aug 14 09:39:30 | sdb: getuid = /lib/udev/scsi_id --whitelisted --device=/dev/%n (controller setting)
Aug 14 09:39:30 | sdb: uid = 3600c0ff0001982fa95fcfe5101000000 (callout)
uuid????????????????????????????? hcil??? dev dev_t pri dm_st chk_st vend/prod
4. 配置多路徑。
# vi /etc/multipath.conf
blacklist {
devnode "^sdc"
}
defaults {
user_friendly_names no
}
multipaths {
multipath {
wwid 3600c0ff0001982fa95fcfe5101000000
alias mpath0
path_grouping_policy multibus
path_selector "round-robin 0"
}
}
devices {
device {
vendor "HP"
product "Virtual disk"
path_grouping_policy multibus
getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
path_checker readsector0
path_selector "round-robin 0"
}
}
5. 啟動(dòng)多路徑軟件。
# service multipathd start
# chkconfig multipathd on
# multipath -F????????????????????? # 刪除現(xiàn)有路徑。
# multipath -v2??????????????????? # 格式化路徑。
# multipath -ll??????????????????? # 查看多路徑,目前是主備模式。
mpath0 (3600c0ff0001982fa95fcfe5101000000) dm-0 HP,P2000 G3 SAS
size=9.1T features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=130 status=active
| - 3:0:0:1 sda 8:0? active ready running
-+- policy='round-robin 0' prio=10 status=enabled
- 4:0:0:1 sdb 8:16 active ready running
6. 重啟測試。
# reboot
# multipath -ll????????????????? # 依然是主備模式。
# service multipathd start??????? # 再次重啟 multipathd.
# multipath -ll????????????????? # 變成主主模式。
size=9.1T features='1 queue_if_no_path' hwhandler='0' wp=rw
-+- policy='round-robin 0' prio=70 status=active
|- 3:0:0:1 sda 8:0? active ready running????????? # 需要重啟一次才會(huì)變成主主?
`- 4:0:0:1 sdb 8:16 active ready running
7. 創(chuàng)建用戶邏輯卷。
# pvcreate /dev/mapper/mpath0
# vgcreate -s 256m datavg /dev/mapper/mpath0
# lvcreate --size 2000G --name lv_src vg_data
# mkfs.ext4 /dev/mapper/vg_data-lv_src
# mkdir /src
# mount -t ext4 /dev/mapper/vg_data-lv_src /src
8. 負(fù)載均衡測試。
# cd /src
# dd if=/dev/zero of=test.img
# iostat 1
Device:??????????? tps? Blk_read/s? Blk_wrtn/s
sda??????????? 2020.00??????? 8.00??? 466272.00??? # 兩條線路都有數(shù)據(jù)傳輸,主主模式起作用。
sdb??????????? 2024.00??????? 0.00??? 368952.00??? # 如果只有一條線路傳輸數(shù)據(jù),就是主備模式。
sdc????????????? 0.00??????? 0.00??????? 0.00
dm-0????????? 4044.00??????? 8.00??? 834776.00??? # 合并后的路徑,數(shù)據(jù)等于兩條。
總結(jié)
以上是生活随笔為你收集整理的linux multipath.log,Linux Multipath配置的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 三次握手面试题java_java面试题三
- 下一篇: 项响琴C语言书籍在线浏览,电子琴 c语言