Ip-san network storage services to build

Brief look SAN (storage area network and storage area network SAN protocol, abbreviated 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 forwarded via Fiber Channel SCSI protocol; IP-SAN forwards the SCSI protocol over TCP protocol, i.e. the IP address of
the storage device in English means for storing one or more computer data disk device, usually a disk array, the main vendors EMC, Hitachi.

IP-SAN storage following configuration combat

service name server address
Server: node01 192.168.137.101
Client: node02 192.168.137.102
Client: node03 192.168.137.103


First, the server installation
 1.1 IPSAN is C / S mode service port 3260

Click ( here) folded or unfolded

  1. [root @ node01〜]#yum -y install scsi-target-utils #yum安装
  2. [root @ node01~] #ll /etc/tgt/targets.conf# main profile
    -rw ------- 1 root. 4 On Sep 6945, 2013 /etc/tgt/targets.conf the root
    [the root @  node01~ ] #service tgtd restart # service start
    stop SCSI target daemon: not running [FAILED]
    to start the SCSI target daemon: [OK]
    [root @ node01~] #chkconfig tgtd located
    [root @ node01~] #netstat -antup | grep 3260 # inspection service port
    tcp 0 0 0.0.0.0:3260 0.0.0.0:* LISTEN 1125 / tgtd           
    tcp 0 0 ::: 3260 ::: * LISTEN 1125 / tgtd  [root @  node01~           
    ] # 

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

Click ( here) folded or unfolded

  1. [Root @ node01~] #fdisk -l | grep "Disk"
  2. Disk / dev / sda: 21.5 GB, 21474836480 bytes
  3. Disk identifier: 0x0004a1ec
  4. Disk / dev / sdb: 10.7 GB, 10737418240 bytes
  5. Disk identifier: 0x00000000
  6. [root @ node01〜]#
  7. [Root @ node01~] #fdisk / dev / sdb # partition, the size of 5G

1.3 shared storage partitions, modify /etc/tgt/targets.conf file

Click ( here) folded or unfolded

  1. Root NODE01~ @ # VIM's / etc / TGT / target . conf # add the following, the following is the format iscsi
  2. <Target iqn. 2016--08. cn. node01. www: target4_scan> # name 
  3.         Support - Store / dev / sdb1 # shared partition
  4.         Originator - address 192. 168. 137. # 102 allows access address
  5.         Originator - address 192. 168. 137. 103
  6.         vendor_id node labeled #
  7.         product_id target4 # Number
  8. </ Target>
  9. [root @ node01~] # tgt- admin -show # view the status of
    goals 1: iqn.2016-08.cn.node01.www: target4_scan
        System Information:
            Driver: iscsi
            status: Ready
        I_T related information:
        LUN information:
            LUN: 0
                type: control
                the SCSI ID: 00010000 the IET
                the SCSI SEQ ID nO: beaf10
                size: 0 MB, the block size: 1
                line: a
                removable media: nO
                from deletion: no
                read-only: no
                backing store type: null
                backing store path: None
                backing store flag: 
            LUNs:. 1
                type: disk
                the SCSI ID: 00010001 the IET
                the SCSI SEQ ID NO: beaf11
                size: 5379 MB, the block size: 512
                online: yES
                Removable media: No
                prevented Delete: No
                read-only: no
                backing store type: rdwr backup
                storage path: / dev / sdb1  back-up
                storage flag: 
        Account Information:
        ACL information:
            192.168.137.102
            192.168.137.103
    [root @ node01~] # 

Second, the client configuration
2.1 Installation iscsi-initiator-utils, and configure the service information

Click ( here) folded or unfolded

  1. [root @ node02〜]#yum -y install iscsi-initiator-utils
  2. [Root @ node02~] #iscsiadm -m find -t sendtargets -p 192.168.137.101 # find the target storage
  3. Start iscsid: [OK]
  4. 192.168.137.101:3260,1 iqn.2016-08.cn.node01.www:target4_scan
  5. [root @ node02〜]#
  6. [Root @ node02~] # / etc / init.d / iscsid status # View Client Services
  7. iscsid (pid 1153) is running ...
  8. [root @ node02〜]#
  9. [Root @ node02~] # tree / var / lib / iscsi / # find the target service, information will be written in / var / lib / iscsi directory
  10. / var / lib / iscsi /
  11. ├──ifaces
  12. ├──isns
  13. ├── node
  14. │└──iqn.2016-08.cn.node01.www:target4_scan
  15. │└──192.168.137.101,3260,1
  16. │└── default
  17. ├──send_targets
  18. │└──192.168.137.101,3260
  19. │├──iqn.2016-08.cn.node01.www:target4_scan,192.168.137.101,3260,1,默认-> /var/lib/iscsi/nodes/iqn.2016-08.cn.node01.www: target4_scan / 192.168.137.101,3260,1
  20. │└──st_config
  21. ├──slp
  22. └── static
  23. 10 directory, two files
  24. [root @ node02〜]#
  25. [root @ node02~
    ] # / etc / init.d /  iscsid Start # first start iscsid service [root @  node02~ ] # / etc / init.d / iscsi Start # iscsi service to start the service in accordance with iscsid service information / var / lib / iscsi / device to identify
    start iscsi: [OK]
    [node02~ the root @] # 

2.2 Check whether the disk was found, as well as unloading equipment and login scsi

Click ( here) folded or unfolded

  1. [root @ node02〜]#ll / dev / sdb
  2. brw-rw ---- 1 root disks 8,8 Aug 16 00:48 / dev / sdb
  3. [Root @ node02~] #lsblk #lsblk view block information command
  4. Name MAJ: MIN RM RO Type Size MOUNTPOINT
    SDA. 8: 0 0 0 20G disk 
    ├─sda18: 1 0 200M 0 parts /
    boot├─sda28: 2 0 0 1OG parts /
    └─sda38: 0. 3 0 parts. 1G [the SWAP]
    11 SR0: 0 1 0 3.6G ROM / Media
    sdb 8:16 [NASB] 0 0 disk 5G 
  5. [root @ node02〜]#
  6. [Root @ node02~] # tree / var / lib / iscsi /
  7. In / var / lib in / of the iSCSI /
    ├──ifaces
    ├──ISNS
    ├── node
    │└──iqn.2016-08.cn.node01.www: target4_scan
    │└──192.168.137.101,3260,1
    │└─ ─ default
    ├──send_targets
    │└──192.168.137.101,3260
    │├──iqn.2016-08.cn.node01.www: target4_scan, 192.168.137.101,3260,1, by default -> a / var / lib in / iSCSI is /nodes/iqn.2016-08.cn.node01.www:target4_scan/192.168.137.101,3260,1
    │└──st_config
    ├──SLP
    └── static

    10 directory, 2 files
  8. [Root @ node02~] #iscsiadm -m node -T iqn.2016-08.cn.node01.www: target4_scan -u # scsi unloading equipment
  9. Cancellation of the session [sid: 1, target: iqn.2016-08.cn.node01.www: target4_scan, Portal: 192.168.137.101,3260]
  10. Successful logout [sid: 1, target: iqn.2016-08.cn.node01.www: target4_scan, Portal: 192.168.137.101,3260].
  11. [root @ node02〜]#lsblk
  12. Name MAJ: MIN RM RO Type Size MOUNTPOINT
    SDA. 8: 0 0 0 20G disk 
    ├─sda18: 1 0 200M 0 parts /
    boot├─sda28: 2 0 0 1OG parts /
    └─sda38: 0. 3 0 parts. 1G [the SWAP]
    sr0 11: 0 1 3.6G 0 rom / media
  13. [Root @ node02~] #iscsiadm -m node -T iqn.2016-08.cn.node01.www: target4_scan -l # Login scsi devices
  14. Login [iface: default target: iqn.2016-08.cn.node01.www: target4_scan, Portal: 192.168.137.101,3260] (more)
  15. Successfully logged on to [iface: default target: iqn.2016-08.cn.node01.www: target4_scan, Portal: 192.168.137.101,3260].
  16. [root @ node02〜]#lsblk
  17. Name MAJ: MIN RM RO Type Size MOUNTPOINT
    SDA. 8: 0 0 0 20G disk 
    ├─sda18: 1 0 200M 0 parts /
    boot├─sda28: 2 0 0 1OG parts /
    └─sda38: 0. 3 0 parts. 1G [the SWAP]
    11 SR0: 0 1 0 3.6G ROM / Media
    sdb 8:16 [NASB] 0 0 disk 5G 
  18. [root @ node02〜]#

2.3 scsi devices, and make a write operation

Click ( here) folded or unfolded

  1. [root @ node02〜]#df -h
  2. File system size has been used in the percentage of the available installed
  3. / dev / sda2 9.9G 869M 8.5G 10%/
  4. tmpfs 238M 0 238M 0%/ dev / shm
  5. / Dev / sda1 194M 27M 158M 15% / boot
  6. / Dev / sr0 3.6G 3.6G 0 100% / Media
  7. [root @ node02〜]#
  8. [Root @ node02~] #fdisk / dev / sdb # partition
  9.  
  10. [Root @ node02~] # lsblk # view the partition block
  11. NNAME MAJ: MIN RM RO Type Size MOUNTPOINT
    SDA. 8: 0 0 0 20G disk 
    ├─sda18: 1 0 200M 0 parts /
    boot├─sda28: 2 0 0 1OG parts /
    └─sda38: 0. 3 0 parts. 1G [the SWAP]
    . 11 SR0: 3.6G. 1 0 0 ROM / Media
    SDB. 5G 0 0 8:16 disk 
    └─sdb18: 17 0 5G 0 part 
  12. [Root @ node02~] # mkfs.ext4 / dev / sdb1 # formatted partition
  13. mke2fs 1.41.12 (2010 Nian 5 17 May)
  14. File system label =
  15. OS type: Linux
  16. Block size = 4096 (log = 2)
  17. Fragment size = 4096 (log = 2)
  18. Stride = 0, stripe width = 0
  19. Inode 328656, 1312222
  20. Superuser has reserved blocks 65611 (5.00%)
  21. The first data block = 0
  22. Maximum number of blocks filesystem = 1346371584
  23. Group 41
  24. Each 32,768 blocks, each segment 32768
  25. Each group inode 8016
  26. Superblock stored on the backup block:
  27. 32768、98304、163840、229376、294912、819200、884736
  28. Writing inode table: Finish
  29. Create a log (32768): Completed
  30. Write super block and file system billing information: Completed
  31. The installed file system will automatically check once every 21 times, or
  32. 180 days, whichever comes first. Use tune2fs -c or -i coverage.
  33. [Root @ node02~] #mkdir / scsi # Mount partition to the new directory / scsi
  34. [root @ node02〜]#mount / dev / sdb1 / scsi /
  35. [root @ node02〜]#df -h
  36. File system size has been used in the percentage of the available installed
  37. / dev / sda2 9.9G 869M 8.5G 10%/
  38. tmpfs 238M 0 238M 0%/ dev / shm
  39. / Dev / sda1 194M 27M 158M 15% / boot
  40. / Dev / sr0 3.6G 3.6G 0 100% / Media
  41. / dev / sdb1 5.0G 139M 4.6G 3%/ scsi
  42. [Root @ node02~] #cp -r / root / * / scsi / # write verification
  43. [root @ node02〜]#ll / scsi /
  44. A total of 36
  45. -rw ------- 1 root 980, August 12 00:59 anaconda-ks.cfg
  46. -rw-r - r-- 1 th root root 10197 Aug 12 00:59 install.log
  47. -rw-r - r-- 1 th root root 3161 Aug 12 00:59 install.log.syslog
  48. drwx ------ 2根root 16384 Aug 12 00:58 lost + found
  49. [root @ node02〜]#df -h / scsi /
  50. File system size has been used in the percentage of the available installed
  51. / dev / sdb1 5.0G 139M 4.6G 3%/ scsi
  52. [root @ node02〜]#

Third, additional client 192.168.137.103. 192.168.137.102 same operation is substantially similar, except that this is no longer necessary to format the partition

Click ( here) folded or unfolded

  1. [root @ node03〜]#yum -y install iscsi-initiator-utils
  2. [root @ node03〜]#
  3. [root @ node03〜]#iscsiadm -m发现-t sendtargets -p 192.168.137.101
  4. Start iscsid: [OK]
  5. 192.168.137.101:3260,1 iqn.2016-08.cn.node01.www:target4_scan
  6. [Root @ node03~] #yum -y installation tree
  7. [Root @ node03~] # tree / var / lib / iscsi /
  8. / var / lib / iscsi /
  9. ├──ifaces
  10. ├──isns
  11. ├── node
  12. │└──iqn.2016-08.cn.node01.www:target4_scan
  13. │└──192.168.137.101,3260,1
  14. │└── default
  15. ├──send_targets
  16. │└──192.168.137.101,3260
  17. │├──iqn.2016-08.cn.node01.www:target4_scan,192.168.137.101,3260,1,默认-> /var/lib/iscsi/nodes/iqn.2016-08.cn.node01.www: target4_scan / 192.168.137.101,3260,1
  18. │└──st_config
  19. ├──slp
  20. └── static
  21. 10 directory, two files
  22. [Root @ node03~] # / etc / init.d / iscsid restart
  23. Stop iscsid:
  24. Start iscsid: [OK]
  25. [root @ node03〜]#lsblk
  26. Name MAJ: MIN RM RO Type Size MOUNTPOINT
    SDA. 8: 0 0 0 20G disk 
    ├─sda18: 1 0 200M 0 parts /
    boot├─sda28: 2 0 0 1OG parts /
    └─sda38: 0. 3 0 parts. 1G [the SWAP]
    sr0 11: 0 1 3.6G 0 rom / media
  27. [Root @ node03~] # / etc / init.d / iscsi restart
  28. Stop iscsi: [OK]
  29. Start iscsi: [OK]
  30. [Root @ node03~] # lsblk # can see the device sdb1
  31. Name MAJ: MIN RM RO Type Size MOUNTPOINT
    SDA. 8: 0 0 0 20G disk 
    ├─sda18: 1 0 200M 0 parts /
    boot├─sda28: 2 0 0 1OG parts /
    └─sda38: 0. 3 0 parts. 1G [the SWAP]
    . 11 SR0: 3.6G. 1 0 0 ROM / Media
    SDB. 5G 0 0 8:16 disk 
    └─sdb18: 17 0 5G 0 part 
  32. [root @ node03〜]#
  33. [root @ node03〜]#
  34. [root @ node03〜]#mkdir / scsi           
  35. [Root @ node03~] #mount / dev / sdb1 / scsi / # mount
  36. [root @ node03〜]#cd!$
  37. cd / scsi /
  38. [Root @ node03 scsi] # ll # can be seen in content written in node02
  39. A total of 36
  40. -rw ------- 1 root 980, August 12 00:59 anaconda-ks.cfg
  41. -rw-r - r-- 1 th root root 10197 Aug 12 00:59 install.log
  42. -rw-r - r-- 1 th root root 3161 Aug 12 00:59 install.log.syslog
  43. drwx ------ 2根root 16384 Aug 12 00:58 lost + found
  44. [Root @ node03 scsi] #cp / etc / passwd / scsi / # to write new passwd file on node03, node02 verification
  45. [root @ node03 scsi]#ll
  46. A total of 40
  47. -rw ------- 1 root 980, August 12 00:59 anaconda-ks.cfg
  48. -rw-r - r-- 1 th root root 10197 Aug 12 00:59 install.log
  49. -rw-r - r-- 1 th root root 3161 Aug 12 00:59 install.log.syslog
  50. drwx ------ 2根root 16384 Aug 12 00:58 lost + found
  51. -rw-r - r-- 1 th root root 901 Aug 12 01:11 passwd
  52. [root @ node03 scsi]#
  53. # Passwd file in identifying alternative node02 node03 written, there is no synchronization, because we use the ext4 file system does not support the use of GFS can be synchronized
  54. [root @ node02 scsi] #ll
    Total 36
    -rw ------- root. 1-Aug 12 is 00:59 Anaconda 980 the root-the ks.cfg
    -rw-R & lt - r--. 1 root root 10197 Aug 12 00: 59 the install.log
    -rw-R & lt - r--. 1 12 is root-Aug 3161 00:59 install.log.syslog the root
    drwx ------ 2 root root 16384 Aug 12 00:58 lost + found
    [root @ node02 scsi] # 
 

 

 

Guess you like

Origin www.cnblogs.com/regpression/p/11892368.html