今天在测试服务器上,安装了openfiler,把安装过程,在这描述下:

安装好以后

使用浏览器中登录Openfile Web页面(https://ip:446,用户名:openfiler,密码:password)。

一、网络访问设置

点击主菜单System,在Network Access Configuration中输入允许使用Openfile的计算机名称和IP地址、掩码,本例中IP为192.168.1.1,掩码为255.255.255.255,请注意掩码为32位掩码,这样就指定了192.168.1.1这台计算机可以使用iSCSI,点击Update按钮。

设置后显示,见下图

注意点:

第一,在General中的Local Networks中设置可以访问Openfiler的客户端ip地址,使用其他功能时,Netmask按实际的网段设置,但使用iSCSI时,此部分必须设为:255.255.255.255,否则在使用iSCSI Initiator时,不能正常访问,这个地方可能是Openfiler的一个bug,或许是系统某个地方的限制。

二、建立物理分区 Physical volume

1、依次点击主菜单Volumes,右侧菜单Block Devices,点击磁盘/dev/sda

2、新页面中,选择分区类型为扩展分区Extended partition,点击Create按钮,创建该扩展分区。

注:此处根据需要,也可以选择分区类型为物理分区Physical volume,这样整个磁盘建立一个卷组,在一个卷组上建立多个逻辑卷。

扩展分区被创建,见下图

3、建立物理分区 Physical volume

在Create a partition in /dev/had中,选择分区类型为物理分区Physical volume,第一个分区大小为20GB,Ending cylinder处输入51300,点击Create。

用上面方法,用剩余磁盘空间创建第二个分区,创建后磁盘分区见下图。

三、建立卷组 Volume Groups

依次点击主菜单Volumes,右侧菜单Volume Groups,在Volume group name处输入第一个卷组名Vol-1,Select physical volumes to add处勾选/dev/hda5,点击Add volume group按钮,创建Vol-1卷组。

vol-1卷组以被创建,见下图。

按上述方法在/dev/hda6上,创建创建卷组Vol-2。

四、建立逻辑卷 在vol-1卷上建立iSCSI逻辑卷

依次点击主菜单Volumes,右侧菜单Add Volume。

1、如果由多个卷,请在Select Volume Group处选择所需要的卷

2、在Create a volume in "vol-1"表中,Volume Name处输入卷名称,Required Space (MB)处输入卷大小,卷大小根据需要设置,本例中约为20GB,Filesystem / Volume type处选择iSCSI,点击Create按钮,创建该卷。

该卷已被创建,见下图。

五、开启iSCSI target server服务

依次点击主菜单Services,右侧菜单Manage Services,在Manage Services中点击iSCSI target server右侧Enable按钮,开启iSCSI target server服务。

六、添加iSCSI Targets

依次点击主菜单Volumes,右侧菜单iSCSI Targets。

1、点击Target Configuration,点击Add按钮,添加一个新的iSCSI Target。

添加以后,见下图。

2、点击LUN Mapping按钮,点击Map按钮,映射Target,点击以后该按钮将变为Unmap按钮。

3、点击Network ACL,Access处选择Allow,允许IP为192.168.1.1的计算机使用openfiler,点击Update。

LINUX客户端挂载ISCSI硬盘方法:

注意:

首先要安装ISCSI客户端程序:

# yum -y install  iscsi-initiator-utils

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

* addons: centos.ustc.edu.cn

* base: centos.ustc.edu.cn

* extras: centos.ustc.edu.cn

* updates: centos.ustc.edu.cn

Setting up Install Process

Resolving Dependencies

--&gt Running transaction check

---&gt Package iscsi-initiator-utils.x86_64 0:6.2.0.871-0.20.el5_5 set to be updated

--&gt Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================

Package                              Arch                  Version                             Repository              Size

=============================================================================================================================

Installing:

iscsi-initiator-utils                x86_64                6.2.0.871-0.20.el5_5                updates                814 k

Transaction Summary

=============================================================================================================================

Install      1 Package(s)

Update       0 Package(s)

Remove       0 Package(s)

Total download size: 814 k

Downloading Packages:

iscsi-initiator-utils-6.2.0.871-0.20.el5_5.x86_64.rpm                                                 | 814 kB     00:00

warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897

updates/gpgkey                                                                                        | 1.5 kB     00:00

Importing GPG key 0xE8562897 "CentOS-5 Key (CentOS 5 Official Signing Key) " from /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

Running rpm_check_debug

Running Transaction Test

Finished Transaction Test

Transaction Test Succeeded

Running Transaction

Installing     : iscsi-initiator-utils                                                                                 1/1

Installed:

iscsi-initiator-utils.x86_64 0:6.2.0.871-0.20.el5_5

Complete!

配置iscsi.conf文件

# service iscsi start

为了验证iscsi服务在启动时将会生效,可以使用下面给出的chkconfig命令:

# chkconfig –list iscsi

iscsi 0:off 1:off 2:off 3:off 4:off 5:off 6:off

在默认状态下,新添加的iscsi Initiator在启动后并不能自动工作,所以需要把每一个管理级别都设置为“关闭”的状态。要想在启动后生效,使用下面的chkconfig命令就可以了:

# chkconfig –add iscsi

# chkconfig iscsi on

上面的两个命令首先检查是否有必要的脚本来启动和停止这项服务,然后把服务指定到正确的管理级别上。

然后检查这些更改是否生效:

# chkconfig –list iscsi

iscsi 0:off 1:off 2:on 3:on 4:on 5:on 6:off

1)检测ISCSI硬盘:

iscsiadm --mode discovery --type sendtargets --portal 192.168.75.127

2)挂载

iscsiadm -m node -p 192.168.75.127  -T iqn.2006-01.com.openfiler:tsn.1d786d0184c6 -l -d 10