Multi-Path of Devicemapper

Source: Internet
Author: User

Multi-Path of Devicemapper
1. Function: Multiple physical devices can be combined into a logical device, can do a common merge, or achieve similar raid0, can also be used to shield the hard drive of the bad sector, but also do LVM snapshots to back up the database, or through 0 of device files to simulate very large devices, for testing functions. Device Mapper is the underlying technology for LVM and multipating.
2. Installation package: Device-mapper Device-mapper-multipath
3. How it works: Create logical devices (correspondence between physical devices and logical devices per sector) through mapping table. Table content includes: The starting sector of a logical device: typically a 0 logical device sector number type (linear linear, continuous combination; striped stripe; error masking bad path; snapshot snapshot; zero 0 device)
4. Calculation of disk sector: 1 sector = 512 bytes B 1kb=1024b sector size kb= sector number *512/1024 such as 10G disk, the number of sectors is: 10000000kb= sector number *512/1024=20000000 sector #blockdev-- Getsize/dev/sda6 viewing the number of device sectors #echo "0 ' blockdev--getsize/dev/sda6 ' Linear/dev/sda6 0" | Dmsetup Create Mydevice creates a logical device from table 0 means that this logical device starts with 0 sectors, has 208,782 sectors, linear represents continuous, and/dev/sda6 0 represents the start of a logical device from the No. 0 sector of/dev/sda6. When a device uses the remaining space to make a logical device, the sector is not starting from 0. Restart will not take effect until the following write boot script
5.linear type Device features: The sectors of multiple physical partitions are grouped together into a single logical device. 0 20000 linear/dev/sda1 0 20000 60000 LINEAR/DEV/SDB1 0 Note: Logical device from 0 to sector from SDA1 from 0 sector start fetch 20000 sectors, logical devices starting from 20000 sectors, Starting from the 0 sectors of SDB1, fetch 60,000 sectors, 80,000 sectors of the logical device. Implement command #echo "0 20000 linear/dev/sda1 0\n20000 60000 linear/dev/sdb1 0" | Dmsetup Create Mydevice
6.stripe stripe: chunksize to Disk 0 striped 2 256/dev/sda1 0/dev/sdb1 0 Note: Logical devices start from 0 sectors to 1024 sectors, type striped, 2 devices, Chunksiz E 256KB 512 sectors starting from the 0 sectors of/DEV/SDA1 and/DEV/SDB1 (note that the number of sectors must be multiples of chunksize) command implementation #echo "0 1024x768 striped 2 256/dev/sda1 0/dev/sdb1 0 "| Dmsetup Create Mydevice
7.error: Remove error sector by synthetic logic device 0 LINEAR/DEV/SDA1 0 error 181 LINEAR/DEV/SDB1 0 command implementation #echo "0 linear/dev/sda1 0\ N80 error\n181 linear/dev/sdb1 0 "| Dmsetup Create Mydevice
8.snapshot Logical Volume Snapshot feature: After a snapshot is created, 3 devices (original device, snapshot device, cow device) appear if the data is not changed, read data is read from the original device, the changed data is stored in the cow region, and the snapshot device holds the data from the original device. #echo ―0 Snapshot/dev/sda1/dev/vg0/realdev P 16‖| Dmsetup Create Mydevice creates a snapshot of/dev/sda1 from 0 sectors to 1000 sectors, with the name Realdev,p indicating that the next boot is still in effect, and 16 is chunksize
9.zero 0 Device features: Similar to/dev/zero, but he is a block device, can not write things, generally used for testing, to create a large file system for testing. For example, to test the creation of 10T size devices with ext3 to format #export hugesize=$[100 * (2**40)/512] 100T sector number 2**40 2 40 #echo "0 $HUGESIZE Zero" | Dmsetup Create Zerodev generates files in/dev/mapper/zerodev ext3 each partition with a maximum support of 2TB 10. Multipath Features: Multipath features to provide line redundancy, monitor each link, and automatically switch links when the link fails. and automatically resumes operation to prevent a single point of failure. Generated device name/dev/dm-x type: When two paths are equal: Load balancer When two path priorities are unequal: redundant #multipath列出多路径设备, background needs to turn on MULTIPATHD service, priority size 0-1024 experimental steps: Storage side configuration Dual NIC, Configuration/ Dev/sda6 Installing the Device-mapper-multipath package for the iSCSI device server side, connecting the iSCSI device #vi/etc/multipath.conf comment out blacklist {devnode "*" Different vendor configurations are not the same} uncomment default{Udev_dir ... path_grouping_policy failover (judging execution policy based on failure domain)} #chkconfig multipathd on #servic E multipathd Restart after generating the device location under/dev/mpath/, can make file system, Mount #multipath –l query device status
11.FC Storage Storage Set up a RAID device, RAID establishes a mapping relationship with the HBA card WWN number (which HBA card is used for which disk device) WWN is the authorization name of the HBA card, which distinguishes one or a group of network connections, representing a connection on the network

For more highlights, please follow: http://bbs.superwu.cn

Focus on the two-dimensional code of Superman Academy:

Follow the Superman college Java Free Learning Exchange Group:

Devicemapper of multiple paths

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.