构建SAN网络存储
實(shí)驗(yàn)?zāi)康?#xff1a;構(gòu)建SAN網(wǎng)絡(luò)存儲
實(shí)驗(yàn)環(huán)境:redhat 5.4三臺,scanstorage作為存儲服務(wù),IP地址是:192.168.9.79。node1,node2作為客戶端測試
實(shí)驗(yàn)步驟:
一、配置服務(wù)端:
1、添加一塊20G的盤
[root@scanstorage ~]# fdisk -l |grep Disk
Disk /dev/sdc: 21.4 GB, 21474836480 bytes
2、在RHEL5中安裝如下的包:
iscsi-initiator-utils-6.2.0.868-0.18.el5.i386.rpm
perl-Config-General-2.40-1.el5.noarch.rpm
scsi-target-utils-0.0-5.20080917snap.el5.i386.rpm (這個(gè)包在光盤的cluster storage目錄下)
[root@scanstorage ~]# yum -y install iscsi-initiator-utils perl-Config-General scsi-target-utils
3、通過linux中的命令生成IQN編號
[root@scanstorage ~]# iscsi-iname
iqn.1994-05.com.redhat:a3c8bc769291
4、編輯配置文件
[root@scanstorage ~]# vim /etc/tgt/targets.conf
<target iqn.1994-05.com.redhat:4d4fa666619>
backing-store /dev/sdb
</target>
5、啟動服務(wù)
[root@scanstorage ~]# /etc/init.d/tgtd start
Starting SCSI target daemon: Starting target framework daemon
6、查看配置信息
[root@scanstorage ~]# tgtadm --lld iscsi --op show --mode target
Target 1: iqn.1994-05.com.redhat:bc2c8763fcdb
System information:
Driver: iscsi
State: ready
I_T nexus information:
LUN information:
LUN: 0
Type: controller
SCSI ID: IET 00010000
SCSI SN: beaf10
Size: 0 MB
Online: Yes
Removable media: No
Backing store type: rdwr
Backing store path: None
LUN: 1
Type: disk
SCSI ID: IET 00010001
SCSI SN: beaf11
Size: 21475 MB
Online: Yes
Removable media: No
Backing store type: rdwr
Backing store path: /dev/sdb
Account information:
ACL information:
ALL
[root@scanstorage ~]#
以上就是ISCSI服務(wù)的配置,注意,ISCSI的鏈接端口是3260,保證防火墻正常通過。接下來我們配置客戶端。
二、配置客戶端
客戶端的配置的時(shí)候只需要安裝一個(gè)ISCSI Initiator的包即可。以node1,node2為例:
1、安裝包
[root@node1 ~]# yum -y install iscsi-initiator-utils
[root@node2 ~]# yum -y install iscsi-initiator-utils
2、使用iSCSI存儲
[root@node1 ~]# iscsiadm -m discovery -t st -p 192.168.9.79
192.168.9.79:3260,1 iqn.1994-05.com.redhat:bc2c8763fcdb
[root@node2 ~]# iscsiadm -m discovery -t st -p 192.168.9.79
192.168.9.79:3260,1 iqn.1994-05.com.redhat:bc2c8763fcdb
在node1和node2上開啟服務(wù)如下服務(wù):iscsid network iscsi netfs,然后登錄:
[root@node1 ~]# iscsiadm -m node -T iqn.1994-05.com.redhat:bc2c8763fcdb -p 192.168.9.79 -l
[root@node1 ~]# fdisk -l
Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 3393 27254241 83 Linux
/dev/sda2 3394 3915 4192965 82 Linux swap / Solaris
Disk /dev/sdb: 21.4 GB, 21474836480 bytes64 heads, 32 sectors/track, 20480 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Disk /dev/sdb doesn't contain a valid partition table
[root@node1 ~]# iscsiadm -m node -T iqn.1994-05.com.redhat:bc2c8763fcdb -p 192.168.9.79 -l
[root@node2 ~]# fdisk -l
Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 3393 27254241 83 Linux
/dev/sda2 3394 3915 4192965 82 Linux swap / Solaris
Disk /dev/sdb: 21.4 GB, 21474836480 bytes64 heads, 32 sectors/track, 20480 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Disk /dev/sdb doesn't contain a valid partition table
轉(zhuǎn)載于:https://blog.51cto.com/kongwx/1179830
總結(jié)
- 上一篇: 扫盲:php session缓存至mem
- 下一篇: Unique Binary Search