当前位置:网站首页>Creation of RAID disk array and RAID5

Creation of RAID disk array and RAID5

2022-04-23 16:27:00 qjwthink

Catalog

One 、RAID Disk array Introduction

Two 、 frequently-used RAID

1、 frequently-used RAID Level

2、RAID 0 Disk array Introduction

3、RAID1 Disk array Introduction

4、RAID 5 Disk array Introduction

5、RAID 6 Disk array Introduction

6、RAID 1+0 Disk array Introduction

7、 Array card introduction

8、 Array card cache

3、 ... and 、RAID5 The creation of

                  RAID summary


One 、RAID Disk array Introduction

yes Redundant Array of Independent Disks Abbreviation , Chinese abbreviation is independent redundant disk array

Combine multiple independent physical hard disks in different ways to form a hard disk group ( Logical hard disk ), So as to provide higher storage performance than a single hard disk and provide data backup technology

The different ways to make up a disk array are called RAID Level (RAID Levels)

Two 、 frequently-used RAID

1、 frequently-used RAID Level

RAID0,RAID1,RAID5,RAID6,RAID1+0 etc.

2、RAID 0 Disk array Introduction

RAID 0

1、RAID 0 Divide data continuously in bits or bytes , Read in parallel / Write on multiple disks , Therefore, it has high data transmission rate , But it has no data redundancy

2、RAID 0 Just to improve the performance , There is no guarantee for the reliability of the data , And a disk failure will affect all data

3、RAID 0 It can't be used in the situation with high data security requirements

3、RAID1 Disk array Introduction

RAID 1

1、 Realize data redundancy through disk data mirroring , Generate backup data on a pair of independent disks

2、 When raw data is busy , Data can be read directly from the mirror copy , therefore RAID 1 Can improve read performance

3、RAID1 It's the highest cost per unit in a disk array , But it provides high data security and availability . When a disk fails , The system can automatically switch to read and write on the mirror disk , And there's no need to reorganize failed data

4、RAID 5 Disk array Introduction

RAID 5

1、N(N>=3) The disks form an array , A data generation N-1 A strip , As well as 1 Check data , common N The data is in N Cycle balanced storage on the block disk

2、N Read and write at the same time , High reading performance , But because of the problem of checking mechanism , Write performance is relatively low

3、(N-1)/N Disk utilization

4、 High reliability , Allow bad 1 Block plate , It doesn't affect all the data

5、RAID 6 Disk array Introduction

RAID 6

1、N(N>=4) The disks form an array ,(N-2)/N Disk utilization

2、 And RAID 5 comparison ,RAID 6 A second independent parity block is added

3、 Two independent parity systems use different algorithms , Even if two disks fail at the same time, data usage will not be affected

4、 be relative to RAID 5 There are bigger ones “ Write loss “, Therefore, the write performance is poor

6、RAID 1+0 Disk array Introduction

RAID 1+0

1、N( even numbers ,N>=4) After two disks are mirrored , Then combine it into a RAID 0

2、N/2 Disk utilization

3、N/2 All disks are written simultaneously ,N All disks are read at the same time

4、 High performance , High reliability

7、 Array card introduction

Array cards are used to implement RAID Function board

Is usually I/O processor 、 Hard disk controller 、 It is composed of a series of components such as hard disk connector and cache

Different RAID Card supported RAID Different functions

For example, support RAIDO、RAID1、RAID5、RAID10 etc.

RAID The interface type of the card

IDE Interface 、SCSI Interface 、SATA Interface and SAS Interface

8、 Array card cache

1、 cache (Cache) yes RAID The place where the card exchanges data with the external bus ,RAID The card transfers the data to the cache first , Then the data is exchanged between the cache and the external data bus

2、 The size and speed of the cache are directly related to RAID The actual transmission speed of the card is an important factor

3、 Different RAID The memory capacity of the card is different when it is delivered from the factory , Generally, the capacity varies from a few megabytes to hundreds of megabytes

3、 ... and 、RAID5 The creation of

Start operation preparation first

Add four hard disks to the virtual machine

1、 Check that... Is installed mdadm software package

rpm -q mdadm

yum install -y mdadm

2、 Use fdisk. The tool will the new disk device /dev/sdb、 /dev/sdc、 /dev/sdd、 /dev/sde

Divide the main partition sdb1、sdc1、 sdd1、 sde1, also

Put the partition type ID Change the tag number to "fd”

fdisk /dev/sdb

fdisk /dev/sdc

fdisk /dev/sdd

fdisk /dev/sde

for example :fdisk /dev/sde

The establishment can be completed through fdisk -l Check it out.

3、 establish RAID equipment

# establish RAID5

mdadm -C -v /dev/md0  -15 -n3 /dev/sd[bcd]1 -x1 /dev/sde1

Command word       raid name   Level -n Number of disks   /dev/sde1 /dev/sdd1    Hot standby Partition device of hot spare

-C: Means new ;

-v: Show details of the creation process .

/dev/md5: establish RAID5 The name of .

-l: Appoint RAID The level of ,15 Representation creation RAID5..

-n: Specify how many hard disks to use to create RAID, n3 Said the use of 3 Block hard disk creation RAID.

/dev/sd [bcd]1: Specify to use this 3 Block disk partition to create RAID.

-x: Specify how many hard disks to use RAID Hot spare for ,x1 Express reservation 1 Spare a spare hard disk

/dev/sde1: Specify the disk to use as a spare

see RAID Disk details

cat /proc/mdstat          # You can also view and create RAID Progress

perhaps

mdadm -D /dev/md0

# use watch Command to every - Refresh for a while /proc/mdstat The loss of Out

watch -n 10 ' cat /proc/mdstat '

# Check if the disk is EL do RAID.

mdadm -E /dev/sd[b-e] 1

4、 Create and mount file systems

mkfs -t xfs /dev/imd0

mkdir /myraid

mount /dev/md0 /myraid/

df -Th

  Or do permanent mount

cp /etc/ fstab /etc/fstab.bak Backup

vim /etc/fstab  Get into /etc/fstab Enter the following

/dev/md0             /myraid     xfs   defaults     0 0

mount -a

df -Th

5、 Achieve fault recovery

mdadm /dev/md0 -f /dev/sdb1   # simulation /dev/sdb1 fault

mdadm -D /dev/md0   # View discovery sde1 Replaced sdb1, Be careful to wait a little

Repair process

mdadm /dev/md0 -r /dev/sdb1 Remove the device

 

mdadm /dev/md0 -a /dev/ sdb1 Add equipment

RAID summary

RAID
RAID Level       Number of hard disks             Disk utilization     Whether there is verification       The ability to protect               Write performance
RAID0             N( It can be for 1)         N                    nothing               nothing                 Of a single hard disk N times
RAID1          N( even numbers )       N/2.          nothing           Allow one - Device failure          You need to write two pairs of storage devices , Prepare for each other
RAID5           N>=3      (N-1) /N       Yes         Allow a device failure                   Need to write calculation verification
RAID6           N>=4      (N-2) /N       Yes         Two equipment failures are allowed                   Double write calculation verification is required
RAID10        N>=4( even numbers )     N/2       nothing       Allow one of the two base groups to be bad        N/2 block The disk is written simultaneously
                                                                                      The probability that two disks will not lose data at the same time is 3 Divided 2
 

版权声明
本文为[qjwthink]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231624474087.html