linux下iscsi共享存储教程LinuxServer

印迹发布于:3月前 148

一、安装环境

1、系统:centos 5.4 x86

2、外部存储:linux下的iscsi

3、iscsi服务器配置

二、下载安装程序:

1、下载iSCSI Enterprise Target安装程序

(最新版下载地址http://sourceforge.net/projects/iscsitarget/files/iscsitarget/)

wget http://nchc.dl.sourceforge.net/sourceforge/iscsitarget/iscsitarget-1.4.20.2.tar.gz

2、解压缩

tar -zxvf iscsitarget-1.4.20.2.tar.gz
cd iscsitarget-1.4.20.2

3、编译、安装

make
make install

4、设置开机启动服务

chkconfig iscsi-target on
service iscsi-target start
三、配置iscsi设备:

1、建立共享存储目录

mkdir /iscsishare

2、建立共享存储卷组

cd /iscsishare
dd if=/dev/zero of=/iscsishare/iqn.ocr1.img bs=1M count=0 seek=150
dd if=/dev/zero of=/iscsishare/iqn.ocr2.img bs=1M count=0 seek=150
dd if=/dev/zero of=/iscsishare/iqn.vote1.img bs=1M count=0 seek=200
dd if=/dev/zero of=/iscsishare/iqn.vote2.img bs=1M count=0 seek=200
dd if=/dev/zero of=/iscsishare/iqn.vote3.img bs=1M count=0 seek=200
dd if=/dev/zero of=/iscsishare/iqn.data.img bs=1G count=0 seek=20
dd if=/dev/zero of=/iscsishare/iqn.fra.img bs=1G count=0 seek=30

3、修改iscsi配置文件

cd /etc/iet/
vim ietd.conf
iSNSServer 192.168.0.11 第20行去掉前面的#号注释,修改IP为本机地址
Target iqn.ocr1.img 第35行去掉前面的#号注释,增加上面dd所生成的存储卷名
Target iqn.ocr2.img
Target iqn.vote1.img
Target iqn.vote2.img
Target iqn.vote3.img
Target iqn.data.img
Target iqn.fra.img
Lun 0 Path=/iscsishare/iqn.ocr1.img,Type=fileio,ScsiId=ocr1,ScsiSN=ocr1 第58行去掉前面的#号注释,修改为存储目录路径
Lun 1 Path=/iscsishare/iqn.ocr2.img,Type=fileio,ScsiId=ocr2,ScsiSN=ocr2
Lun 2 Path=/iscsishare/iqn.vote1.img,Type=fileio,ScsiId=vote1,ScsiSN=vote1
Lun 3 Path=/iscsishare/iqn.vote2.img,Type=fileio,ScsiId=vote2,ScsiSN=vote2
Lun 4 Path=/iscsishare/iqn.vote3.img,Type=fileio,ScsiId=vote3,ScsiSN=vote3
Lun 5 Path=/iscsishare/iqn.data.img,Type=fileio,ScsiId=data,ScsiSN=data
Lun 6 Path=/iscsishare/iqn.fra.img,Type=fileio,ScsiId=fra,ScsiSN=fra

4、重启iscsi-target服务

service iscsi-target restart




http://www.virplus.com/thread-1426.htm
转载请注明:3月前 于 VirPlus 发表

推荐阅读
最新回复 (0)

    ( 登录 ) 后,可以发表评论!

    返回