本文共 3075 字,大约阅读时间需要 10 分钟。
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
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280bytes
Disk /dev/sdc: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280bytes
# 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
# mpathconf
multipath is enabled
find_multipaths is enabled
user_friendly_names is enabled
dm_multipath module is not loaded
multipathd is chkconfiged off
# service multipathd start
Starting multipathd daemon: [ OK ]
# mpathconf
multipath is enabled
find_multipaths is enabled
user_friendly_names is enabled
dm_multipath module is loaded
multipathd is chkconfiged off
# 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