关于redhat上iscsi的安装:iSCSI target HowTo on Enterprise Linux (RHEL4)

2024-02-16 12:08

本文主要是介绍关于redhat上iscsi的安装:iSCSI target HowTo on Enterprise Linux (RHEL4),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

关于redhat上iscsi的安装:

iSCSI target HowTo on Enterprise Linux (RHEL4)

 


Table of contents [showhide] 
1 About

2 Install the Target

3 Configure the Target

4 Configure the Linux Client

5 Resources

6 Corrections and Better Ways
 
[edit]About
This is a brief guide to setup an iSCSI Target and Initiator on RHEL4 using the iSCSI Enterprise Target (IET) (http://iscsitarget.sourceforge.net) software for Linux and the stock RHEL4 Initiator. The motivation for this was to provide a iSCSI target for Red Hat Inc's, GFS (http://www.redhat.com/en_us/USA/home/solutions/gfs/) (manual (http://www.redhat.com/docs/manuals/csgfs/browse/rh-gfs-en/)). Make sure you check out the iscsi-target website and for more infromation on iSCSI in general look at this guide (http://www.cuddletech.com/articles/iscsi/index.html) from Ben Rockwood .

[edit]Install the Target
1. Install RHEL4, I used kickstart with just "@ base" for packages. Configure the system with two drives sda and sdb or create two logical volumes(lvm). The first disk is for the OS and the second for the iSCSI storage. Run up2date and install the latest kernel.

up2date kernel
2 Reboot the box to use the updated kernel and then install the kernel source files, the openssl development packages, the gcc compiler and rpm-build needed to build the iscsi target source .

up2date kernel-devel openssl-devel gcc rpm-build
3. Download the rpm source package from http://www.cryptoforge.net/iscsi/RPMS, maintained by Bastiaan Bakker. As of this writing use version 0.4.12 as 0.4.13 will fail with the updated kernel (2.6.9-22.0.2.EL when I did this). I used /usr/src/iscsitarget to download the rpm as this is a OS resource, you can put it were ever you want. A quick note, Unless your a developer don't be tempted to complie from pure source, rpm stops you from having to chase down files from a "make && make install". The Redhat Package Manager is just that, a package manager, use it :-).

a. As root, make the directory for the package.

mkdir /usr/src/iscsitarget
b. Change into the newly created directory.

cd /usr/src/iscsitarget
c. Download the iscsitarget source from cryptoforge.

wget http://www.cryptoforge.net/iscsi/RPMS/iscsitarget-0.4.12-6.src.rpm
or you can grab the src.rpm directly from here

wget http://www.digicola.com/developer/iscsitarget-0.4.12-6.src.rpm
d. create the rpms from the rpm.src file.

rpmbuild --rebuild iscsitarget-0.4.12-6.src.rpm
e. This will build the iscsitarget and iscsi-kernel rpms, install the rpms with the normal commands.

rpm -Uvh /usr/src/redhat/RPMS/i386/iscsitarget-0.4.12-6.i386.rpm /usr/src/redhat/RPMS/i386/iscsitarget-kernel-0.4.12-6_2.6.9_22.0.2.EL.i386.rpm
f. Add iscsi-target to chkconfig and enable it.

chkconfig --add iscsi-target
chkconfig --level 2345 iscsi-target on
or

chkconfig iscsi-target on
[edit]Configure the Target
1. The configuration file for the iscsi-target is ietd.conf located in /etc. The following is the ietd.conf file that I am using to share sdb as an iscsi disk.

# iscsi target configuration

Target iqn.2000-12.com.digicola:storage.lun1
        IncomingUser gfs secretsecret
        OutgoingUser
        Lun 0 Path=/dev/sdb,Type=fileio
        Alias iDISK0
        #MaxConnections  6
The iedt.conf file that I use is straight forward enough.

The IncomingUser and OutgoingUser at the begining of the file defines users allowed to query the iscsi session (If empty then everyone is allowed). Note: The iscsi spec states that the password is 12 characters, (from what I have read) the MS initiator requires it.
Targets definitions start with "Target" and the target name. The target name must be a globally unique name, the iSCSI standard defines the "iSCSI Qualified Name" as follows: iqn.yyyy-mm.<reversed domain name>[:identifier] "yyyy-mm" is the date at which the domain is valid and the identifier is freely selectable.
The target can also require authentication, this time I used the user gfs with the password of secretsecret for the incoming user (iscsi initiator).
The Type "fileio" is the default and can be used for disk, file or LVM.
MaxConnections, This is no longer required as it is an outdated option.
2. Start the iscsi-target deamon and check /var/log/messages for success.

service iscsi-target restart
[edit]Configure the Linux Client
1. Install the iscsi-initiator-utils with up2date

up2date iscsi-initiator-utils
2. This installs the iscsi initiator on to the linux client along with a man page and rc start scripts. The iscsi initiator is configured with the iscsi.conf file located in /etc. Below is the iscsi.conf file used for the target above.

# simple iscsi.conf

DiscoveryAddress=172.30.0.28
            OutgoingUserName=gfs
            OutgoingPassword=secretsecret
       LoginTimeout=15
       DiscoveryAddress=172.30.0.28
3. Start the iscsi initiator and cross your fingers

service iscsi start
4. Check that the disk is visiable under proc, if it's not look in /var/log/messages on both the client and the host system.

cat /proc/scsi/scsi
Below is the output from my /proc/scsi/scsi

[root@gfs1 init.d]# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: VMware,  Model: VMware Virtual S Rev: 1.0
  Type:   Direct-Access                    ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: IET      Model: VIRTUAL-DISK     Rev: 0
  Type:   Direct-Access                    ANSI SCSI revision: 04
5. Next run the iscsi-ls command

iscsi-ls
Here is the output from this example

*******************************************************************************
SFNet iSCSI Driver Version ...4:0.1.11(12-Jan-2005)
*******************************************************************************
TARGET NAME             : iqn.2000-12.com.digicola:storage.lun1
TARGET ALIAS            :
HOST ID                 : 1
BUS ID                  : 0
TARGET ID               : 0
TARGET ADDRESS          : 172.30.0.28:3260,1
SESSION STATUS          : ESTABLISHED AT Thu Feb  9 01:22:37 EST 2006
SESSION ID              : ISID 00023d000001 TSIH 100
*******************************************************************************
6. Voila! you should now have a new SCSI disc avaiable for use. Now you can use fdisk to partition the disk (fdisk /dev/sdb) and use mkfs to format the partition (which is out of the scope of this howto).

7. Finally set the iscsi service start automatically

chkconfig iscsi on
[edit]Resources
If you need more information, run into problems using this howto or want to go more indepth for iSCSI, here is a list of resources out on the web.

http://www.cuddletech.com/articles/iscsi/index.html
http://iscsitarget.sourceforge.net/
http://fedoranews.org/mediawiki/index.php/Going_Enterprise_-_setup_your_FC4_iSCSI_target_in_5_minutes

这篇关于关于redhat上iscsi的安装:iSCSI target HowTo on Enterprise Linux (RHEL4)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/714485

相关文章

linux打包解压命令方式

《linux打包解压命令方式》文章介绍了Linux系统中常用的打包和解压命令,包括tar和zip,使用tar命令可以创建和解压tar格式的归档文件,使用zip命令可以创建和解压zip格式的压缩文件,每... 目录Lijavascriptnux 打包和解压命令打包命令解压命令总结linux 打包和解压命令打

mac安装nvm(node.js)多版本管理实践步骤

《mac安装nvm(node.js)多版本管理实践步骤》:本文主要介绍mac安装nvm(node.js)多版本管理的相关资料,NVM是一个用于管理多个Node.js版本的命令行工具,它允许开发者在... 目录NVM功能简介MAC安装实践一、下载nvm二、安装nvm三、安装node.js总结NVM功能简介N

linux如何复制文件夹并重命名

《linux如何复制文件夹并重命名》在Linux系统中,复制文件夹并重命名可以通过使用“cp”和“mv”命令来实现,使用“cp-r”命令可以递归复制整个文件夹及其子文件夹和文件,而使用“mv”命令可以... 目录linux复制文件夹并重命名我们需要使用“cp”命令来复制文件夹我们还可以结合使用“mv”命令总

python安装whl包并解决依赖关系的实现

《python安装whl包并解决依赖关系的实现》本文主要介绍了python安装whl包并解决依赖关系的实现,文中通过图文示例介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面... 目录一、什么是whl文件?二、我们为什么需要使用whl文件来安装python库?三、我们应该去哪儿下

MySQL安装时initializing database失败的问题解决

《MySQL安装时initializingdatabase失败的问题解决》本文主要介绍了MySQL安装时initializingdatabase失败的问题解决,文中通过图文介绍的非常详细,对大家的学... 目录问题页面:解决方法:问题页面:解决方法:1.勾选红框中的选项:2.将下图红框中全部改为英

MySQL9.0默认路径安装下重置root密码

《MySQL9.0默认路径安装下重置root密码》本文主要介绍了MySQL9.0默认路径安装下重置root密码,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们... 目录问题描述环境描述解决方法正常模式下修改密码报错原因问题描述mysqlChina编程采用默认安装路径,

Linux使用cut进行文本提取的操作方法

《Linux使用cut进行文本提取的操作方法》Linux中的cut命令是一个命令行实用程序,用于从文件或标准输入中提取文本行的部分,本文给大家介绍了Linux使用cut进行文本提取的操作方法,文中有详... 目录简介基础语法常用选项范围选择示例用法-f:字段选择-d:分隔符-c:字符选择-b:字节选择--c

Python使用国内镜像加速pip安装的方法讲解

《Python使用国内镜像加速pip安装的方法讲解》在Python开发中,pip是一个非常重要的工具,用于安装和管理Python的第三方库,然而,在国内使用pip安装依赖时,往往会因为网络问题而导致速... 目录一、pip 工具简介1. 什么是 pip?2. 什么是 -i 参数?二、国内镜像源的选择三、如何

Linux使用nload监控网络流量的方法

《Linux使用nload监控网络流量的方法》Linux中的nload命令是一个用于实时监控网络流量的工具,它提供了传入和传出流量的可视化表示,帮助用户一目了然地了解网络活动,本文给大家介绍了Linu... 目录简介安装示例用法基础用法指定网络接口限制显示特定流量类型指定刷新率设置流量速率的显示单位监控多个

ElasticSearch+Kibana通过Docker部署到Linux服务器中操作方法

《ElasticSearch+Kibana通过Docker部署到Linux服务器中操作方法》本文介绍了Elasticsearch的基本概念,包括文档和字段、索引和映射,还详细描述了如何通过Docker... 目录1、ElasticSearch概念2、ElasticSearch、Kibana和IK分词器部署