1:[root@node2 ~]# yum install iscsi-initiator-utils*
[root@node2 ~]# vim /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.2012-05.com.a.node2
[root@node2 ~]# service iscsi start
iscsid is stopped
Turning off network shutdown. Starting iSCSI daemon: [ OK ]
[ OK ]
Setting up iSCSI targets: iscsiadm: No records found!
[ OK ]
[root@node2 ~]# chkconfig iscsi on
[root@node2 ~]# iscsiadm --mode discovery --type sendtargets --portal 192.168.2.100 发现存储设备
192.168.2.100:3260,1 iqn.2012-05.com.a.target
[root@node2 ~]# iscsiadm --mode node --targetname iqn.2012-05.com.a.target --portal 192.168.2.100:3260 --login 登录存储设备
Logging in to [iface: default, target: iqn.2012-05.com.a.target, portal: 192.168.2.100,3260]
Login to [iface: default, target: iqn.2012-05.com.a.target, portal: 192.168.2.100,3260]: successful 登录成功
在target查看,发现node1和node2节点都已经登录上了我们的共享的块设备
[root@target ~]# tgtadm --lld iscsi --op show --mode target
Target 1: iqn.2012-05.com.a.target
System information:
Driver: iscsi
State: ready
I_T nexus information:
I_T nexus: 2
Initiator: iqn.2012-05.com.a.node1
Connection: 0
IP Address: 192.168.2.10
I_T nexus: 3
Initiator: iqn.2012-05.com.a.node2
Connection: 0
IP Address: 192.168.2.20
LUN information:
LUN: 0
Type: controller
SCSI ID: deadbeaf1:0
SCSI SN: beaf10
Size: 0 MB
Online: Yes
Removable media: No
Backing store: No backing store
LUN: 1
Type: disk
SCSI ID: deadbeaf1:1
SCSI SN: beaf11
Size: 1012 MB
Online: Yes
Removable media: No
Backing store: /dev/sdb1
Account information:
ACL information:
192.168.2.0/24