新聞中心
一,ISCSI簡介

為永昌等地區(qū)用戶提供了全套網(wǎng)頁設(shè)計制作服務(wù),及永昌網(wǎng)站建設(shè)行業(yè)解決方案。主營業(yè)務(wù)為網(wǎng)站建設(shè)、成都網(wǎng)站制作、永昌網(wǎng)站設(shè)計,以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠的服務(wù)。我們深信只要達到每一位用戶的要求,就會得到認可,從而選擇與我們長期合作。這樣,我們也可以走得更遠!
iSCSI,即internet SCSI,又稱為IP-SAN,是IETF制訂的一項標準,用于將SCSI數(shù)據(jù)塊映射成以太網(wǎng)數(shù)據(jù)包。iSCSI是一種基于TCP/IP 的協(xié)議,用來建立和管理IP存儲設(shè)備、主機和客戶機等之間的相互連接,并創(chuàng)建存儲區(qū)域網(wǎng)絡(luò)(SAN)。SAN 使得SCSI 協(xié)議應(yīng)用于高速數(shù)據(jù)傳輸網(wǎng)絡(luò)成為可能,這種傳輸以數(shù)據(jù)塊級別(block-level)在多個數(shù)據(jù)存儲網(wǎng)絡(luò)間進行。SCSI 結(jié)構(gòu)基于C/S模式,其通常應(yīng)用環(huán)境是:設(shè)備互相靠近,并且這些設(shè)備由SCSI 總線連接。
iSCSI 的主要功能是在TCP/IP 網(wǎng)絡(luò)上的主機系統(tǒng)(啟動器 initiator)和存儲設(shè)備(目標器 target)之間進行大量數(shù)據(jù)的封裝和可靠傳輸過程。
從根本上說,iSCSI協(xié)議是一種跨過IP網(wǎng)絡(luò)來傳輸潛伏時間短的SCSI數(shù)據(jù)塊的方法。
完整的iSCSI系統(tǒng)的拓撲結(jié)構(gòu)如下:
與傳統(tǒng)的SCSI技術(shù)比較起來,iSCSI技術(shù)有以下三個革命性的變化:
- 把原來只用于本機的SCSI協(xié)同透過TCP/IP網(wǎng)絡(luò)傳送,使連接距離可作無限的地域延伸;
- 連接的服務(wù)器數(shù)量無限(原來的SCSI-3的上限是15);
- 由于是服務(wù)器架構(gòu),因此也可以實現(xiàn)在線擴容以至動態(tài)部署。
ISCSI的協(xié)議結(jié)構(gòu):
二,搭建基于 IP SAN 的 ISCSI 存儲系統(tǒng)
- 規(guī)劃:
- 環(huán)境: CentOS 6.6 32位
- 服務(wù)器端 IP: 192.168.1.43
- 客戶端 IP : 192.168.1.111
- 共享磁盤: /dev/sdb
1,配置服務(wù)器端
- [root@localhost ~]# yum -y install scsi-target-utils #安裝服務(wù)器端軟件
- [root@node1 iscsi]# rpm -ql scsi-target-utils
- /etc/rc.d/init.d/tgtd
- /etc/sysconfig/tgtd
- /etc/tgt/targets.conf #配置文件
- /usr/sbin/tgt-admin
- /usr/sbin/tgt-setup-lun
- /usr/sbin/tgtadm
- /usr/sbin/tgtd
- /usr/sbin/tgtimg
- /usr/share/doc/scsi-target-utils-1.0.24
- /usr/share/doc/scsi-target-utils-1.0.24/README
- /usr/share/doc/scsi-target-utils-1.0.24/README.iscsi
- /usr/share/doc/scsi-target-utils-1.0.24/README.iser
- /usr/share/doc/scsi-target-utils-1.0.24/README.lu_configuration
- /usr/share/doc/scsi-target-utils-1.0.24/README.mmc
- /usr/share/man/man5/targets.conf.5.gz
- /usr/share/man/man8/tgt-admin.8.gz
- /usr/share/man/man8/tgt-setup-lun.8.gz
- /usr/share/man/man8/tgtadm.8.gz
- [root@localhost ~]# lsmod |grep scsi
- mptscsih 31330 1 mptspi
- mptbase 86744 2 mptspi,mptscsih
- scsi_transport_spi 19726 1 mptspi #高級驅(qū)動程序
iscsi可以使用命令或配置文件進行配置,我們首先使用命令行來進行配置:
- [root@node1 iscsi]# service tgtd start
- Starting SCSI target daemon: [ OK ]
- [root@node1 iscsi]# ss -tlnp |grep 3260 #其監(jiān)聽在3260端口
- LISTEN 0 128 :::3260 :::* users:(("tgtd",11882,5),("tgtd",11885,5))
- LISTEN 0 128 *:3260 *:* users:(("tgtd",11882,4),("tgtd",11885,4))
- [root@localhost ~]# tgtadm -L iscsi -o new -m target -t 1 -T iqn.2015-08.com.feiyu.testsan:1 #創(chuàng)建一個target,-t指定TID,-T指定名稱
iqn表示“ISCSI Qualified Name”,簡稱iqn。
- [root@localhost ~]# tgtadm -L iscsi -o show -m target
- Target 1: iqn.2015-08.com.feiyu.testsan:1
- 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, Block size: 1
- Online: Yes
- Removable media: No
- Prevent removal: No
- Readonly: No
- Backing store type: null
- Backing store path: None
- Backing store flags:
- Account information:
- ACL information:
然后設(shè)定LUN(Logical Unit Number,邏輯單元號),服務(wù)器端只需要創(chuàng)建好分區(qū),不需要格式化:
- [root@localhost ~]# tgtadm -L iscsi -o new -m logicalunit -t 1 -l 1 -b /dev/sdb5 #創(chuàng)建一個LUN,-m表示模式,-l :LUN ,-b: 設(shè)備
- [root@localhost ~]# tgtadm -L iscsi -o bind -m target -t 1 -I 192.168.0.0/16
- [root@node1 iscsi]# tgtadm -L iscsi -o show -m target
- Target 1: iqn.2015-08.com.feiyu.testsan:1
- 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, Block size: 1
- Online: Yes
- Removable media: No
- Prevent removal: No
- Readonly: No
- Backing store type: null
- Backing store path: None
- Backing store flags:
- LUN: 1
- Type: disk
- SCSI ID: IET 00010001
- SCSI SN: beaf11
- Size: 2107 MB, Block size: 512
- Online: Yes
- Removable media: No
- Prevent removal: No
- Readonly: No
- Backing store type: rdwr
- Backing store path: /dev/sdb5
- Backing store flags:
- Account information:
- ACL information:
- [root@node1 iscsi]# tgtadm -L iscsi -o bind -m target -t 1 -I 192.168.0.0/16 #設(shè)定共享區(qū)
- [root@node1 iscsi]# tgtadm -L iscsi -o show -m target
- Target 1: iqn.2015-08.com.feiyu.testsan:1
- 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, Block size: 1
- Online: Yes
- Removable media: No
- Prevent removal: No
- Readonly: No
- Backing store type: null
- Backing store path: None
- Backing store flags:
- LUN: 1
- Type: disk
- SCSI ID: IET 00010001
- SCSI SN: beaf11
- Size: 2107 MB, Block size: 512
- Online: Yes
- Removable media: No
- Prevent removal: No
- Readonly: No
- Backing store type: rdwr
- Backing store path: /dev/sda5
- Backing store flags:
- Account information:
- ACL information:
- 192.168.0.0/16
- [root@localhost ~]# tgtadm -L iscsi -o new -m logicalunit -t 1 -l 2 -b /dev/sdb6 #綁定第二個LUN
2,配置客戶端
- [root@node1 ~]# yum install -y iscsi-initiator-utils #安裝客戶端
- [root@node1 iscsi]# echo "InitiatorName=`iscsi-iname -p iqn.2013-05.com.feiyu`" > /etc/iscsi/initiatorname.iscsi #生成iqn
- [root@node1 iscsi]# echo "InitiatorAlias=initiator1" >> /etc/iscsi/initiatorname.iscsi #定義別名
- [root@node1 iscsi]# ls
- initiatorname.iscsi iscsid.conf
- [root@node1 iscsi]# cat initiatorname.iscsi #查看所定義的數(shù)據(jù)
- InitiatorName=iqn.2015-08.com.feiyu:10834bd52221
- InitiatorAlias=initiator1
- [root@node1 ~]# service iscsi start #啟動服務(wù),需要啟動兩個服務(wù)
- [root@node1 ~]# service iscsid start
- [root@node1 ~]# chkconfig iscsi on
- [root@node1 ~]# chkconfig iscsid on
若出現(xiàn)以下錯誤,可能由于服務(wù)器端的防火墻沒有關(guān)!
- [root@node1 ~]# iscsiadm -m discovery -t st -p 192.168.1.43
- Starting iscsid: [ OK ]
- iscsiadm: cannot make connection to 192.168.1.43: No route to host
- [root@node1 ~]# iscsiadm -m discovery -t st -p 192.168.1.43 #進行探測
- 192.168.1.43:3260,1 iqn.2015-08.com.feiyu.testsan:1
- [root@node1 ~]# iscsiadm -m node -T iqn.2015-08.com.feiyu.testsan:1 -p 192.168.1.43 -l #登錄節(jié)點
- Logging in to [iface: default, target: iqn.2015-08.com.feiyu.testsan:1, portal: 192.168.1.43,3260] (multiple)
- Login to [iface: default, target: iqn.2015-08.com.feiyu.testsan:1, portal: 192.168.1.43,3260] successful.
- [root@node1 ~]# fdisk -l #登錄成功可以看到多了一塊硬盤,
- Disk /dev/sda: 21.5 GB, 21474836480 bytes
- 255 heads, 63 sectors/track, 2610 cylinders
- Units = cylinders of 16065 * 512 = 8225280 bytes
- Sector size (logical/physical): 512 bytes / 512 bytes
- I/O size (minimum/optimal): 512 bytes / 512 bytes
- Disk identifier: 0x0006d052
- Device Boot Start End Blocks Id System
- /dev/sda1 * 1 39 307200 83 Linux
- Partition 1 does not end on cylinder boundary.
- /dev/sda2 39 2354 18598912 83 Linux
- /dev/sda3 2354 2610 2057689 5 Extended
- /dev/sda5 2354 2610 2057657+ 83 Linux
- Disk /dev/sdc: 10.7 GB, 10742183424 bytes -------> iscsi設(shè)備
- 64 heads, 32 sectors/track, 10244 cylinders
- Units = cylinders of 2048 * 512 = 1048576 bytes
- Sector size (logical/physical): 512 bytes / 512 bytes
- I/O size (minimum/optimal): 512 bytes / 512 bytes
- Disk identifier: 0x00000000
為磁盤創(chuàng)建分區(qū)并格式化。
- [root@node1 ~]# mke2fs -t ext4 /dev/sdc1
網(wǎng)站標題:CentOS6.6安裝iSCSI
路徑分享:http://www.dlmjj.cn/article/ccdejod.html


咨詢
建站咨詢
