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

相关文章

Zookeeper安装和配置说明

一、Zookeeper的搭建方式 Zookeeper安装方式有三种,单机模式和集群模式以及伪集群模式。 ■ 单机模式:Zookeeper只运行在一台服务器上,适合测试环境; ■ 伪集群模式:就是在一台物理机上运行多个Zookeeper 实例; ■ 集群模式:Zookeeper运行于一个集群上,适合生产环境,这个计算机集群被称为一个“集合体”(ensemble) Zookeeper通过复制来实现

CentOS7安装配置mysql5.7 tar免安装版

一、CentOS7.4系统自带mariadb # 查看系统自带的Mariadb[root@localhost~]# rpm -qa|grep mariadbmariadb-libs-5.5.44-2.el7.centos.x86_64# 卸载系统自带的Mariadb[root@localhost ~]# rpm -e --nodeps mariadb-libs-5.5.44-2.el7

Centos7安装Mongodb4

1、下载源码包 curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-4.2.1.tgz 2、解压 放到 /usr/local/ 目录下 tar -zxvf mongodb-linux-x86_64-rhel70-4.2.1.tgzmv mongodb-linux-x86_64-rhel70-4.2.1/

linux-基础知识3

打包和压缩 zip 安装zip软件包 yum -y install zip unzip 压缩打包命令: zip -q -r -d -u 压缩包文件名 目录和文件名列表 -q:不显示命令执行过程-r:递归处理,打包各级子目录和文件-u:把文件增加/替换到压缩包中-d:从压缩包中删除指定的文件 解压:unzip 压缩包名 打包文件 把压缩包从服务器下载到本地 把压缩包上传到服务器(zip

Centos7安装JDK1.8保姆版

工欲善其事,必先利其器。这句话同样适用于学习Java编程。在开始Java的学习旅程之前,我们必须首先配置好适合的开发环境。 通过事先准备好这些工具和配置,我们可以避免在学习过程中遇到因环境问题导致的代码异常或错误。一个稳定、高效的开发环境能够让我们更加专注于代码的学习和编写,提升学习效率,减少不必要的困扰和挫折感。因此,在学习Java之初,投入一些时间和精力来配置好开发环境是非常值得的。这将为我

Linux 网络编程 --- 应用层

一、自定义协议和序列化反序列化 代码: 序列化反序列化实现网络版本计算器 二、HTTP协议 1、谈两个简单的预备知识 https://www.baidu.com/ --- 域名 --- 域名解析 --- IP地址 http的端口号为80端口,https的端口号为443 url为统一资源定位符。CSDNhttps://mp.csdn.net/mp_blog/creation/editor

【Python编程】Linux创建虚拟环境并配置与notebook相连接

1.创建 使用 venv 创建虚拟环境。例如,在当前目录下创建一个名为 myenv 的虚拟环境: python3 -m venv myenv 2.激活 激活虚拟环境使其成为当前终端会话的活动环境。运行: source myenv/bin/activate 3.与notebook连接 在虚拟环境中,使用 pip 安装 Jupyter 和 ipykernel: pip instal

安装nodejs环境

本文介绍了如何通过nvm(NodeVersionManager)安装和管理Node.js及npm的不同版本,包括下载安装脚本、检查版本并安装特定版本的方法。 1、安装nvm curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash 2、查看nvm版本 nvm --version 3、安装

Linux_kernel驱动开发11

一、改回nfs方式挂载根文件系统         在产品将要上线之前,需要制作不同类型格式的根文件系统         在产品研发阶段,我们还是需要使用nfs的方式挂载根文件系统         优点:可以直接在上位机中修改文件系统内容,延长EMMC的寿命         【1】重启上位机nfs服务         sudo service nfs-kernel-server resta