Deploy iSCSI network storage

Copyright: Jiang Productions, All Rights Reserved. Https://blog.csdn.net/weixin_44953658/article/details/90750812

A, iSCSI Introduction

ISCSI technology combined with each other to achieve the physical disk device and TCP / IP network protocol, such that a user can easily access the shared storage resources provided by the remote machine room Internet.

Main functions: to mount the hard drive remotely via Ethernet service

The current hard drive interface types are:

  1. IDE is a mature and stable, inexpensive parallel transmission interface
  2. SATA is a transmission faster, more complete data check serial transmission interface
  3. SCSI is a standard for system-level generic interface between the computer and a hard disk device, optical drives and the like, having a system resource occupancy rate, high speed, transmission speed, etc.

ISCSI SCSI interface is a new storage technology combined with the Ethernet technology, the network may transfer commands and data SCSI interface, implements memory resource sharing across the region, the storage capacity can be extended in a stop state

ISCSI storage technology is very convenient, a great number occurred in the form of access to storage resources, get rid of the limitations of the physical environment, but also can store multiple server resources allocated to common use, it is a highly recommended store technology. However ISCSI storage technology has been constrained network speed, conventionally, a hard disk device is directly through data transmission bus on the motherboard, it is necessary to make the Internet now and as carrier data transmission channel, the transmission rate and stability are the technical bottlenecks ISCSI

Server running Linux ISCSI protocol will be based on commands and data to the hard disk device packaged into a standard TCP / IP packet, and then transmitted via Ethernet to the destination storage device, and when the destination device receives the data packet, but also based on ISCSI protocol to TCP / IP data to the hard disk Austria decompression device commands and data

Second, expand operations

Server configuration

1. configure yum repository to install iscsi program

[root@localhost ~]#yum -y install targetd targetcli

[root@localhost ~]#systemctl start targetd

[root@localhost ~]#systemctl enable targetd

2. Configure ISCSI server to share resources

[root@localhost ~]# targetcli		//出现/>表示成功进入交互式模式
targetcli shell version 2.1.fb46
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'.

/>	ls

Here Insert Picture Description
Red frame indicates that the current directory
yellow box indicates that if there is any subdirectories
| o- represents subdirectory directory

/>cd backstores/block

/backstores/block> create disk0 /dev/md0
	Created block storage object disk0 using /dev/md0.

3. Create iscisi target name and configure a shared resource

/backstores/block> cd /

/> cd /iscsi

/iscsi> create
Created target iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.e0a3bdb27cc4.
Created TPG 1.
Global pref auto_add_default_portal=true
Created default portal listening on all IPs (0.0.0.0), port 3260.

/iscsi> ls		//发现有了共享资源目录

Here Insert Picture Description
Red box is the system automatically generates a shared resource name
yellow box contains the contents of the blue box and green box,
blue box to define a list box control
the green box to define access ip address

/iscsi> cd tpg1

/iscsi> cd luns

/iscsi> create /backstores/blocks/disk0			//将此字符串共享资源与	disk0硬盘进行绑定

4. Set ACL

/iscsi/iqn.20...d80/tpg1/luns> cd ..

/iscsi/iqn.20...c356ad80/tpg1> cd acls

/iscsi/iqn.20...cc4/tpg1/acls> create iqn.2003-01.org.linux-iscsi.localhost.
.x8664:sn.e0a3bdb27cc4:client		//用于与客户端进行验证使用

Here Insert Picture Description

5. Set the IP address of the iSCSI listening and port number of the server

/iscsi/iqn.20...cc4/tpg1/acls> cd ..

/iscsi/iqn.20...bdb27cc4/tpg1> cd portals/

/iscsi/iqn.20.../tpg1/portals> delete 0.0.0.0 3260		//必须先删除默认的否则出错
	Deleted network portal 0.0.0.0:3260

/iscsi/iqn.20.../tpg1/portals> create 192.168.81.200
	Using default IP port 3260
	Created network portal 192.168.81.200:3260.

6. Check whether ISCSI fully configured

Here Insert Picture Description
7. Set the firewall to allow release port 3260

[root@localhost ~]# systemctl restart targetd.service		//重启ISCSI程序

[root@localhost ~]# firewall-cmd --permanent --add-port=3260/tcp
	success

[root@localhost ~]# firewall-cmd --reload
	success

Linux Client Configuration

1. Install Client Tools

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

2. Edit the main client configuration file

[root@localhost ~]# vim /etc/iscsi/initiatorname.iscsi
写入:
nitiatorName=iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.8fc9f96bb3af:c
lient

3. Restart Service

[root@localhost ~]# systemctl restart iscsid

4. Use the tool to scan a remote server iscsiadm

[root@localhost ~]# iscsiadm -m discovery -t st -p 192.168.81.200
   192.168.81.200:3260,1.iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.8fc9f	96bb3af

5. Log

[root@localhost ~]#iscsiadm -m node -T iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.8fc9f96bb3af -p192.168.81.200 --login
Logging in to [iface: default, target: 	
iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.8fc9f96bb3af, portal: 192.168.81.200,3260] (multiple)
Login to [iface: default, target: iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.8fc9f96bb3af, portal: 192.168.81.200,3260] successful.

6. find more than one new hard drive as / dev / sdb

[root@localhost ~]file /dev/sdb

7. uninstall the hard disk on remote host

[root@localhost ~]
iscsiadm -m node -T iqn.2003-01.org.linux-iscsi.linuxprobe.x8664:sn.d497c356ad80 -u

Windows Client

1. Start ISCSI Services
Control Panel -> Programs and Features -> system on the left and Security -> Administrative Tools -> ISCSI initiated the process to find

The first time you start suggesting you do not open Microsoft ISCSI service, the point is to get away

2. Connect
Click the Target tab -> write ip address, point Quick Links -> Done -
found there have been a shared resource
Here Insert Picture Description
Configuration
Click Configuration tab -> Change -> initiator name written on, is created on the server and that the shared resource directory with the same name - connections> click away -> return to the target tab
Here Insert Picture Description

4. Verify that the
computer right click -> Administration -> Disk Management -> find more than a hard drive

Summary: After two clients at the same mount, while formatting, there is still a separate file

Third, expand

Iscsi server implements a multiple hard drives to share

1. Create a new need in the disk1 / backstores / blocks /

create disk1 /dev/sdg

2. Go / iscsi

create

3. Enter the characters shared directory

cd iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.4a0dd1c81e40

4. Go to the directory tpg

	cd tpg1

The access control list

	cd acls
	create iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.4a0dd1c81e40 :clent

6. association

	cd luns
	create /beackstores/blocks/disk1

7. Define the ip access

	cd portals
	create 192.168.81.200

carry out
Here Insert Picture Description

The last big picture

Here Insert Picture Description

Guess you like

Origin blog.csdn.net/weixin_44953658/article/details/90750812