Ip-san network storage services to build the network storage services to build ip-san

 

                                                               Network storage services ip-san build

One. Brief introduction

SAN (storage area network storage area network and SAN protocols, referred to as SAN), which is a high-speed network data transfer between the computer and storage systems. Common classification is FC-SAN and IP-SAN two kinds.
FC-SAN scsi forwarded via Fiber Channel protocol; IP-SAN scsi forwarding protocol TCP protocol, i.e. an IP address. Refers to a storage device for one or more disk devices storing computer data, generally refers to a disk array, the major manufacturers EMC, Hitachi, and the like.

iSCSI (internet SCSI) technology developed by IBM Research, is a hardware device for use, the upper layer can run the SCSI command set of the IP protocol, a set of instructions that can be implemented to run on a SCSI protocol IP network, it is possible to routing, such as high-speed Gigabit Ethernet. iSCSI storage technology is a new technology, which technology is combined with the conventional SCSI interface Ethernet (Ethernet), so that the server can exchange information with the storage device using the IP network.

     iSCSI is based on TCP / IP protocol, for establishing and managing the interconnection between the IP storage device, the host and client, etc., and creates a storage area network (SAN). SAN so SCSI protocol for high-speed data transmission network possible, such transmission of data to the block level (block-level) among the plurality of data storage in a network. SCSI architecture based on C / S model, which is generally applicable environment: equipment close to each other, and these devices are connected by the SCSI bus.

     The main function is to iSCSI on TCP / IP network between a host system (initiator Initiator) and storage devices (Target target) for a large number of encapsulation and reliable data transmission process.

     iSCSI session layer protocol belonging to the end, which defines a SCSI to TCP / IP mapping (see below), i.e., the Initiator to SCSI commands and data encapsulated iSCSI protocol data unit submitted to the TCP layer down, and finally encapsulated into IP IP packets transmitted over the network, and the data is reduced to the SCSI command by the decapsulation Target arrival, then sent by the memory controller to the specified drive, in order to achieve transparent transmission SCSI commands and data over IP networks. It integrates existing SCSI storage protocols and network protocols TCP / IP, to achieve a seamless integration of memory and TCP / IP networks.                        

 

 

 

 

two. lab environment

 

  • iscsi-disks: 192.168.117.10 (iSCSI target, providing a storage device), a default configuration cpu, 1G memory.
  • iscsi-host: 192.168.117.11 (iSCSI initiator, iSCSI host access device), a default configuration cpu, 1G memory.

 

 

three. Experimental Procedure

Server

1.  Installation Configuration server iSCSI Target

[root@iscsi-disks ~]# yum install -y scsi-target-utils                       

 

2  .  Start target service

[root@iscsi-disks ~]# systemctl enable tgtd                                  

 

3 Put through a firewall

[root@iscsi-disks ~]# iptables -I INPUT 1  -p tcp --dport 3260 -j ACCEPT

[root@iscsi-disks ~]# service iptables save                          

 

4 .  Create storage partitions, where we add a new block size 10G disk / dev / sdb, restart the server by vmvare

[root@iscsi-disks ~]# fdisk -l |grep "Disk"                                   

Disk /dev/sda: 21.5 GB, 21474836480 bytes                                 

Disk identifier: 0x0004a1ec                                              

Disk /dev/sdb: 10.7 GB, 10737418240 bytes                                     

Disk identifier: 0x00000000                                                

[root@iscsi-disks ~]# fdisk  /dev/sdb                                        

 

 

5 .  Shared memory partition, file modification /etc/tgt/targets.conf

[root@iscsi-disks ~]# vim /etc/tgt/targets.conf                                       

<target iqn.2016-08.cn.node01.www:target4_scan>    #命名                          

        backing-store / dev / sdb1 # shared partition                        

        initiator-address 192.168.117.11 # allow access to the address                              

         vendor_id node # label                                      

        product_id target4 # Number                      

</target>                                                                  

[root@iscsi-disks ~]# systemctl restart tgtd                                

 

 

Client

1.  install the iSCSI initiator software packages and restart services

[root@iscsi-host ~]# yum -y install iscsi-initiator-utils                            

[root@iscsi-host ~]systemctl restart iscsi                                      

[root@iscsi-host ~]systemctl enable iscsi                                  

 

 

2. modify the configuration file /etc/iscsi/initiatorname.iscsi

InitiatorName=iqn.2016-06.com.iscsi-host:iscsi-host                         

 

 

 3  found by the storage node IP

InitiatorName=iqn.2016-06.com.iscsi-host:iscsi-host                     

