How Linux builds iSCSI shared storage

Source: Internet
Author: User
Tags file system linux

iSCSI Service-Side IP192.168.254.172

Client 1 192.168.254.46

Client 2 192.168.254.158

Service-side configuration

1, the service side installs the Scsi-target-utils

[Root@localhost ~]# Yum Install scsi-target-utils-y

2, if there is a separate partition, you can use a separate partition, if there is no suitable partition can be dd a large file as a shared disk

[Root@localhost/]# dd If=/dev/zero of=/disk1 bs=1m count=3000

3000+0 Records in

3000+0 Records out

3145728000 bytes (3.1 GB) copied, 11.618 seconds, 271 MB/s

3, modify the iSCSI main configuration file

[Root@localhost ~]# vi/etc/tgt/targets.conf

<target iqn.2013-12.com.make:ws.httpd>

Backing-store/disk1

</target>

4. Start TGTD Service

[Root@localhost ~]#/ETC/INIT.D/TGTD Restart

Stopping SCSI target daemon:stopping target Framework Daemon

[OK]

Starting SCSI target daemon:starting Target Framework Daemon

Second, the client configuration

1, install the client

[Root@zabbix-client1 ~]# Yum Install iscsi-initiator-utils-y

2, start the client

[Root@zabbix-client1 ~]# iscsiadm-m discovery-t sendtargets-p 192.168.254.172

Starting iscsid:[OK]

192.168.254.172:3260,1 iqn.2013-12.com.make:ws.httpd

192.168.254.172:3260,1 Iqn.2013-12.com.make:ws.mysqld

3. Use client to find Mount storage

[Root@zabbix-client1 ~]# iscsiadm-m node-t iqn.2013-12.com.make:ws.httpd-l

Logging in to [Iface:default, TARGET:IQN.2013-12.COM.MAKE:WS.HTTPD, portal:192.168.254.172,3260] (multiple)

Login to [Iface:default, TARGET:IQN.2013-12.COM.MAKE:WS.HTTPD, portal:192.168.254.172,3260] successful.

4. Partition the two disks mounted on the client and format them into EXT4 format file system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.