当前位置:网站首页>RAID disk array
RAID disk array
2022-06-12 22:06:00 【A thought of going to war】
List of articles
One 、RAID Introduce
RAID, Full name Redundant Arrays of Inexpensive Disk , Independent redundant disk array .
Disk arrays are It consists of many independent physical hard disks , Combined into a large capacity hard disk group , So as to provide higher storage performance than a single hard disk and provide data backup technology .
RAID Can be realized including Improve I/O( Reading and writing ) Ability 、 Improve durability 、 Improve data redundancy And so on .
DAID How to implement :
- External connection : Provide adaptability through expansion cards
- Built in : motherboard integrated DAID controller , It is usually installed before the operating system BIOS Set in the
- Software style : Through the software of the operating system , For example, Qunhui's NAS
The different ways in which the entire column of disks is composed are called RAID Level , Most commonly used RAID There are four kinds of :
RAID 0、RAID 1、RAID 5、RAID 10(10 Not ten , It is 1+0, Do it first RAID 1, Do it again RAID 0)
however , This is not RAID All levels of , There are also RAID 2、DAID 3、RAID 4、RAID 6、RAID 50 wait , It's just that it's not often used in production environments for performance reasons , So as to be eliminated or carried away by a stroke .
Two 、 Several commonly used RAID
1.RAID 0
RAID 0 , Also called striped storage . It's in all RAID Highest storage performance in class , The principle is to store a continuous piece of data on different hard disks ( The process is carried out simultaneously ). If you want to achieve RAID 0, At least two hard disks are required .
If I have a continuous piece of data 123456789, Three hard disks are used at the same time a,b,c Did RAID 0, Then its storage mode is 1 save a,2 save b,3 save c,4 save a,5 save b,6 save c,7 save a,8 save b,9 save c, And so on , And the stored processes are simultaneous , thus it can be seen , With the same data ,RAID 0 The storage speed of increases with the increase of hard disk **( Single hard disk N times ,N by RAID 0 Number of hard disks in )**.
however ,RAID 0 Just to improve the performance , and There is no guarantee for the reliability of the data , A disk failure will affect all data , therefore RAID 0 It can't be used in the situation with high data security requirements .
It can be seen from the above figure , When a hard disk hangs up , Some data will be lost , This will affect the integrity of the data .
2.RAID 1
RAID 1 , Also known as mirrored storage . It is realized through disk data mirroring data redundancy , stay Pair Data backed up by each other is generated on independent disks of . Generally speaking , Is that all ( The number of hard disks is even , namely 2n)RAID 1 All data is written to the hard disk in , Its capacity is only equal to the capacity of a hard disk , Because the other piece is just a data mirror . When raw data is busy , Data can be read directly from the mirror copy .
RAID 1 Of Writing speed is usually slow , Because the data has to be written into two hard disks and compared , But it's Data reading is faster than a single hard disk , Because the data will be read out from the faster one of the two hard disks .
RAID1 It is in the hard disk The unit cost is the highest Of , but It provides high data security and availability , When a hard disk fails , The system can Automatically switch to the mirrored hard disk for reading / Write , also There is no need to reorganize invalid data .

It can be seen from the above figure , When a hard disk hangs up , The system will read the complete data information from the backup hard disk , Does not affect the integrity of the data .
3.RAID 5
RAID 5 It's a storage capability 、 A storage solution that combines data security and storage cost , Its At least three hard disks are required to form an array .
RAID 5 With and RAID 0 Similar data reading speed , It's just There is one more parity information , therefore The speed of writing data is slightly slower than that of a single disk .
Since multiple data correspond to one parity information ,RAID 5 The disk space utilization ratio of RAID 1 high , by n-1/n(n Is the number of hard disks )
RAID 5 Of High reliability , It is allowed to damage a disc , When a disk is damaged ,RAID 5 Meeting Using the remaining data and the corresponding parity information to recover the damaged data , Thus, the integrity of image data will not . Of course , If two disks break at the same time , Or when one disk is damaged and the problem is not solved, another disk is broken , Then only GG 了 .
As shown in the figure above , If disk 0 damage , The other three hard disks can recover data according to the verification information , So it does not affect the integrity of the data
4.RAID10
RAID10, refer to RAID 1 + 0 , Do it first RAID 1 , Do it again RAID 0 . it yes RAID 1 and RAID 0 Products of combination , Divide data in consecutive bits or bytes and read in parallel / Write multiple disks at the same time , For each disk as a disk image for redundancy .
RAID 10 meanwhile Have RAID 0 Fast read and write speed and RAID 1 High reliability of data , however CPU The occupancy rate is also higher , and Disk utilization is low (n/2).
Because of the use of RAID 0 High reading and writing efficiency and RAID 1 High data protection 、 Resilience , send RAID 10 It has become a high cost-effective grade , At present, almost all RAID All control cards support this level .