[root@iscsi-host ~]# iscsiadm -m discovery -t sendtargets -p 192.168.56.20

192.168.56.20:3260,1 iqn.2016-06.com.iscsi-disks:iscsi-disks              

[root@iscsi-host ~]# iscsiadm -m node -o show                        

# BEGIN RECORD 6.2.0.874-2                                        

node.name = iqn.2016-06.com.iscsi-disks:iscsi-disks                     

node.tpgt = 1                                                      

node.startup = automatic                                            

node.leading_login = No..                                           .

# END RECORD                                                    

 

4.  launched iscsi landing from the host

[root@iscsi-host ~]# systemctl start iscsi && systemctl enable iscsi      

 

The discovery of new storage device                 

[root@iscsi-host ~]# fdisk -                                        l

Disk /dev/sdb: 1073 MB, 1073741824 bytes, 2097152 sectors              

Units = sectors of 1 * 512 = 512 bytes                                

Sector size (logical/physical): 512 bytes / 512 bytes                     

I/O size (minimum/optimal): 512 bytes / 126976 byte          

         

6.  Use the new storage device

[root@iscsi-host ~]# mkfs.xfs /dev/sdb                                                                         

meta-data=/dev/sdb               isize=512    agcount=4, agsize=65536 blks                                     

         =                       sectsz=512   attr=2, projid32bit=1                            

         Crc finobt = = 1 = 0, sparse = 0                        

data     =                       bsize=4096   blocks=262144, imaxpct=25                    

         =                       sunit=0      swidth=0 blks                                    

naming   =version 2              bsize=4096   ascii-ci=0 ftype=1                             

log      =internal log           bsize=4096   blocks=2560, version=2                                    

         =                       sectsz=512   sunit=0 blks, lazy-count=1                          

realtime =none                   extsz=4096   blocks=0, rtextents=0                                  

[root@iscsi-host ~]# mount /dev/sdb /mnt                                                       

[root@iscsi-host ~]# cd /mnt                                                               

[root@iscsi-host mnt]# ls                                                                  

[root@iscsi-host mnt]# touch abcd                                                        

[root@iscsi-host mnt]# ls                                                                  

Abcd         

 

                                             

                                                               Network storage services ip-san build

One. Brief introduction

SAN (storage area network storage area network and SAN protocols, referred to as SAN), which is a high-speed network data transfer between the computer and storage systems. Common classification is FC-SAN and IP-SAN two kinds.
FC-SAN scsi forwarded via Fiber Channel protocol; IP-SAN scsi forwarding protocol TCP protocol, i.e. an IP address. Refers to a storage device for one or more disk devices storing computer data, generally refers to a disk array, the major manufacturers EMC, Hitachi, and the like.

iSCSI (internet SCSI) technology developed by IBM Research, is a hardware device for use, the upper layer can run the SCSI command set of the IP protocol, a set of instructions that can be implemented to run on a SCSI protocol IP network, it is possible to routing, such as high-speed Gigabit Ethernet. iSCSI storage technology is a new technology, which technology is combined with the conventional SCSI interface Ethernet (Ethernet), so that the server can exchange information with the storage device using the IP network.

     iSCSI是一种基于TCP/IP 的协议,用来建立和管理IP存储设备、主机和客户机等之间的相互连接,并创建存储区域网络(SAN)。SAN 使得SCSI 协议应用于高速数据传输网络成为可能,这种传输以数据块级别(block-level)在多个数据存储网络间进行。SCSI 结构基于C/S模式,其通常应用环境是:设备互相靠近,并且这些设备由SCSI 总线连接。

     iSCSI 的主要功能是在TCP/IP 网络上的主机系统(启动器 initiator)和存储设备(目标器 target)之间进行大量数据的封装和可靠传输过程。

     iSCSI属于端到端的会话层协议,它定义的是SCSI到TCP/IP的映射(如下图),即Initiator将SCSI指令和数据封装成iSCSI协议数据单元,向下提交给TCP层,最后封装成IP数据包在IP网络上传输,到达Target后通过解封装还原成SCSI指令和数据,再由存储控制器发送到指定的驱动器,从而实现SCSI命令和数据在IP网络上的透明传输。它整合了现有的存储协议SCSI和网络协议TCP/IP,实现了存储与TCP/IP网络的无缝融合。                        

 

 

 

 

二.实验环境

 

  • iscsi-disks: 192.168.117.10 (iSCSI target,提供存储设备),默认配置1个cpu,1G内存。
  • iscsi-host: 192.168.117.11 (iSCSI initiator,访问iSCSI设备的主机),默认配置1个cpu,1G内存。

 

 

