In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Today I'll show you what are the specific steps for building a RAID 10 array in a Linux system. The content of the article is good. Now I would like to share it with you. Friends who feel in need can understand it. I hope it will be helpful to you. Let's read it along with the editor's ideas.
Introduction to RAID 10 Array: Raid 10 is a combination of Raid0 and Raid1, which uses parity to mirror stripe sets, so it inherits the speed of Raid0 and the security of Raid1. We know that RAID 1 is a redundant backup array here, while RAID 0 is responsible for the read and write array of data. In fact, figure 6 is just a RAID 10 mode. More often, two channels are separated from the main channel to do Striping operation, that is, to split the data, while each path is divided into two ways to do Mirroring operation, that is, to mirror each other.
Building a RAID 10 array: there are two possible ways to build a RAID 10 array: the complex method (done in one step) and the nesting method (first create two or more RAID 1 arrays and then use them to form RAID 0). This article describes the complex process of creating an RAID 10 array because it can use even or odd disks to create an array and can be managed as a single RAID device, while the nesting rule is just the opposite (only an even number of disks are allowed and must be managed as nested devices, that is, RAID 1 and RAID 0 are managed separately).
Suppose your machine has mdadm installed and running the corresponding daemon, see this article for details. Also assume that each disk has been divided into a primary partition sd [bcdef] 1 (LCTT: a total of five disks, in this case, slave sdb-sdf). Use the command:
Ls-l / dev | the output seen by grep sd [bcdef] should be as follows:
Then use the following command to create an RAID 10 array (LCTT):
# mdadm-create-verbose / dev/md0-level=10-raid-devices=4 / dev/sd [bcde] 1-spare-devices=1 / dev/sdf1
When the array is created (up to a few minutes), execute the command
# mdadm-the output of detail / dev/md0 should be as follows:
You need to pay attention to the following before going any further.
Used Dev Space represents the capacity of each disk used by the array.
Array Size represents the overall size of the array. The size of the RAID 10 array is calculated by (NC) / M, where N is the number of active disks, C is the capacity of each active disk, and M is the number of disks in each mirror. In the case of this article, this value equals (48GiB) / 2 = 16GiB.
Layout is the details of the entire data layout. The possible layout values are shown below.
N (default option): represents the nearest (near) copy. Multiple copies of a data block have the same offset on different disks. This layout provides read and write performance similar to the RAID 0 array.
O represents an offset (offset) copy. Blocks are not copied in stripes, but the entire stripe is copied together, but loops are disrupted, so blocks copied in the same partition appear on different disks. As a result, subsequent copies of one block appear on the next disk, block after block. To use this layout in a RAID 10 array, add the-layout=o2 option to the command to create the array.
F stands for far copies (multiple copies have different offsets on different disks). This layout provides better read performance but worse write performance. Therefore, it is the best choice for systems that read far more than write. To use this layout in the RAID 10 array, add-layout=f2 to the command to create the array.
The numbers following the layout options n, f, and o represent the number of copies of each block required. The default value is 2, but it can be a value between 2 and the number of disks in the array. Providing a sufficient number of copies minimizes the impact of Ipicuro on a single disk.
Chunk Size, as described by Linux RAID wiki, is the smallest data unit written to disk. The optimal chunk size depends on the rate of Iramp O operations and the associated file size. For a large number of writes, you can get lower overhead by setting a relatively large chunk, but smaller chunk performs better for arrays that mainly store small files. To specify a chunk size for RAID 10, add-chunk=desiredchunksize to the command to create the array.
Unfortunately, there is no global strategy to improve performance by setting a size, but you can refer to some of the following scenarios.
File system: overall, XFS is said to be the best, and of course EXT4 is also a good choice.
Optimal layout: remote layout improves read performance, but degrades write performance.
Number of replicas: more copies minimize the impact of Imax O, but more disks cost more.
Hardware: in the same environment, SSD can bring more performance improvements than traditional (mechanically rotating) disks
The above is the whole content of the specific steps of building a RAID 10 array in the Linux system. For more information related to the specific steps of building a RAID 10 array in the Linux system, you can search the previous articles or browse the following articles to learn! I believe the editor will add more knowledge to you. I hope you can support it!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.