Configure iSCSI storage and multi-path functions in Linux

Source: Internet
Author: User

I. Overview
 
If you encounter large storage and multi-partition mounting in linux, multiple paths are displayed. In this article, configure multiple paths to introduce how to use the iSCSI storage device connection and installation configuration in Linux OS, in particular, the Mutipath multi-path function provided by the Linux operating system is one of the main options for multi-path in Linux. This article focuses on the introduction and description.
 
Ii. installation and configuration steps and methods
 
2.1 install the iSCSI package on the client
 
(1) install the iscsi initiator package on the server. Find the installation package from the OS installation CD. Whether the installation is successful can be confirmed through the following command line
 
[Root @ localhost ~] # Rpm-qa | grep iscsi
 
Iscsi-initiator-utils-6.2.0.872-10.el5
 
(2) In the/etc/iscsi/directory/etc/iscsi/initiatorname. iscsi

Check this file to find the iqn number on the host. You need to add a HOST to the disk management software.
 
2.2 divide disk array disk space
 
After configuring RAID on the disk array based on the disk array device manual and successfully ing the LUN to the server, you need to make reasonable planning and use of the disk space as needed.
 
The steps and methods for configuring disk arrays vary depending on the device manual.
 
2.3 start the iSCSI Device
 
(1) Start the ISCSI service on the server:
 
[Root @ localhost ~] # Service iscsi start
 
(2) query the iqn Number of the target of the ISCSI Device (HP storageworks P2000G3): (required)
 
[Root @ localhost ~] # Iscsiadm-m discovery-t sendtargets-p 192.168.100.102
 
192.168.100.102: 3260,1 iqn.1986-03.com. hp: storage. p2000g3.114513bbf6
 
(3) log on to the iSCSI storage device
 
[Root @ localhost ~] # Iscsiadm-m node-T iqn.1986-03.com. hp: storage. p2000g3.114513bbf6-p
 
192.168.100.102: 3260-l
 
The iqn number is the number obtained from the preceding query, and the ip address is the address mapped to the iscsi port in the iscsi storage.
 
(4) view disks:
 
[Root @ localhost ~] # Fdisk-l
 
Disk/dev/cciss/c0d0: 146.7 GB, 146778685440 bytes
 
255 heads, 32 sectors/track, 35132 cylinders
 
Units = cylinders of 8160*512 = 4177920 bytes
 
Disk/dev/sda: 10999.9 GB, 10999999954944 bytes
 
255 heads, 63 sectors/track, 1337340 cylinders
 
Units = cylinders of 16065*512 = 8225280 bytes
 
Disk/dev/sda doesn't contain a valid partition table
 
Disk/dev/sdb: 10999.9 GB, 10999999954944 bytes
 
255 heads, 63 sectors/track, 1337340 cylinders
 
Units = cylinders of 16065*512 = 8225280 bytes
 
Disk/dev/sdb doesn' t contain a valid partition table
 
(5) Add the target of another ISCSI path in the same way.
 
(Note: An iSCSI port of an ISCSI disk has an iqn and an IP address)
 
After the fdisk-l is added, you can see two drive letters. Their capacity is the same. These two drive letters correspond to the same LUN under the same disk array.
 
(6) After the ing is completed, run the following command to view the ing result:
 
[Root @ localhost ~] # Iscsiadm-m node
 
192.168.100.102: 3260,1 iqn.1986-03.com. hp: storage. p2000g3.114513bbf6
 
192.168.100.101: 3260,2 iqn.1986-03.com. hp: storage. p2000g3.114513bbf6
 
2.4 install the DM-multipath package
 
To implement multi-path access and Failover for storage devices, you need to run the multipath service, which has been installed in the OS. If the following command is not executed. The principle of Multipath service is that a real virtual disk in the iSCSI magnetic array provides ing to the external through the ports connected to the two Redundant Array controllers. Therefore, two physical disks can be seen on the server, however, this disk corresponds to a real virtual disk, so the two paths can implement failover and load balancing.
 
Rpm-ivh device-mapper-1.02.13-6.9.i686.rpm
 
Rpm-ivh multipath-tools-0.4.7-34.18.i686.rpm
 
After the installation is complete, run the modprobe dm_multipath command to load the corresponding module. You can run the following command to check whether the installation is normal:
 
Lsmod | grep dm_multipath

2.5 modify and create a configuration file
 
(1)/etc/multipath. conf is the configuration file of the multi-path software. Most of the configurations are commented out. You can save it as a backup and create a new multipath. conf file to edit the new configuration file. The following parameters are useful: Other parameters can be commented out:
 
Defaults {
 
User_friendly_names yes
 
Udev_dir/dev
 
Path_grouping_policy multibus
 
Failback immediate
 
No_path_retry fail} Save and quit

  • 1
  • 2
  • Next Page

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.