linux iSCSI target/initiator配置

linux iSCSI target配置全过程
一:Install iSCSI target for
Linux
1,操作系统:
[[email protected] ~]# cat /etc/issue
Enterprise Linux Enterprise
Linux AS release 4 (October Update 4)
Kernel r on an m

[[email protected] /]# uname -a
Linux rac2.mycorpdomain.com 2.6.9-42.0.0.0.1.ELsmp
#1 SMP Sun Oct 15 14:02:40 PDT 2006 i686 i686 i386 GNU/Linux
[[email protected] /]#

2,解压文件
[[email protected] ~]# tar -xzvf iscsitarget-0.4.15.tar.gz

3,编译
[[email protected] ~]# cd iscsitarget-0.4.15
[[email protected]
iscsitarget-0.4.15]# ls
ChangeLog COPYING doc etc include kernel Makefile
patches README README.vmware usr
[[email protected] iscsitarget-0.4.15]# make

Applying Patch compat-2.6.14-2.6.18.patch
patching file
kernel/iscsi.h
patching file kernel/digest.c
patching file
kernel/file-io.c
。。。

[[email protected] iscsitarget-0.4.15]# make install
install: creating directory
`/lib/modules/2.6.9-42.0.0.0.1.ELsmp/kernel/iscsi‘
`kernel/iscsi_trgt.ko‘
-> `/lib/modules/2.6.9-42.0.0.0.1.ELsmp/kernel/iscsi/iscsi_trgt.ko‘
depmod
-aq
`usr/ietd‘ -> `/usr/sbin/ietd‘
`usr/ietadm‘ ->
`/usr/sbin/ietadm‘
`etc/initd/initd.redhat‘ ->
`/etc/init.d/iscsi-target‘
`etc/ietd.conf‘ ->
`/etc/ietd.conf‘
`etc/initiators.allow‘ ->
`/etc/initiators.allow‘
`etc/initiators.deny‘ ->
`/etc/initiators.deny‘
`doc/manpages/ietadm.8‘ ->
`/usr/share/man/man8/ietadm.8‘
`doc/manpages/ietd.8‘ ->
`/usr/share/man/man8/ietd.8‘
`doc/manpages/ietd.conf.5‘ ->
`/usr/share/man/man5/ietd.conf.5‘
install: creating directory
`/usr/share/doc/iscsitarget‘
`ChangeLog‘ ->
`/usr/share/doc/iscsitarget/ChangeLog‘
`COPYING‘ ->
`/usr/share/doc/iscsitarget/COPYING‘
`README‘ ->
`/usr/share/doc/iscsitarget/README‘
`README.vmware‘ ->
`/usr/share/doc/iscsitarget/README.vmware‘
[[email protected] iscsitarget-0.4.15]#

4,配置
[[email protected] iscsitarget-0.4.15]# vi /etc/ietd.conf

User userid superpassword
Target
iqn.2001-04.com.example:storage.disk2.sys1.xyz
Lun 0 /dev/sdb1
fileio
Alias lun0

5,启动服务
[[email protected] etc]# cd /etc/init.d
[[email protected] init.d]#
ls
acpid crond halt killall netplugd openibd rhnsd snmpd xfs
anacron cups
hidd kudzu network oracleasm rpcgssd snmptrapd xinetd
apmd cups-config-daemon
ibmasm lm_sensors NetworkManager pand rpcidmapd spamassassin
ypbind
arptables_jf diskdump ipmi mdmonitor nfs pcmcia rpcsvcgssd sshd
yum
atd dund iptables mdmpd nfslock portmap rwhod syslog
auditd firstboot
irda messagebus nscd psacct saslauthd sysstat
autofs functions irqbalance
microcode_ctl ntpd rawdevices sendmail tog-pegasus
bluetooth gpm iscsi-target
netdump o2cb readahead single vncserver
cpuspeed haldaemon isdn netfs ocfs2
readahead_early smartd winbind
[[email protected] init.d]# /etc/init.d/iscsi-target
start
Starting iSCSI target service: [ OK ]
[[email protected] init.d]#

6,察看验证
dmesg

iSCSI Enterprise Target Software - version 0.4.15
iotype_init(92) register
fileio
iotype_init(92) register blockio
iotype_init(92) register
nullio
parse_fileio_params(230) Unknown /dev/sdb1
fileio
fileio_attach(268) -22
[[email protected] init.d]#

