Two machines in Linux use iSCSI to complete a disk share from a server to B server

Source: Internet
Author: User

Idea: first need to support iSCSI function in two servers, then need to install two software server installation scsi-target....rpm        inside the/cluster storge ./media/clusterstorage            scsi-target-utils-1.0.8-0.el5.i386.rpm Client Install iSCSI ... Rpm            in the/server/... Inside                                                           iscsi-initiator-utils-6.2.0.872-6.el5.i386.rpm
The server opens the sharing function, the partition SDB1 shares to the server, the client logs on the iSCSI, can save the file on the client, stores on the service side
Install: Mount CDROM to/media set the Yum library file directory       Vi/etc/yum.repos.d/server.repo    File:///media/Server
Enter/media/clusterstorageRPM-IVH scsi-target-utils-1.0.8-0.el5.i386.rpm
Installing the server-side iSCSI may require a dependency package to install the three dependent packages yum-y installs libverbs* && librdmacm*        Sometimes this will be an error, you need to import the followingrpm--import/etc/pki/rpm-gpg/rpm*Cd/media/clusterstorageRPM-IVH perl-config-general-2.40-1.el5.noarch.rpm

Install iSCSI again
Installation Successful
Servie TGTD Restart        Open ServiceChkconfig TGTD on        Boot from boot
Modify the TGTD configuration file to share the SBD1 partition (provided that the partition SDB1 has been created and formatted MKFS.EXT3/DEV/SDB1)
Vi/etc/tgt/targets.conf


Tgtadm--lld iSCSI--op show--mode Target        View Shared


to the second server:Installing the client's iSCSI RPM installation first mount the CDROM to/media
rpm-ivh/media/server/iscsi-initiator-utils-6.2.0.872-6.el5.i386.rpm
Restart Iscsiservice iSCSI Restartchkconfig iSCSI on        Set boot auto-start

Iscsiadm--mode discoverydb--type sendtargets--portal 192.168.18.104 --discover discovering devices, viewing names

Iscsiadm--mode node--targetname iqn.2008-09.com.example:disk1--portal 192.168.18.104:3260--login /c7> Landing Equipment

Now we have added a hard disk, which is partitioned on the server, but it is recognized as a disk by the client.

Now that the share is complete, test it below: On the client side, SDB mounts to/data, creates several files, and then checks to the server to see if it is saved on the servers
Mount SDB to/data

20 Files created

Then, on the server side, see if there are 20 additional files added to the partition:

You can set up an automatic mount operation: Vi/etc/fstab













From for notes (Wiz)

Two machines in Linux use iSCSI to complete a disk share from a server to B server

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.