多路沉余-multip

拓扑

							++++++++++++++
							+            Server          +  client
							++++++++++++++
                               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/sdb	+
							 ++++++++++++		 

网卡bonding

eth0
bond0 switch
eth1

配置 ISCSI Storage
[root@localhost ~]# yum install scsi-target-utils
[root@localhost ~]# vim /etc/tgt/targets.conf

[root@localhost ~]# service tgtd restart

配置 Server
[root@localhost ~]# yum install iscsi-initiator-utils
[root@localhost ~]# service iscsi start
[root@localhost ~]# iscsiadm -m discovery -t sendtargets -p 192.168.122.20:3260
[root@localhost ~]# iscsiadm -m discovery -t sendtargets -p 172.16.1.2:3260
[root@localhost ~]# iscsiadm -m node -T iqn.2013-08.com.uplooking:server.target1 -l

虽然login设备一次,但是fdisk查看可以看到新增了2个设备sdb、sdc,而sdb、sdc又是同一个ISCSI设备
[root@localhost ~]# fdisk -l
Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 2610 20860402+ 8e Linux LVM

Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdc: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

[root@localhost ~]# yum install device-mapper-multipath

[root@localhost ~]# mpathconf
multipath is enabled
find_multipaths is disabled
user_friendly_names is enabled
dm_multipath module is not loaded
multipathd is chkconfiged off

[root@localhost ~]# mpathconf --help
usage: /sbin/mpathconf

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>

[root@localhost ~]# mpathconf --user_friendly_names y --find_multipaths y --with_multipathd y --with_chkconfig y

[root@localhost ~]# mpathconf
multipath is enabled
find_multipaths is enabled
user_friendly_names is enabled
dm_multipath module is not loaded
multipathd is chkconfiged off

[root@localhost ~]# service multipathd start
Starting multipathd daemon: [ OK ]
[root@localhost ~]# mpathconf
multipath is enabled
find_multipaths is enabled
user_friendly_names is enabled
dm_multipath module is loaded
multipathd is chkconfiged off

[root@localhost ~]# ll /dev/mapper/mpatha
lrwxrwxrwx. 1 root root 7 Aug 27 14:54 /dev/mapper/mpatha -> …/dm-6

[root@localhost ~]# multipath -ll
mpatha (1IET 00010001) dm-6 IET,VIRTUAL-DISK
size=2.0G features=‘0’ hwhandler=‘0’ wp=rw
|-± policy=‘round-robin 0’ prio=1 status=active
| - 2:0:0:1 sdb 8:16 active ready running-± policy=‘round-robin 0’ prio=1 status=enabled
`- 3:0:0:1 sdc 8:32 active ready running

[root@localhost ~]# dmsetup table
mpatha: 0 4194304 multipath 0 0 2 1 round-robin 0 1 1 8:16 1 round-robin 0 1 1 8:32 1

测试:
ISCSI Storage 关闭 eth1
[root@localhost ~]# ifdown eth1

Server 查看状态
[root@localhost ~]# multipath -l
mpath0 (1IET_00010001) dm-2 iscsi,storage1
[size=20G][features=0][hwhandler=0][rw]
_ round-robin 0 [prio=0][active]
_ 3:0:0:1 sdb 8:16 [failed][undef]
_ 4:0:0:1 sdc 8:32 [active][undef]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值