[[email protected] init.d]# tailf /var/log/messages
Oct 24 09:22:13 rac2
ntpd[2995]: kernel time sync disabled 0041
Oct 24 09:23:16 rac2 ntpd[2995]:
kernel time sync enabled 0001
Oct 24 09:24:15 rac2 kernel: iSCSI Enterprise
Target Software - version 0.4.15
Oct 24 09:24:15 rac2 kernel: iotype_init(92)
register fileio
Oct 24 09:24:15 rac2 kernel: iotype_init(92) register
blockio
Oct 24 09:24:15 rac2 kernel: iotype_init(92) register nullio
Oct
24 09:24:15 rac2 iscsi-target: ietd startup succeeded
Oct 24 09:24:15 rac2
kernel: parse_fileio_params(230) Unknown /dev/sdb1 fileio
Oct 24 09:24:15
rac2 kernel: fileio_attach(268) -22
Oct 24 09:24:15 rac2 ietd: Can‘t create a
logical unit 22 1 0 /dev/sdb1 fileio

7,修改配置文件为:
Target
iqn.2001-04.com.example:storage.disk2.sys1.idisk
Lun 4
Path=/dev/sdb1,Type=fileio(注意T字母大写)
Alias sdb

然后启动的时候dmesg信息为:
iSCSI Enterprise Target Software - version
0.4.15
iotype_init(92) register fileio
iotype_init(92) register
blockio
iotype_init(92) register nullio

日志信息:
Oct 25 16:31:35 test kernel: iSCSI Enterprise Target Software -
version 0.4.15
Oct 25 16:31:35 test kernel: iotype_init(92) register
fileio
Oct 25 16:31:35 test kernel: iotype_init(92) register blockio
Oct
25 16:31:35 test kernel: iotype_init(92) register nullio

二,Red Hat linux iSCSI initiator
configuration
1,操作系统:
[[email protected] ~]# cat /etc/issue
Enterprise Linux
Enterprise Linux AS release 4 (October Update 4)
Kernel r on an m

[[email protected] ~]#

2,安装initiator
[[email protected] ~]# rpm -ivh
iscsi-initiator-utils-4.0.3.0-4.i386.rpm
warning:
iscsi-initiator-utils-4.0.3.0-4.i386.rpm: V3 DSA signature: NOKEY, key ID
db42a60e
Preparing... ###########################################
[100%]
1:iscsi-initiator-utils ###########################################
[100%]
[[email protected] ~]#

3,修改/etc/iscsid.conf 文件

vi /etc/iscsid.conf

修改下面3项:
DiscoveryAddress=<IP Address>
This needs to be set to the
Group IP Address of your UIT Array.

SendAsyncText=yes
For the initiator to receive Vendor Specific async
events from the target.

Continuous=yes
To globally specify that all discovery sessions be kept
open.