3、 ... and 、Linux System construction software RAID
stay Linux In the system , To build RAID disk array , Need to use mdadm Tools .
Format : mdadm [ Pattern ] <raiddevice> [ Options ] <component-device>
| Options | Pattern |
|---|---|
| -C | Create mode |
| -A | Assembly mode |
| -F | Monitoring mode |
| -f,-r,-a | management model |
| management model | effect |
|---|---|
| -f | Mark the specified disk as damaged |
| -r | Remove disk |
| -a | Add disks |
| Options | effect |
|---|---|
| -n # | Use # Devices to create this RAID |
| -l # | Specify the created RAID The level of |
| -x # | Specify the size of the free disk |
| -c | Specify block size , Unit is k |
| -D | Show RAID Details of |
below , I will demonstrate to you in detail Linux Build in RAID 5 The process of :
First , We now add the virtual machine management interface 4 Block hard disk . add to 4 The purpose of the block is to 3 Block making RAID 5 , The rest is a hot spare , namely RAID 5 If one disc is damaged , The hot spare can be directly replaced .


yum install -y mdadm

mdadm -Cv md0 -l 5 -n 3 /dev/sd[b-d] -x 1 /dev/sde

mdadm -D /dev/md/md0

format

mount

simulation sdd damage




边栏推荐
- #yyds干货盘点# 解决剑指offer:字符流中第一个不重复的字符
- Oracle 19C installation documentation
- [data analysis] data clustering and grouping based on kmeans, including Matlab source code
- USB机械键盘改蓝牙键盘
- logstash时间戳转换为unix 纳秒nano second time
- 孙老师版本JDBC(2022年6月12日21:34:25)
- Redis optimization
- Logstash timestamp converted to UNIX nanosecond nano second time
- The 2023 campus recruitment officially opened! Oceanbase would like to make an interview with you this spring
- Open source background management system suitable for outsourcing projects
猜你喜欢

Prefix sum and difference

Npoi create word

Recommended Chinese font in the code input box of Oracle SQL developer

Xingda easy control modbustcp to profibusdp

SQL tuning guide notes 8:optimizer access paths

PE安装win10系统

Things about the kotlin collaboration process - pipeline channel

Dolphin-2.0.3 cluster deployment document

Okio source code analysis

NiO User Guide
随机推荐
Implementation of master-slave replication and master-master replication for MySQL and MariaDB databases
[QNX hypervisor 2.2 user manual] 4.2 supported build environments
SQL tuning guide notes 17:importing and exporting optimizer statistics
【图像去噪】基于三边滤波器实现图像去噪附matlab代码
Ansible PlayBook et ansible roles (3)
Configuring Dingding notification of SQL audit platform archery
[Jianzhi offer] Jianzhi offer 05 Replace spaces
Leetcode: the maximum number of building change requests that can be reached (if you see the amount of data, you should be mindless)
logstash时间戳转换为unix 纳秒nano second time
Interpretation of OCP function of oceanbase Community Edition
NiO User Guide
MySQL体系结构及基础管理(二)
Is it safe to open an account in tonghuashun? How to open an account
在同花顺开户证券安全吗,证券开户怎么开户流程
[data analysis] data clustering and grouping based on kmeans, including Matlab source code
Ansible Roles-项目案例(四)
SQL tuning guide notes 10:optimizer statistics concepts
USB机械键盘改蓝牙键盘
Vagrantbox reinstalling the vboxsf driver
[simple] 155 Minimum stack