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
- [root @ node01〜]#yum -y install scsi-target-utils #yum安装
- [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
- [Root @ node01~] #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 @ node01〜]#
- [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
- [ Root NODE01~ @ ] # VIM's / etc / TGT / target . conf # add the following, the following is the format iscsi
- <Target iqn. 2016--08. cn. node01. www: target4_scan> # name
- Support - Store / dev / sdb1 # shared partition
- Originator - address 192. 168. 137. # 102 allows access address
- Originator - address 192. 168. 137. 103
- vendor_id node labeled #
- product_id target4 # Number
- </ Target>
- [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
- [root @ node02〜]#yum -y install iscsi-initiator-utils
- [Root @ node02~] #iscsiadm -m find -t sendtargets -p 192.168.137.101 # find the target storage
- Start iscsid: [OK]
- 192.168.137.101:3260,1 iqn.2016-08.cn.node01.www:target4_scan
- [root @ node02〜]#
- [Root @ node02~] # / etc / init.d / iscsid status # View Client Services
- iscsid (pid 1153) is running ...
- [root @ node02〜]#
- [Root @ node02~] # tree / var / lib / iscsi / # find the target service, information will be written in / var / lib / iscsi directory
- / var / lib / 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,默认-> /var/lib/iscsi/nodes/iqn.2016-08.cn.node01.www: target4_scan / 192.168.137.101,3260,1
- │└──st_config
- ├──slp
- └── static
- 10 directory, two files
- [root @ node02〜]#
- [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
- [root @ node02〜]#ll / dev / sdb
- brw-rw ---- 1 root disks 8,8 Aug 16 00:48 / dev / sdb
- [Root @ node02~] #lsblk #lsblk view block information command
- 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 - [root @ node02〜]#
- [Root @ node02~] # tree / var / lib / iscsi /
- 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 - [Root @ node02~] #iscsiadm -m node -T iqn.2016-08.cn.node01.www: target4_scan -u # scsi unloading equipment
- Cancellation of the session [sid: 1, target: iqn.2016-08.cn.node01.www: target4_scan, Portal: 192.168.137.101,3260]
- Successful logout [sid: 1, target: iqn.2016-08.cn.node01.www: target4_scan, Portal: 192.168.137.101,3260].
- [root @ node02〜]#lsblk
- 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 - [Root @ node02~] #iscsiadm -m node -T iqn.2016-08.cn.node01.www: target4_scan -l # Login scsi devices
- Login [iface: default target: iqn.2016-08.cn.node01.www: target4_scan, Portal: 192.168.137.101,3260] (more)
- Successfully logged on to [iface: default target: iqn.2016-08.cn.node01.www: target4_scan, Portal: 192.168.137.101,3260].
- [root @ node02〜]#lsblk
- 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 - [root @ node02〜]#
2.3 scsi devices, and make a write operation
Click ( here) folded or unfolded
- [root @ node02〜]#df -h
- File system size has been used in the percentage of the available installed
- / dev / sda2 9.9G 869M 8.5G 10%/
- tmpfs 238M 0 238M 0%/ dev / shm
- / Dev / sda1 194M 27M 158M 15% / boot
- / Dev / sr0 3.6G 3.6G 0 100% / Media
- [root @ node02〜]#
- [Root @ node02~] #fdisk / dev / sdb # partition
- [Root @ node02~] # lsblk # view the partition block
- 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 - [Root @ node02~] # mkfs.ext4 / dev / sdb1 # formatted partition
- mke2fs 1.41.12 (2010 Nian 5 17 May)
- File system label =
- OS type: Linux
- Block size = 4096 (log = 2)
- Fragment size = 4096 (log = 2)
- Stride = 0, stripe width = 0
- Inode 328656, 1312222
- Superuser has reserved blocks 65611 (5.00%)
- The first data block = 0
- Maximum number of blocks filesystem = 1346371584
- Group 41
- Each 32,768 blocks, each segment 32768
- Each group inode 8016
- Superblock stored on the backup block:
- 32768、98304、163840、229376、294912、819200、884736
- Writing inode table: Finish
- Create a log (32768): Completed
- Write super block and file system billing information: Completed
- The installed file system will automatically check once every 21 times, or
- 180 days, whichever comes first. Use tune2fs -c or -i coverage.
- [Root @ node02~] #mkdir / scsi # Mount partition to the new directory / scsi
- [root @ node02〜]#mount / dev / sdb1 / scsi /
- [root @ node02〜]#df -h
- File system size has been used in the percentage of the available installed
- / dev / sda2 9.9G 869M 8.5G 10%/
- tmpfs 238M 0 238M 0%/ dev / shm
- / Dev / sda1 194M 27M 158M 15% / boot
- / Dev / sr0 3.6G 3.6G 0 100% / Media
- / dev / sdb1 5.0G 139M 4.6G 3%/ scsi
- [Root @ node02~] #cp -r / root / * / scsi / # write verification
- [root @ node02〜]#ll / scsi /
- A total of 36
- -rw ------- 1 root 980, August 12 00:59 anaconda-ks.cfg
- -rw-r - r-- 1 th root root 10197 Aug 12 00:59 install.log
- -rw-r - r-- 1 th root root 3161 Aug 12 00:59 install.log.syslog
- drwx ------ 2根root 16384 Aug 12 00:58 lost + found
- [root @ node02〜]#df -h / scsi /
- File system size has been used in the percentage of the available installed
- / dev / sdb1 5.0G 139M 4.6G 3%/ scsi
- [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
- [root @ node03〜]#yum -y install iscsi-initiator-utils
- [root @ node03〜]#
- [root @ node03〜]#iscsiadm -m发现-t sendtargets -p 192.168.137.101
- Start iscsid: [OK]
- 192.168.137.101:3260,1 iqn.2016-08.cn.node01.www:target4_scan
- [Root @ node03~] #yum -y installation tree
- [Root @ node03~] # tree / var / lib / iscsi /
- / var / lib / 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,默认-> /var/lib/iscsi/nodes/iqn.2016-08.cn.node01.www: target4_scan / 192.168.137.101,3260,1
- │└──st_config
- ├──slp
- └── static
- 10 directory, two files
- [Root @ node03~] # / etc / init.d / iscsid restart
- Stop iscsid:
- Start iscsid: [OK]
- [root @ node03〜]#lsblk
- 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 - [Root @ node03~] # / etc / init.d / iscsi restart
- Stop iscsi: [OK]
- Start iscsi: [OK]
- [Root @ node03~] # lsblk # can see the device sdb1
- 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 - [root @ node03〜]#
- [root @ node03〜]#
- [root @ node03〜]#mkdir / scsi
- [Root @ node03~] #mount / dev / sdb1 / scsi / # mount
- [root @ node03〜]#cd!$
- cd / scsi /
- [Root @ node03 scsi] # ll # can be seen in content written in node02
- A total of 36
- -rw ------- 1 root 980, August 12 00:59 anaconda-ks.cfg
- -rw-r - r-- 1 th root root 10197 Aug 12 00:59 install.log
- -rw-r - r-- 1 th root root 3161 Aug 12 00:59 install.log.syslog
- drwx ------ 2根root 16384 Aug 12 00:58 lost + found
- [Root @ node03 scsi] #cp / etc / passwd / scsi / # to write new passwd file on node03, node02 verification
- [root @ node03 scsi]#ll
- A total of 40
- -rw ------- 1 root 980, August 12 00:59 anaconda-ks.cfg
- -rw-r - r-- 1 th root root 10197 Aug 12 00:59 install.log
- -rw-r - r-- 1 th root root 3161 Aug 12 00:59 install.log.syslog
- drwx ------ 2根root 16384 Aug 12 00:58 lost + found
- -rw-r - r-- 1 th root root 901 Aug 12 01:11 passwd
- [root @ node03 scsi]#
- # 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
- [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] #