4,启动服务
[[email protected] etc]# service iscsi start
Checking iscsi config: [ OK
]
Loading iscsi driver: [ OK ]
mknod: `/dev/iscsictl‘: File
exists
Starting iscsid: [ OK ]
[[email protected] etc]#

5,设置iscsi服务
[[email protected] etc]# chkconfig --list iscsi
iscsi 0:off 1:off
2:off 3:off 4:off 5:off 6:off
[[email protected] etc]# chkconfig --add
iscsi
[[email protected] etc]# chkconfig --add iscsi
[[email protected] etc]# chkconfig
iscsi on
[[email protected] etc]# chkconfig --list iscsi
iscsi 0:off 1:off 2:on
3:on 4:on 5:on 6:off

6,察看scsi设备
[[email protected] etc]#
iscsi-ls
*******************************************************************************
SFNet
iSCSI Driver Version
...4:0.1.11-3(02-May-2006)
*******************************************************************************
[[email protected]
etc]#

7, 正常情况下应该是:
[[email protected] ~]# iscsi-ls

*******************************************************************************
SFNet
iSCSI Driver Version
...4:0.1.11-3(02-May-2006)
*******************************************************************************
TARGET
NAME : iqn.2001-04.com.example:storage.disk2.sys1.idisk
TARGET ALIAS :

HOST ID : 6
BUS ID : 0
TARGET ID : 0
TARGET ADDRESS :
172.25.1.100:3260,1
SESSION STATUS : ESTABLISHED AT Thu Oct 25 00:46:13 CST
2007
SESSION ID : ISID 00023d000001 TSIH
200
*******************************************************************************
[[email protected]
~]#

8,通过dmesg可以看到新增加的设备。

时间: 2024-10-07 08:26:00

linux iSCSI target/initiator配置的相关文章

iSCSI之Target/Initiator配置

准备环境 Target:   node1 192.168.139.2 Initiator1:node2 192.168.139.4 Initiatos2:node4 192.168.139.8 Target:安装scsi-target-utils Initiatos:安装scsi-initiator-utils 有关iSCSI和SCSI的详细介绍请看 http://11107124.blog.51cto.com/11097124/1884637 创建一个分区用来做SCSI的存储盘,最好用整个磁盘

iscsi介绍及iscsi target配置

iSCSI 主要是透过 TCP/IP 的技术,将储存设备端透过 iSCSI target (iSCSI 目标) 功能,做成可以提供磁盘的服务器端,再透过 iSCSI initiator (iSCSI 初始化用户) 功能,做成能够挂载使用 iSCSI target 的客户端,如此便能透过 iSCSI 协议来进行磁盘的应用了. 也就是说,iSCSI 这个架构主要将储存装置与使用的主机分为两个部分,分别是: iSCSI target:就是储存设备端,存放磁盘或 RAID 的设备,目前也能够将 Linu

Linux tgtadm: Setup iSCSI Target ( SAN )

Linux target framework (tgt) aims to simplify various SCSI target driver (iSCSI, Fibre Channel, SRP, etc) creation and maintenance. The key goals are the clean integration into the scsi-mid layer and implementing a great portion of tgt in user space.

CentOS iSCSI客户端使用配置

配置步骤: 1.查看安装是否安装iSCSI驱动 rpm -qa|grep iscsi 2.查看yum安装源 yum list |grep iscsi 3.安装iscsi驱动 yum install iscsi-initiator-utils 4.配置客户端名称 vim /etc/iscsi/initiatorname.iscsi #initiatorname.iscsi InitiatorName=iqn.2012-10.net.cpd:san.initiator01 InitiatorAlia

centos 6.5环境利用iscsi搭建SAN网络存储服务及服务端target和客户端initiator配置详解

一.简介 iSCSI(internet SCSI)技术由IBM公司研究开发,是一个供硬件设备使用的.可以在IP协议的上层运行的SCSI指令集,这种指令集合可以实现在IP网络上运行SCSI协议,使其能够在诸如高速千兆以太网上进行路由选择.iSCSI技术是一种新储存技术,该技术是将现有SCSI接口与以太网络(Ethernet)技术结合,使服务器可与使用IP网络的储存装置互相交换资料. iSCSI是一种基于TCP/IP 的协议,用来建立和管理IP存储设备.主机和客户机等之间的相互连接,并创建存储区域网

iscsi initiator 配置

###iSCSI initiator 配置 1. Linux下iscsi initiator 安装: 在OracleLinux-R6-U4-Server-x86_64-dvd.iso中,找到匹配该系统的iscsi initiator版本iscsi-initiator-utils- 6.2.0.873-2.0.1.el6.x86_64.rpm: 通过rpm -ivh 安装 2. 启动iscsi服务 cd /etc/init.d ./iscsi start chkconfig iscsi on 3.

在Ubuntu 12.04上配置iSCSI Target服务

  今天自己按照网上搜来的教程自己在Ubuntu 12.04上配置了iSCSI Target服务,在这里简单地做个纪录.操作系统是全新安装的Ubuntu 12.04,配置一块500 GB的SATA笔记本硬盘.安装操作系统时将硬盘划分为两个分区,其中一个50 GB的分区(/dev/sda1)挂载为操作系统的根分区:另外一个450 GB的分区(/dev/sda2)作为提供存储服务的空间,暂时不挂载. 安装完操作系统之后,安装必要的软件: $ sudo apt-get install chkconfi

Linux ISCSI服务器搭建

Linux ISCSI服务器搭建 1. iscsi服务器简述 iSCSI技术是一种由IBM公司研究开发的,是一个供硬件设备使用的可以在IP协议的上层运行的SCSI指令集,这种指令集合可以实现在IP网络上运行SCSI协议,使其能够在诸如高速千兆以太网上进行路由选择.iSCSI技术是一种新储存技术,该技术是将现有SCSI接口与以太网络(Ethernet)技术结合,使服务器可与使用IP网络的储存装置互相交换资料. iSCSI:Internet 小型计算机系统接口 (iSCSI:Internet Sma

三种iSCSI target管理工具的比较

1. iSCSI简介 从协议层次的角度看,通常所说的SCSI通常是指一组包含块命令.控制器管理.系统命令和enclosure服务等内容的协议规范,对应于回话层:而其下的物理通道和链接方式就对应在数据链路层,SCSI命令可以通过串口.Fibre Channel.SAS.infiniband.Internet.USB.PCIE等进行传输.iSCSI就是一种把异地存储资源通过TCP/IP网络映射到本地逻辑存储设备的SCSI实现.不同于NFS向用户提供按文件为单位访问远程存储的方式,它向用户提供了以块方