三.实验步骤

服务端

1. 安装配置iSCSI Target服务端

[root@iscsi-disks ~]# yum install -y scsi-target-utils                       

 

2 . 启动target服务

[root@iscsi-disks ~]# systemctl enable tgtd                                  

 

3放通防火墙

[root@iscsi-disks ~]# iptables -I INPUT 1  -p tcp --dport 3260 -j ACCEPT

[root@iscsi-disks ~]# service iptables save                          

 

4. 新建存储分区,在这里我们通过在vmvare新增加一个块10G大小的磁盘 /dev/sdb,重启服务器

[root@iscsi-disks ~]# fdisk -l |grep "Disk"                                   

Disk /dev/sda: 21.5 GB, 21474836480 bytes                                 

Disk identifier: 0x0004a1ec                                              

Disk /dev/sdb: 10.7 GB, 10737418240 bytes                                     

Disk identifier: 0x00000000                                                

[root@iscsi-disks ~]# fdisk  /dev/sdb                                        

 

 

5. 共享存储分区,修改/etc/tgt/targets.conf 文件

[root@iscsi-disks ~]# vim /etc/tgt/targets.conf                                       

<target iqn.2016-08.cn.node01.www:target4_scan>    #命名                          

        backing-store /dev/sdb1                    #共享的分区                        

        initiator-address 192.168.117.11         #允许访问的地址                              

         vendor_id node                             #标示                                      

        product_id target4                         #产品编号                      

</target>                                                                  

[root@iscsi-disks ~]# systemctl restart tgtd                                

 

 

客户端

1. 安装iSCSI initiator软件包并重启服务

[root@iscsi-host ~]# yum -y install iscsi-initiator-utils                            

[root@iscsi-host ~]systemctl restart iscsi                                      

[root@iscsi-host ~]systemctl enable iscsi                                  

 

 

2.修改配置文件/etc/iscsi/initiatorname.iscsi

InitiatorName=iqn.2016-06.com.iscsi-host:iscsi-host                         

 

 

 3. 通过IP发现存储节点

InitiatorName=iqn.2016-06.com.iscsi-host:iscsi-host                     

[root@iscsi-host ~]# iscsiadm -m discovery -t sendtargets -p 192.168.56.20

192.168.56.20:3260,1 iqn.2016-06.com.iscsi-disks:iscsi-disks              

[root@iscsi-host ~]# iscsiadm -m node -o show                        

# BEGIN RECORD 6.2.0.874-2                                        

node.name = iqn.2016-06.com.iscsi-disks:iscsi-disks                     

node.tpgt = 1                                                      

node.startup = automatic                                            

node.leading_login = No..                                           .

# END RECORD                                                    

 

4. 从主机发起iscsi登陆

[root@iscsi-host ~]# systemctl start iscsi && systemctl enable iscsi      

 

5.发现新存储设备                 

[root@iscsi-host ~]# fdisk -                                        l

Disk /dev/sdb: 1073 MB, 1073741824 bytes, 2097152 sectors              

Units = sectors of 1 * 512 = 512 bytes                                

Sector size (logical/physical): 512 bytes / 512 bytes                     

I/O size (minimum/optimal): 512 bytes / 126976 byte          

         

6. 使用新存储设备

[root@iscsi-host ~]# mkfs.xfs /dev/sdb                                                                         

meta-data=/dev/sdb               isize=512    agcount=4, agsize=65536 blks                                     

         =                       sectsz=512   attr=2, projid32bit=1                            

         =                       crc=1        finobt=0, sparse=0                        

data     =                       bsize=4096   blocks=262144, imaxpct=25                    

         =                       sunit=0      swidth=0 blks                                    

naming   =version 2              bsize=4096   ascii-ci=0 ftype=1                             

log      =internal log           bsize=4096   blocks=2560, version=2                                    

         =                       sectsz=512   sunit=0 blks, lazy-count=1                          

realtime =none                   extsz=4096   blocks=0, rtextents=0                                  

[root@iscsi-host ~]# mount /dev/sdb /mnt                                                       

[root@iscsi-host ~]# cd /mnt                                                               

[root@iscsi-host mnt]# ls                                                                  

[root@iscsi-host mnt]# touch abcd                                                        

[root@iscsi-host mnt]# ls                                                                  

Abcd         

 

                                             

Guess you like

Origin www.cnblogs.com/ededdgg/p/12071018.html