redhat之ISCSI 使用详解

1、在RHEL5中安装如下的包:iscsi-initiator-utils-6.2.0.868-0.18.el5.i386.rpmperl-Config-General-2.40-1.el5.noarch.rpm(这个包在光盘的cluster storage目录下)

scsi-target-utils-0.0-5.20080917snap.el5.i386.rpm (这个包在光盘的cluster storage目录下)

2、通过linux中的命令生成IQN编号
#iscsi-iname
iqn.1994-05.com.redhat:e5ab84c569a8
3、编辑配置文件
#vi /etc/tgt/targets.conf
在文件中加入
<target iqn.1994-05.com.redhat:e5ab84c569a8>
backing-store  /dev/sdb
</target>
4、启动服务
service tgtd start
chkconfig tgtd on 
5、查看配置信息
# tgtadm --lld iscsi --op show --mode target


Target 1: iqn.1994-05.com.redhat:e5ab84c569a8
System information:
Driver: iscsi
State: ready
I_T nexus information:
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: 1000205 MB
Online: Yes
Removable media: No
Backing store: /dev/hdb
LUN: 2
Type: disk
SCSI ID: deadbeaf1:2
SCSI SN: beaf12
Size: 1000205 MB
Online: Yes
Removable media: No
Backing store: /dev/hdc
Account information:
ACL information:
ALL

fdi

客户端

root@localhost Server]# rpm -qa |grep iscsi-initiator-utils-6.2.0.871-0.10.el5.i386.rpm
已经安装了,所有就不用在安装!!!
2、使用iSCSI存储  两个节点都要做这个操作。
客户端要打开服务
/etc/init.d/iscsid start
# rm -rf /var/lib/iscsi/nodes/*
# rm -rf /var/lib/iscsi/send_targets/*
# iscsiadm -m discovery -t st -p 192.168.2.10 (发现)
192.168.2.10:3260,1 iqn.1994-05.com.redhat:1fad858d2494
# iscsiadm -m node -T iqn.1994-05.com.redhat:1fad858d2494 -p 192.168.2.10 -l (登录)
 在RHEL5系统中, 确保如下服务开启:iscsid network iscsi netfs
 3 在RAC1 RAC2上使用fdisk �Cl 会看到相同共享磁盘sdb 
Disk /dev/sdb: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes


你可能感兴趣的:(redhat,iSCSI,iscsi使用)