关于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

相关文章

python管理工具之conda安装部署及使用详解

《python管理工具之conda安装部署及使用详解》这篇文章详细介绍了如何安装和使用conda来管理Python环境,它涵盖了从安装部署、镜像源配置到具体的conda使用方法,包括创建、激活、安装包... 目录pytpshheraerUhon管理工具:conda部署+使用一、安装部署1、 下载2、 安装3

Linux使用fdisk进行磁盘的相关操作

《Linux使用fdisk进行磁盘的相关操作》fdisk命令是Linux中用于管理磁盘分区的强大文本实用程序,这篇文章主要为大家详细介绍了如何使用fdisk进行磁盘的相关操作,需要的可以了解下... 目录简介基本语法示例用法列出所有分区查看指定磁盘的区分管理指定的磁盘进入交互式模式创建一个新的分区删除一个存

Linux使用dd命令来复制和转换数据的操作方法

《Linux使用dd命令来复制和转换数据的操作方法》Linux中的dd命令是一个功能强大的数据复制和转换实用程序,它以较低级别运行,通常用于创建可启动的USB驱动器、克隆磁盘和生成随机数据等任务,本文... 目录简介功能和能力语法常用选项示例用法基础用法创建可启动www.chinasem.cn的 USB 驱动

高效管理你的Linux系统: Debian操作系统常用命令指南

《高效管理你的Linux系统:Debian操作系统常用命令指南》在Debian操作系统中,了解和掌握常用命令对于提高工作效率和系统管理至关重要,本文将详细介绍Debian的常用命令,帮助读者更好地使... Debian是一个流行的linux发行版,它以其稳定性、强大的软件包管理和丰富的社区资源而闻名。在使用

龙蜥操作系统Anolis OS-23.x安装配置图解教程(保姆级)

《龙蜥操作系统AnolisOS-23.x安装配置图解教程(保姆级)》:本文主要介绍了安装和配置AnolisOS23.2系统,包括分区、软件选择、设置root密码、网络配置、主机名设置和禁用SELinux的步骤,详细内容请阅读本文,希望能对你有所帮助... ‌AnolisOS‌是由阿里云推出的开源操作系统,旨

Ubuntu系统怎么安装Warp? 新一代AI 终端神器安装使用方法

《Ubuntu系统怎么安装Warp?新一代AI终端神器安装使用方法》Warp是一款使用Rust开发的现代化AI终端工具,该怎么再Ubuntu系统中安装使用呢?下面我们就来看看详细教程... Warp Terminal 是一款使用 Rust 开发的现代化「AI 终端」工具。最初它只支持 MACOS,但在 20

mysql-8.0.30压缩包版安装和配置MySQL环境过程

《mysql-8.0.30压缩包版安装和配置MySQL环境过程》该文章介绍了如何在Windows系统中下载、安装和配置MySQL数据库,包括下载地址、解压文件、创建和配置my.ini文件、设置环境变量... 目录压缩包安装配置下载配置环境变量下载和初始化总结压缩包安装配置下载下载地址:https://d

Linux Mint Xia 22.1重磅发布: 重要更新一览

《LinuxMintXia22.1重磅发布:重要更新一览》Beta版LinuxMint“Xia”22.1发布,新版本基于Ubuntu24.04,内核版本为Linux6.8,这... linux Mint 22.1「Xia」正式发布啦!这次更新带来了诸多优化和改进,进一步巩固了 Mint 在 Linux 桌面

LinuxMint怎么安装? Linux Mint22下载安装图文教程

《LinuxMint怎么安装?LinuxMint22下载安装图文教程》LinuxMint22发布以后,有很多新功能,很多朋友想要下载并安装,该怎么操作呢?下面我们就来看看详细安装指南... linux Mint 是一款基于 Ubuntu 的流行发行版,凭借其现代、精致、易于使用的特性,深受小伙伴们所喜爱。对

什么是 Linux Mint? 适合初学者体验的桌面操作系统

《什么是LinuxMint?适合初学者体验的桌面操作系统》今天带你全面了解LinuxMint,包括它的历史、功能、版本以及独特亮点,话不多说,马上开始吧... linux Mint 是一款基于 Ubuntu 和 Debian 的知名发行版,它的用户体验非常友好,深受广大 Linux 爱好者和日常用户的青睐,