免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1677 | 回复: 0
打印 上一主题 下一主题

[存储网络] Going Enterprise - setup your FC4 iSCSI target in [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-03-14 16:57 |只看该作者 |倒序浏览
About
This is a ultimate guide how to setup your iSCSI target on a Linux
FC4 machine. This article doesn't include the setup guide for Linux
iSCSI Initiator. However, it does tell you how to download and use a
Microsoft iSCSI Initiator for use on a Windows server/client PC for
iSCSI Initiator role. You can read all about iSCSI on Linux
here
(http://iscsitarget.sourceforge.net/). Or just read the
FAQ
(http://iscsitarget.sourceforge.net/phpwiki/index.php/FrequentlyAskedQuestions?PHPSESSID=a361557a79c96e1f545f8fe21b324baf).
[
edit
] What is iSCSI, a little background
Internet SCSI. Pronounced eye skuzzy. An IP-based standard for
linking data storage devices over a network and transferring data by
carrying SCSI commands over IP networks. iSCSI supports a Gigabit
Ethernet interface at the physical layer, which allows systems
supporting iSCSI interfaces to connect directly to standard Gigabit
Ethernet switches and/or IP routers. When an operating system receives
a request it generates the SCSI command and then sends an IP packet
over an Ethernet connection. At the receiving end, the SCSI commands
are separated from the request, and the SCSI commands and data are sent
to the SCSI controller and then to the SCSI storage device. iSCSI will
also return a response to the request using the same protocol. iSCSI is
important to SAN technology because it enables a SAN to be deployed in
a LAN, WAN, or MAN. iSCSI was developed by the IETF and became an
official standard in February 2003.
[
edit
] The scenario
Because we are in a production environment with mixed
infrastructure, we will setup a FC4 server, exporting our spare
partition via iSCSI (Note that you can export block devices, regular
files, LVM and RAID). The iSCSI Initiator will be some Windows 2003
server, that will se this iSCSI exported partition as another local
drive on this server. This will make our Linux box the iSCSI target, and a Windows 2003 server a iSCSI Initiator.
[
edit
] Preparations
You need to download and install iscsitarget software from
The iSCSI Enterprise Target Project
(http://iscsitarget.sourceforge.net/). The downloaded version depends on your kernel version. You can see your kernel version issuing the command:
uname -a
For the time of writing, for the latest version of iscsitarget
(0.4.13) you need kernel 2.6.14 or newer. If you don't have that kernel
version you can get the latest kernel as shown below or you can get
older versions of iscsitarget in *.rpm:
yum update kernel kernel-devel
Reboot your server after the kernel installation, to apply changes.
At this point you are ready to build iSCSI target.
[
edit
] The develop of iSCSI
Goto /usr/local folder for example and extract the files from the archive in that folder:
tar xvfz iscsitarget-0.4.13.tar.gz
Goto the newly created folder and build iSCSI modules and service:
cd iscsitarget-0.4.13
...but first, export your kernel source path. Make sure you export the correct PATH for your kernel version!
export KERNELSRC=/usr/src/kernels/2.6.14-1.1526_FC4-i686
Compile and install
make && make install
Copy the default config file to /etc folder
cp etc/ietd.conf /etc
[
edit
] Configure iSCSI target service
Well, you can play around with the options that you have, but actually, you only need to setup Target (for identifying this box), Incoming/Outgoing user (if you would like to use authentication), the part of storage that you are exporting and possibly Alias for this target. So i basically changed just the following:
Target iqn.2009-08.local.fog:storage.lvm
        # Users, who can access this target
        # (no users means anyone can access the target)
        #IncomingUser
        #OutgoingUser
        # Lun definition
        # (right now only block devices are possible)
        Lun 0 Path=/dev/hdb
        # Alias name for this target
        Alias iSCSI
        # various iSCSI parameters
        # (not all are used right now, see also iSCSI spec
This is how my config file looks like. My domain name is fog.local, I'm not using authentication, I'm exporting second HDD (hdb) and the alias of this target is iSCSI. Feel free to look at the manual page for ietd.conf file for more parameters explanations.
[
edit
] Run the service
At this point you are ready to start the service. Fire it up with
/etc/init.d/iscsi-target start
If you configured everything correct, you should see a message like this in your log file /var/log/messages
Oct  5 10:45:01 iscsi-fc4-prod kernel: iSCSI Enterprise Target Software - version 0.4.13
Oct  5 10:45:01 iscsi-fc4-prod kernel: iotype_init(97) register fileio
Oct  5 10:45:01 iscsi-fc4-prod kernel: iet_target_param_set(128) d 1 8192 262144 65536 2 20 8 0
Oct  5 10:45:01 iscsi-fc4-prod iscsi-target: ietd startup succeeded
If you want the iscsi-target service to be automaticaly run on next reboot do:
chkconfig iscsi-target on
[
edit
] The End of Part 1
Now you have a fully working iSCSI target up and running. If you
would like to use the exported storage on Windows machine, read on,
else you have to configure iSCSI Initiator on Linux client. You can
find more on this subject from
this fine docs
(http://iscsitarget.sourceforge.net/phpwiki/).
[
edit
] Configure your Windows client to use the FC4 iSCSI target
This is the easy part, all the "hard work" was already done.
There are a few steps left:
First get the initiator software from
this site
(http://www.microsoft.com/windowsserver2003/technologies/storage/iscsi/msfiSCSI.mspx).
Next, install the software (next, next, next.... finish). Note you have to install Initiator and Service.
When done, configure initiator as shown below:
Configure the IP address of the iSCSI target server:

Make the iSCSI target available and Log On to it. Note, that you can
automatically restore the target by checking the first checkbox.


[
edit
] Use it!
Now we have set up everything we need to be successfully running iSCSI software in Enterprise production.
Goto your Management Console and open Disk Management.
If you've setup the Windows part correct, you should see a new drive in
your Disk Management. Feel free to format it and make it usable in your
system. This drive is treated just like a hardware drive would be, but
it is all done over the network.
The example of successfully configured exported storage is shown below:

[
edit
] Conclusion
iSCSI can be a VERY useful thing, especially when you have a large
storage to be exporting it over network. It's a cheap solution for a
big part in every network infrastructure.
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/2389/showart_258626.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP