Linux ISCSI target/initiator Configuration

Source: Internet
Author: User
Tags session id dmesg

Linux ISCSI target Configuration whole process
One: Install ISCSI target for Linux
1, operating system:
[Email protected] ~]# cat/etc/issue
Enterprise Linux Enterprise Linux as Release 4 (October Update 4)
Kernel R on a m

[Email protected]/]# uname-a
Linux rac2.mycorpdomain.com 2.6.9-42.0.0.0.1.elsmp #1 SMP Sun Oct 14:02:40 PDT 2006 i686 i686 i386 gnu/linux
[Email protected]/]#

2, unzip the file
[Email protected] ~]# TAR-XZVF iscsitarget-0.4.15.tar.gz

3, compiling
[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 '
'/usr/share/doc/iscsitarget/readme ', ' README '
' Readme.vmware ', '/usr/share/doc/iscsitarget/readme.vmware '
[Email protected] iscsitarget-0.4.15]#


4, configuration
[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, start the service
[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, view verification
Dmesg

ISCSI Enterprise Target software-version 0.4.15
iotype_init Register FileIO
Iotype_init Blockio
Iotype_init Register Nullio
Parse_fileio_params (+) unknown/dev/sdb1 FileIO
Fileio_attach ( 268) -22
[[email protected] init.d]#

[Email protected] init.d]# tailf/var/log/messages
OCT 09:22:13 RAC2 ntpd[2995]: Kernel time sync disabled 0041
OCT 09:23:16 RAC2 ntpd[2995]: Kernel time sync enabled 0001
OCT 09:24:15 rac2 kernel:iscsi Enterprise Target software-version 0.4.15
OCT rac2 kernel:iotype_init (09:24:15) Register FileIO
OCT rac2 kernel:iotype_init (09:24:15) Register Blockio
OCT rac2 kernel:iotype_init (09:24:15) Register Nullio
OCT 09:24:15 Rac2 iscsi-target:ietd startup succeeded
OCT 09:24:15 rac2 kernel:parse_fileio_params unknown/dev/sdb1 FileIO
OCT 09:24:15 Rac2 Kernel:fileio_attach (268)-22
OCT 09:24:15 rac2 ietd:can ' t create a logical unit 1 0/DEV/SDB1 FileIO


7. Modify the configuration file to:
Target Iqn.2001-04.com.example:storage.disk2.sys1.idisk
Lun 4 Path=/dev/sdb1,type=fileio (Note T-letter capitalization)
Alias SDB

And then when you start the DMESG information is:
ISCSI Enterprise Target software-version 0.4.15
Iotype_init (FileIO) register
Iotype_init (Blockio) register
Iotype_init (Nullio) register

Log information:
OCT 16:31:35 test kernel:iscsi Enterprise Target software-version 0.4.15
OCT 16:31:35 Test Kernel:iotype_init Register FileIO
OCT 16:31:35 Test Kernel:iotype_init Register Blockio
OCT 16:31:35 Test Kernel:iotype_init Register Nullio



Two, Red Hat Linux ISCSI Initiator configuration
1, operating system:
[Email protected] ~]# cat/etc/issue
Enterprise Linux Enterprise Linux as Release 4 (October Update 4)
Kernel R on a m

[Email protected] ~]#

2, install 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. Modify the/etc/iscsid.conf file

Vi/etc/iscsid.conf

Modify the following 3 items:
Discoveryaddress=<ip address>
This needs to is 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-all discovery sessions is kept open.

4, start the service
[[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. Set up iSCSI Services
[[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. View SCSI Devices
[Email protected] etc]# Iscsi-ls
*******************************************************************************
Sfnet ISCSI Driver Version ... 4:0.1.11-3 (02-may-2006)
*******************************************************************************
[Email protected] etc]#

7, under normal circumstances should be:
[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 00:46:13 CST 2007
SESSION Id:isid 00023d000001 Tsih 200
*******************************************************************************
[Email protected] ~]#


8, the newly added equipment can be seen through the DMESG.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.