




已阅读5页,还剩10页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Linux Redhat WS4.2&ES4.2操作系统下软件Initiator的安装、配置和使用指导书内部公开Linux Redhat 操作系统下软件Initiator的安装、配置和使用指导书关键词:Linux Redhat、软件Initiator缩略语清单:版本号验证人更新时间更新说明1.02006-04-18初稿完成1 安装环境:1.1 应用系统信息1、 以下这些是成功的版本,注意:WS3.4只能与IX5000挂载,不能与IX1000挂载。OSKernel自带Initiatorinitiator版本iscsi服务Redhat AS3.6 2.4.21-37.EL是iscsi-initiator-utils-3.6.3-3成功Redhat ES3.6 2.4.21-37.EL是iscsi-initiator-utils-3.6.3-3成功Redhat ES4.2 2.6.9-22.EL否iscsi-initiator-utils-4.0.3.0-2 成功Redhat AS3.52.4.21-32.EL是iscsi-initiator-utils-3.6.2-7成功Redhat AS4.22.6.9-22.EL否iscsi-initiator-utils-4.0.3.0-2成功Redhat WS3.52.4.21-32.EL是iscsi-initiator-utils-3.6.2-7成功Redhat WS3.42.4.21-27.EL是iscsi-initiator-utils-3.6.2-4成功(IX5000可以挂载,IX1000不行)Redhat WS4.22.6.9-22.EL是iscsi-initiator-utils-4.0.3.0-2成功Redhat AS3.32.4.21-20.EL否iscsi-initiator-utils-3.6.3-3成功(主要测试的是IX1000)Redhat WS3.62.4.21-37.EL是iscsi-initiator-utils-3.6.3-3成功Redhat AS3.42.4.21-37.EL是iscsi-initiator-utils-3.6.3-3成功Redhat 9 2.4.208smpiscsi-initiator-utils-3.6.2-72、以下是不成功的版本Redhat AS4.0 2.6.9-5.ELRedhat ES3.22.4.21-15.ELRedhat ES4.12.6.9-11.ELRedhat WS4.1 2.6.9-11.ELRedhat AS4.12.6.9-11.EL对于没有自动安装 initiator 的版本,如果在操作系统安装盘上的没有找到initiator ,参见附件 linux-initiator.rar ,里面包含了需要的 rpm 包。2 Initiator安装过程2.1 软件安装步骤1. WS4.2在安装操作系统的时候,系统自动安装initiator;AS4.2和ES4.2没有自动安装,在安装盘的CD4上,有initiator的安装文件。关于各个版本initiator安装情况,详见附件。2. 以root用户登录系统,拷贝Initiator软件到到/tmp目录下。.3. 为谨慎起见,建议在安装Initiator之前备份系统。(这一步通常可以跳过)4. 安装软件包:rpm -ivh iscsi-initiator-utils-4.0.3.0-2.i386.rpm再使用面的命令查看是否安装成功:# rpm -qa | grep iscsi如果显示以下信息,则说明安装成功:iscsi-initiator-utils-4.0.3.0-25. 安装完毕后,通过ifconfig命令,确保Linux服务器的IP与存储设备业务口IP在同一网段。2.2 软件卸载步骤1、以root用户登录。2、执行以下命令:rpm -e iscsi-initiator-utils-4.0.3.0-2说明:1、在卸载软件前,请确保umount所有已经挂载的IP SAN资源,并在fstab文件中删除自动mount IP SAN资源的配置行。2.3 软件配置过程1、以root用户登录。2、配置initiator名字在 /etc/initiatorname.iscsi 文件中设置 InitiatorName: InitiatorName=xxxxx注意:InitiatorName必须注意大小写,同时,必须顶格写。3、在/etc/iscsi.conf中添加业务口IP地址,如,DiscoveryAddress=192.168.10.200:3260注意:注意大小写,且必须顶格写如果采用CHAP认证,需要在下面加入名字和密码DiscoveryAddress=192.168.10.200:3260 OutgoingUsername=xxxxxxx OutgoingPassword=xxxxxxx注意:OutgoingUsername和OutgoingPassword先空两格,然后再写。4、如果名字、CHAP认证无误,可以使用 iscsi-ls l 命令来查看连接上的target,也可以使用fdisk l 来查看系统所连接的磁盘设备。5、使用fdisk devname对所连接的磁盘设备分区,其中devname可以由fdisk l命令得知。如,fdisk /dev/sda,指定/dev/sda为一个分区/dev/sda1,在执行的过程中有详细的帮助。6、在分区上创建文件系统使用 mkfs t fstype pastitionname 在刚刚建立的分区上创建文件系统,其中pastitionname表示分区的名字,fstype表示文件系统的类型,如: mkfs t ext2 /dev/sda17、挂载分区使用mount pastitionname dir命令挂载分区pastitionname到特定的节点dir,如: mount /dev/sda1 /mnt/t02.4 安装过程注意事项说明Linux有一个特性,对某个分区mount、umount很多次后,系统会对该分区进行检测,这就会导致硬盘反映速度很慢,非常影响业务,所以最好去掉这个动作。采用tune2fs命令: tune2fs /dev/sda1 c -1 i 0解释一下:1、 首先用 tune2fs -l /dev/sda l 查看该分区的信息:rooth3c root# tune2fs -l /dev/sda1tune2fs 1.32 (09-Nov-2002)Filesystem volume name: Last mounted on: Filesystem UUID: 1f5b8a37-50bf-4049-8caf-e6c6968b073fFilesystem magic number: 0xEF53Filesystem revision #: 1 (dynamic)Filesystem features: filetype sparse_superDefault mount options: (none)Filesystem state: not cleanErrors behavior: ContinueFilesystem OS type: LinuxInode count: 655360Block count: 1310460Reserved block count: 65523Free blocks: 1289878Free inodes: 655348First block: 0Block size: 4096Fragment size: 4096Blocks per group: 32768Fragments per group: 32768Inodes per group: 16384Inode blocks per group: 512Filesystem created: Mon Apr 10 13:57:51 2006Last mount time: Mon Apr 10 14:01:04 2006Last write time: Tue Apr 11 11:51:38 2006Mount count: 3Maximum mount count: -1Last checked: Mon Apr 10 13:57:51 2006Check interval: 0 ()Reserved blocks uid: 0 (user root)Reserved blocks gid: 0 (group root)First inode: 11Inode size: 128红色的地方注明了,这个已经修改过。当Mount count达到Maximum mount count的时候,系统就会检查。检查的间隔时间也规定了:Check interval2、 用 tune2fs -help查看: rooth3c root# tune2fs -helptune2fs 1.32 (09-Nov-2002)tune2fs: invalid option - -Usage: tune2fs -c max-mounts-count -e errors-behavior -g group -i intervald|m|w -j -J journal-options -l -s sparse-flag -m reserved-blocks-percent -o mount-options,. -r reserved-blocks-count -u user -C mount-count -L volume-label -M last-mounted-dir -O feature,. -T last-check-time -U UUID device 可以看出-i和-c就可以修改上面的参数,于是有了上面的命令。3 自动挂载脚本1、在2.6内核自动挂载脚本,需要修改一些代码。2、在 /sbin 目录下,查看是否存在 iscsi-mountall 和 iscsi-umountalll 执行文件,如果不存在,内容见下面: iscsi-mountall#! /bin/sh# Mount iSCSI devices listed in /etc/fstabBASEDIR=/PATH=/sbin:/bin:/usr/sbin:/usr/bin:$BASEDIR/sbin:$BASEDIR/bin:$PATHFSTAB=/etc/fstab.iscsiNUM_RETRIES=10SLEEP_INTERVAL=1# only show completion bar if stdout is a ttyif -t 1 ; then FSCK_OPTS=-C -a -Telse FSCK_OPTS=-a -Tfi if ! -f $FSTAB ; then exit 1fi;try_fsck() local device=$1 retries=$NUM_RETRIES sleep_interval=$SLEEP_INTERVALfstype=$2 while $retries -gt 0 ; do fsck -t $fstype $FSCK_OPTS $device /dev/null err=$? if $err -le 1 ; then # fsck succeeded return 0 elif $err -eq 8 ; then # assume device not yet available sleep $sleep_interval retries=$($retries - 1) echo * device not yet available, $retries retries remaining elif $err -ge 2 ; then # fatal error echo * automated fsck on $device failed echo * repair manually with fsck $device return 1 fi done return 1try_mount() local dev=$1 local mountp=$2 local fstype=$3 local options=$4 # # First check to see if the device entry in /etc/fstab.iscsi # matches anything in the mount output. If it does, the # LUN is already mounted, and we dont need to fsck again. # for device in mount |grep $dev|awk print $1;do if $dev = $device ;then return fi done # # The user could have specified a /udev/iscsi. link # in the /etc/fstab.iscsi file. If this is the case, # the output from the mount command may not match # (it may contain the actual device, whereas the user # specified the /udev/iscsi. link). Thus, if its # a symlink in the /etc/fstab.iscsi file, we need to # resolve the link and do an additional check. # if -L $dev ; then lnname=ls -l $dev | cut -d -f 2 | cut -d -f 2 dev=$lnname fi for device in mount |grep $dev|awk print $1;do if $dev = $device ;then return fi done if try_fsck $dev $fstype ; thenmount -t $fstype -o $options $dev $mountp fi while read dev mountp fstype options dummy1 dummy2do case $dev in #*) continue ; # ignore comments ) continue ; # ignore empty lines esac if echo $options | grep -v -q noauto ; thentry_mount $dev $mountp $fstype $options & fidone &2; exit 2; *) echo $USAGE 1&2; exit 2; esacdoneshift expr $OPTIND - 1is_iscsi() # check for iSCSI devices if iscsi-device $dev /dev/null 2&1; thenreturn 0 fi if -e $FSTAB ; thenlocal dev mountp etcwhile read dev mountp etcdo case $dev in #*) continue ; # ignore comments ) continue ; # ignore empty lines esac if $mountp = $2 ; then return 0 fidone /dev/null 2&1; then echo Waiting for users of $mountp to terminate sleep 5fi fi if $kill ; then # SIGKILL fs usersif fuser -k -m $mountp /dev/null 2&1; then echo Waiting for users of $mountp to exit sleep 2fi fi umount -r $mountpfi done,同时,采用chmod 777 iscsi_mountall/iscsi-umountall 让他们可执行。3、采用UUID的方式挂载卷:(1) 采用 tune2fs l pastitionname或者是devlable printed d pastionname得到分区的文件系统的UUID,如:tune2fs l /dev/sda1(2) 利用UUID 挂载分区,命令:mount U UUID dir ,如:mount -U 5120ebb2-098d-4fce-bf15-2e20924a7e86 /mnt/1001-101(3) 修改 /etc/fstab.iscsi 文件(如果不存在,就新建),在结尾加入: UUID=1f5b8a37-50bf-4049-8caf-e6c6968b073f /mnt/a ext2 defaults 0 0其中,前三个参数依次是:UUID、分区名、文件类型,后面3个参数取默认值。注意:顶格写。4、重新启动iscsi服务使用命令 service iscsi restart 或者 /etc/init.d/iscsi restart 重新启动服务,然后观察挂载的卷是否可以自动挂载,并且里面的文件可以正常读写。如果不能正常读写,那么需要修改 /etc/init.d/iscsi 文件,对于2.6内核的版本,采用附件中 iscsi_2.6 文件,将其名字改为 iscsi;如果是2.4内核,则采用iscsi_2.4。注意把附件中文件的.doc后缀名去掉。在/etc/init.d/iscsi脚本里添加# if we have an iSCSI fstab, process it if -f /etc/fstab.iscsi ; then echo -n fsck/mount sleep 6 iscsi-mountall fi和 # unmount all filesystems on iSCSI devices echo -n umount iscsi-umountall -t -k echo -n sync sync sleep 3这两段语句。位置参看蓝色语句位置。如下:# Make sure the K*iscsi scripts get called if -d /var/lock/subsys ; then touch /var/lock/subsys/iscsi fi # if we have an iSCSI fstab, process it if -f /etc/fstab.iscsi ; then (在这个语句中,注意 的三个空格) echo -n fsck/mount sleep 6 iscsi-mountall fi echo ; stop) # if iSCSI network boot then exit. if iscsi_network_boot ; then echo Since it is an iSCSI network boot therefore, driver cannot be stopped/restarted exit 1 fi echo -n Stopping iSCSI: for hba in /proc/scsi/iscsi/* ; do echo connfailtimeout - - $CONNFAILTIMEOUT $hba echo diskcommandtimeout - - $DI
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年金融产品居间推广法律文件模板合同
- 2025年度拆迁安置房个人购房合同(含车位及绿化)
- 2025年文化产业园产业集聚与服务体系中的文化产业发展与区域文化产业发展战略报告
- 2025版智能门锁零部件定制采购合同规范文本
- 2025年石膏板原材料采购与质量保证合同
- 2025年国际贸易担保借款合同
- 2025年度船舶节能减排运输合作协议书
- 2025版婚内反家暴教育与法律支持服务协议
- 2025年防盗门工程预算编制及合同
- 2025电商企业年度客户关系管理与运营合同
- 房地产 -衢州市城市环境无障碍设计导则城市街区
- 一年级新生报名登记表
- 《体育游戏》课程标准
- 制程能力管理办法实用文档
- GB/T 451.3-2002纸和纸板厚度的测定
- GB/T 1303.2-2009电气用热固性树脂工业硬质层压板第2部分:试验方法
- 子痫前期子痫课件
- 部编版《县委书记的榜样-焦裕禄》课件1
- 汽车保养基础知识优秀课件
- 青少年运动员 运动损伤的预防 课件
- 2022年十部经典的三级片电影
评论
0/150
提交评论