Set up iSCSI and use multi-path in RHEL6.3

Source: Internet
Author: User
We can use IP-SAN-based storage iscsi under RHEL6.3 without storage cabinet support when building a cluster. Let's build it. Preparations: node1rhel6.3eth0: 192.168.1.50, eth1: 10.1.1.1scsinode2rhel6.3eth0: 192.168.1.51, eth1: 10.1.1.2i

We can use IP-SAN-based storage iscsi under RHEL6.3 without storage cabinet support when building a cluster. Let's build it.

Preparations:

Software packages required for the host name operating system IP Address

Node1 rhel 6.3 eth0: 192.168.1.50, eth1: 10.1.1.1 scsi

Node2 rhel 6.3 eth0: 192.168.1.51, eth1: 10.1.1.2 iscsi-utils

Here we define node1 as the shared disk server, and node2 as the accessed client. Prepare a new disk for node1 and divide it into one partition. Here we define it as/dev/sdb1.

1. install and configure the startup service.

1. Configure the yum source on node1. Rhel6.3 comes with scsi software.

1234567891011 vim /etc/yum.repos.d/Server.repo[Server]name=hahabaseurl=file:///media/Serverenabled=1gpgcheck=0[Server2]name=hahabaseurl=file:///media/HighAvailabilityenabled=1gpgcheck=0

2. Install Server-side scsi Software

1 yum install -y scsi*

3. Enter the definition command, add the LUN command, and form a configuration file.

 

1234 [root@node1 ~]# tgtadm --lld iscsi --mode target --op new --tid 1 -T disk[root@node1 ~]# tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 1 -b /dev/sdb1[root@node1 ~]# tgtadm --lld iscsi --mode target --op bind --tid 1 -I ALL[root@node1 ~]# tgt-admin --dump > /etc/tgt/targets.conf

4. Start the service and set Automatic startup.

 

12 service tgtd startchkconfig tgtd on

2. Discover on the node and log on to the disk.

 

12 [root@node2 ~]# iscsiadm -m discovery -t sendtargets -p 192.168.1.50[root@node2 ~]# iscsiadm -m node -T disk -p 192.168.1.50 -l

In the first step of the operation, the disk name will appear. Here, according to the definition of node1, our name is disk. At this time, fdisk-l will see a new disk.

 

3. To make the bottom layer of scsi stable, we have set two IP addresses on node2 and two network ports connected to node1. here we call it multi-path.

12 [root@node2 ~]# iscsiadm -m discovery -t sendtargets -p 10.1.1.1[root@node2 ~]# iscsiadm -m node -T disk -p 10.1.1.1 -l

At this time, we will find two identical disks. We can verify the following:

 

1234 scsi_id -u -g /dev/sdb1IET_00010001scsi_id -u -g /dev/sdc1IET_00010001

Because the two devices have the same WWID, they are the same device.

4. Next we will start to configure multi-path.

1 yum install device-mapper\*
1 cp /usr/share/doc/device-mapper-* /etc

5. Load and start the module.

 

12 modprobe dm-multipath/etc/init.d/multipathd start

 

12 multipath -llls /dev/mapper/

This is a simple iscsi multi-path configuration.

For more information about RedHat, see RedHat topic page http://www.linuxidc.com/topicnews.aspx? Tid = 10

Related Article

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.