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=haha baseurl=file:///media/Server enabled=1 gpgcheck=0 [Server2] name=haha baseurl=file:///media/HighAvailability enabled=1 gpgcheck=0 |
2. Install Server-side scsi Software
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 start chkconfig 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/sdb 1IET_00010001 scsi_id -u -g /dev/sdc 1IET_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 -ll ls /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