Redhat6 多路備援multipath
拓撲
++++++++++++++
+ Server +
eth0: 192.168.122.10/24 | eth1: 172.16.1.1/24
___________________|____________________
|
++++++++++++ ++++++++++++
+ virbr0 + virbr1
++++++++++++ ++++++++++++
|_______________________________________|
|
eth0: 192.168.122.20/24 | eth1:172.16.1.2/24
++++++++++++
+ ISCSI Storage
+ /dev/sdb1
++++++++++++
配置 ISCSI Storage
# yum install scsi-target-utils
# vim /etc/tgt/targets.conf
<targetiqn.2013-08.com.uplooking:server.target1>
backing-store /dev/vg001/lv001
initiator-address 192.168.122.10
initiator-address 172.16.1.1
</target>
# service tgtd restart
配置 Server
# yum install iscsi-initiator-utils
# service iscsi start
# iscsiadm -m discovery -t sendtargets -p192.168.122.20:3260
# iscsiadm -m discovery -t sendtargets -p172.16.1.2:3260
# iscsiadm -m node -Tiqn.2013-08.com.uplooking:server.target1 -l
雖然login裝置一次,但是fdisk檢視可以看到新增了2個裝置sdb、sdc,而sdb、sdc又是同一個ISCSI裝置
# fdisk -l
Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280bytes
Device Boot Start End Blocks IdSystem
/dev/sda1 * 1 13 104391 83Linux
/dev/sda2 14 2610 20860402+ 8eLinux LVM
Disk /dev/sdb: 21.4 GB, 21474836480 bytes
Disk /dev/sdc: 21.4 GB, 21474836480 bytes
# yum install device-mapper-multipath
# mpathconf
multipath is enabled
find_multipaths is disabled
user_friendly_names is enabled
dm_multipath module is not loaded
multipathd is chkconfiged off
# mpathconf --help
usage: /sbin/mpathconf <command>
Commands:
Enable: --enable
Disable: --disable
Set user_friendly_names (Default n):--user_friendly_names <y|n>
Set find_multipaths (Default n):--find_multipaths <y|n>
Load the dm-multipath modules on enable(Default y): --with_module <y|n>
start/stop/reload multipathd (Default n):--with_multipathd <y|n>
chkconfig on/off multipathd (Default y):--with_chkconfig <y|n>
# mpathconf --user_friendly_names y--find_multipaths y --with_multipathd y --with_chkconfig y
find_multipaths is enabled
# service multipathd start
Starting multipathd daemon: [ OK ]
dm_multipath module is loaded
# ll /dev/mapper/mpatha
lrwxrwxrwx. 1 root root 7 Aug 27 14:54/dev/mapper/mpatha -> ../dm-6
# multipath -ll
mpatha (1IET 00010001) dm-6 IET,VIRTUAL-DISK
size=2.0G features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=1status=active
| `- 2:0:0:1 sdb 8:16 active ready running
`-+- policy='round-robin 0' prio=1status=enabled
`-3:0:0:1 sdc 8:32 active ready running
# dmsetup table
mpatha: 0 4194304 multipath 0 0 2 1round-robin 0 1 1 8:16 1 round-robin 0 1 1 8:32 1
本文轉自潘闊 51CTO部落格,原文連結:http://blog.51cto.com/pankuo/1393684,如需轉載請自行聯系原作者