linux iSCSI target配置全過程
linux iSCSI target配置全過程
一:Install iSCSI target for Linux
1,作業系統:
[root@rac2 ~]# cat /etc/issue
Enterprise Linux Enterprise Linux AS release 4 (October Update 4)
Kernel r on an m
[root@rac2 /]# 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
[root@rac2 /]#
2,解壓檔案
[root@rac2 ~]# tar -xzvf iscsitarget-0.4.15.tar.gz
3,編譯
[root@rac2 ~]# cd iscsitarget-0.4.15
[root@rac2 iscsitarget-0.4.15]# ls
ChangeLog COPYING doc etc include kernel Makefile patches README README.vmware usr
[root@rac2 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
。。。
[root@rac2 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'
[root@rac2 iscsitarget-0.4.15]#
4,配置
[root@rac2 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,啟動服務
[root@rac2 etc]# cd /etc/init.d
[root@rac2 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
[root@rac2 init.d]# /etc/init.d/iscsi-target start
Starting iSCSI target service: [ OK ]
[root@rac2 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
[root@rac2 init.d]#
[root@rac2 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
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
在這個地方我搞了好久,看大家的文章一直配置檔案都是可以如下配置的:
Target iqn.2001-04.com.example:storage.disk2.sys1.xyz
Lun 0 /dev/sdb1 fileio
Alias Test
但是我的一直不行,我原來是虛擬機器,然後重新安裝了redhat4u4,還是不行,後來有安裝了redhat5,還是不行.
中間我也試過用如下配置檔案:
User userid superpassword
Target iqn.2001-04.com.example:storage.disk2.sys1.xyz
Lun 0 Path=/dev/sdb1, type=fileio
Alias Test
可是還不行,最後發現type開頭字母我把它寫成小寫了.
二,Red Hat linux iSCSI initiator configuration
1,作業系統:
[root@rac1 ~]# cat /etc/issue
Enterprise Linux Enterprise Linux AS release 4 (October Update 4)
Kernel r on an m
[root@rac1 ~]#
2,安裝initiator
[root@rac1 ~]# 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%]
[root@rac1 ~]#
3,修改/etc/iscsid.conf 檔案
vi /etc/iscsid.conf
修改下面3項:
DiscoveryAddress=
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,啟動服務
[root@rac1 etc]# service iscsi start
Checking iscsi config: [ OK ]
Loading iscsi driver: [ OK ]
mknod: `/dev/iscsictl': File exists
Starting iscsid: [ OK ]
[root@rac1 etc]#
5,設定iscsi服務
[root@rac1 etc]# chkconfig --list iscsi
iscsi 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@rac1 etc]# chkconfig --add iscsi
[root@rac1 etc]# chkconfig --add iscsi
[root@rac1 etc]# chkconfig iscsi on
[root@rac1 etc]# chkconfig --list iscsi
iscsi 0:off 1:off 2:on 3:on 4:on 5:on 6:off
6,察看scsi裝置
[root@rac1 etc]# iscsi-ls
*******************************************************************************
SFNet iSCSI Driver Version ...4:0.1.11-3(02-May-2006)
*******************************************************************************
[root@rac1 etc]#
7, 正常情況下應該是:
[root@rac1 ~]# 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
*******************************************************************************
[root@rac1 ~]#
8,透過dmesg可以看到新增加的裝置。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/312079/viewspace-245786/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【ISCSI】-iSCSI Initiator與 Target 的安裝、配置與連線過程備忘
- Openfiler配置ISCSI Target及FC Target
- Linux iscsi target版本問題Linux
- Linux掛載ISCSI TARGET磁碟Linux
- Centos 7 Iscsi targetCentOS
- Install iSCSI target for Linux with kernel 2.6.14(zt)Linux
- Oracle10g RAC for Linux配置全過程(zt)OracleLinux
- Iscsi Target config lv
- linux iscsi配置網摘Linux
- TDP for SQL安裝配置全過程SQL
- solaris 10 網路配置全過程(轉)
- iscsi target(服務端)之/etc/ietd.conf配置小記服務端
- 關於redhat上iscsi的安裝:iSCSI target HowTo on Enterprise Linux (RHEL4)RedhatLinux
- Win10系統怎麼連線iscsi target_Win10連線iscsi target的方法Win10
- Linux-NFS——配置過程LinuxNFS
- linux iscsi initiator 安裝配置薦Linux
- Linux中,如何配置iSCSI儲存?Linux
- Debian Linux 上安裝配置 ISC DHCP 伺服器全過程Linux伺服器
- 在Linux中,如何配置iSCSI目標?Linux
- Linux TCP/IP協議棧全過程LinuxTCP協議
- Linux 核心處理中斷全過程解析Linux
- 詳解MeterSphere 配置外部Mysql5.7的全過程MySql
- Linux系統下自行編譯安裝MySQL及基礎配置全過程解析Linux編譯MySql
- linux redhat9.0/fedora4.0下adsl上網和配置全過程(轉)LinuxRedhat
- 叢集例項:配置ISCSI客戶端(LINUX)客戶端Linux
- Keepalived配置和測試過程for linuxLinux
- Java初學者:Jsp開發環境配置全過程JavaJS開發環境
- 設定autotrace全過程
- Hydro OJ搭建全過程
- Linux環境iSCSI儲存及多路徑功能配置Linux
- linux iscsi multipath多路徑及名稱持久化配置Linux持久化
- Redhat linux AS4 環境下iSCSI協議配置RedhatLinux協議
- 硬碟上安裝LINUX FC4全過程(轉)硬碟Linux
- Linux iSCSI 設定Linux
- MapReduce 執行全過程解析
- 頁面載入全過程
- DNS解析全過程及原理DNS
- centos 安裝MySQL全過程CentOSMySql