暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Linux上iSCSI配置

原创 eygle 2005-11-10
589
1.修改配置文件

修改/etc/iscsi.conf文件,增加以下配置(还有很多参数可以配置):



DiscoveryAddress=172.16.35.228
TargetName=iqn.1987-05.com.cisco:test2


2.启动iscsi



[root@test2 ~]# /etc/init.d/iscsi start
Checking iscsi config: [ OK ]
Loading iscsi driver: [ OK ]
Starting iscsid: [ OK ]


3.观察日志


Nov 8 15:25:33 test2 kernel: iscsi-sfnet: Loading iscsi_sfnet version 4:0.1.11-1
Nov 8 15:25:33 test2 kernel: iscsi-sfnet: Control device major number 254
Nov 8 15:25:33 test2 iscsi: Loading iscsi driver: succeeded
Nov 8 15:25:38 test2 iscsid[9664]: version 4:0.1.11 variant (12-Jan-2005)
Nov 8 15:25:38 test2 iscsi: iscsid startup succeeded
Nov 8 15:25:38 test2 iscsid[9668]: cannot make connection to 172.16.35.228:3260: Connection refused
Nov 8 15:25:38 test2 iscsid[9668]: Connection to Discovery Address 172.16.35.228 failed
Nov 8 15:25:39 test2 iscsid[9668]: cannot make connection to 172.16.35.228:3260: Connection refused
Nov 8 15:25:39 test2 iscsid[9668]: Connection to Discovery Address 172.16.35.228 failed
Nov 8 15:25:40 test2 iscsid[9668]: cannot make connection to 172.16.35.228:3260: Connection refused


如果你看到如上错误,那么你需要启用NetApp的iSCSI支持并创建相应卷组。

4.配置好Netapp

此时日志显示:


Nov 8 15:43:38 test2 kernel: iscsi-sfnet:host0: Session established
Nov 8 15:43:38 test2 kernel: scsi0 : SFNet iSCSI driver
Nov 8 15:43:38 test2 kernel: scsi: unknown device type 31
Nov 8 15:43:38 test2 kernel: Vendor: NETAPP Model: LUN Rev: 0.2
Nov 8 15:43:38 test2 kernel: Type: Unknown ANSI SCSI revision: 04


这显示主机已经发现了iscsi设备

在dmesg输出中也可以看到这个信息


SCSI subsystem initialized
iscsi-sfnet: Loading iscsi_sfnet version 4:0.1.11-1
iscsi-sfnet: Control device major number 254
iscsi-sfnet: Loading iscsi_sfnet version 4:0.1.11-1
iscsi-sfnet: Control device major number 254
iscsi-sfnet:host0: Session established
scsi0 : SFNet iSCSI driver
scsi: unknown device type 31
Vendor: NETAPP Model: LUN Rev: 0.2
Type: Unknown ANSI SCSI revision: 04


5.查看设备信息

此时可以使用iscsi-ls等命令查看相关Lun信息


[root@test2 etc]# iscsi-ls
*******************************************************************************
SFNet iSCSI Driver Version ...4:0.1.11(12-Jan-2005)
*******************************************************************************
TARGET NAME : iqn.1992-08.com.netapp:sn.84192734
TARGET ALIAS :
HOST ID : 0
BUS ID : 0
TARGET ID : 0
TARGET ADDRESS : 172.16.35.228:3260,1
SESSION STATUS : ESTABLISHED AT Tue Nov 8 15:43:38 CST 2005
SESSION ID : ISID 00023d000001 TSIH 101
*******************************************************************************

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论