1.在server1上添加一个网卡eth2,并做如下设置:
1 2 3 4 5 6 7
|
[[email protected] ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth2 DEVICE="eth2" BOOTPROTO="none" ONBOOT="yes" IPADDR=172.25.9.11 PREFIX=24 GATEWAY=172.25.9.250
|
2.安装iscsi服务端,并共享设备/dev/vda
1 2 3
|
[root@server1 tgt]# pwd /etc/tgt [root@server1 tgt]# vim targets.conf
|
在文件中添加:
1 2 3
|
<target iqn.2015-2.com.example:iser> backing-store /dev/vda </target>
|
1
|
[root@server1 tgt]# tgt-admin -s ##查看是否共享成功
|
3.安装iscsi客户端
1 2 3 4 5 6
|
[[email protected] ~]# yum install iscsi-initiator-utils [[email protected] ~]# iscsiadm -m discovery -t st -p 172.25.9.1 Starting iscsid: [ OK ] 172.25.9.1:3260,1 iqn.2015-2.com.example:iser [[email protected] ~]# iscsiadm -m discovery -t st -p 172.25.9.11 172.25.9.11:3260,1 iqn.2015-2.com.example:iser
|
其中一个链路断了,另外一个链路可以顶上
1 2 3 4 5 6 7
|
[[email protected] ~]# iscsiadm -m node -l -p 172.25.9.1 Logging in to [iface: default, target: iqn.2015-2.com.example:iser, portal: 172.25.9.1,3260] (multiple) Login to [iface: default, target: iqn.2015-2.com.example:iser, portal: 172.25.9.1,3260] successful.
[[email protected] ~]# iscsiadm -m node -l -p 172.25.9.11 Logging in to [iface: default, target: iqn.2015-2.com.example:iser, portal: 172.25.9.11,3260] (multiple) Login to [iface: default, target: iqn.2015-2.com.example:iser, portal: 172.25.9.11,3260] successful.
|
1 2 3 4 5 6 7 8 9 10 11
|
[[email protected] ~]# cat /proc/partitions major minor #blocks name
8 0 8388608 sda 8 1 512000 sda1 8 2 7875584 sda2 252 0 4194304 vda 253 0 7036928 dm-0 253 1 835584 dm-1 8 16 4194304 sdb 8 32 4194304 sdc
|
你会发现,serevr2出现了sdb,sdc
近期评论