当前位置:网站首页>[Galaxy Kirin V10] [server] soft RAID configuration
[Galaxy Kirin V10] [server] soft RAID configuration
2022-07-04 10:32:00 【GUI Anjun @kylinos】
One 、 Experimental environment
Galaxy Unicorn V10 0711 server x86_64
Two 、 With raid5 For example
raid5 yes raid0 and raid1 A compromise of , With and raid0 Similar data reading speed , Just one more parity message , The speed of writing data is slightly slower than that of a single disk , At the same time, because multiple data correspond to one parity information ,raid5 The disk space utilization ratio of raid1 high , Storage costs are relatively low , It's a solution that's used a lot .

Number of hard disks required : At least 3 block , Can exceed 3 block ;
Hard disk utilization :(n-1)/n , among n Is the number of hard disks , Parity data actually adds up to one disk ;
Maximum disk failures : Bad at most 1 Block plate ;
1、raid5 To configure
Prerequisite : Get ready 4 Block hard disk , Here to sdb、sdc、sdd、sde For example , Self partition is sdb1、sdc1、sdd1、sde1
# mkfs.ext4 /dev/sdb1 // format partition
# mkfs.ext4 /dev/sdc1
# mkfs.ext4 /dev/sdd1
# mkfs.ext4 /dev/sde1
In the following ways 1 And way 2 Select an operation according to the actual needs :
The way 1:3 Block plate , do raid5, No redundant disk
# mdadm --create --auto=yes /dev/md5 --level=5 --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1
Parameter description :
--create: establish raid
--auto=yes: Decide to create a subsequent software disk array device , namely md[0-9]
/dev/md5:md5 by raid Device file name , Custom name , General habits raid5 Just name it md5, Easy to understand
--raid-devices=4: A device that uses several disks or partitions as a disk array
--level=5: Set the level of this group of disk arrays
The way 2:4 Block plate , do raid5, There is a redundant disk , If there is a fault during use , The redundant disk can automatically replace the bad disk
# mdadm --create /dev/md5 --auto=yes --level=5 --chunk=256K --raid-devices=3 --spare-devices=1 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1
Parameter description :
--chunk=256K: Determine the of this device chunk size , It's usually 64K perhaps 512K
--spare-devices=1: Use several disks or partitions as backup devices

# mdadm -D /dev/md5 // View the created raid Device details
[[email protected] ~]# mdadm -D /dev/md5
/dev/md5: #raid Device file name
Version : 1.2
Creation Time : Mon Nov 1 19:31:24 2021 # Creation time
Raid Level : raid5 #raid Grade
Array Size : 10473472 (9.99 GiB 10.72 GB) # Whole set raid Actual usable capacity
Used Dev Size : 5236736 (4.99 GiB 5.36 GB) # Capacity of each disk
Raid Devices : 3 # form raid Number of disks
Total Devices : 4 # Include spare Total disks
Persistence : Superblock is persistent
Update Time : Mon Nov 1 19:31:50 2021
State : clean # Current usage status of this disk array
Active Devices : 3 # Number of devices started
Working Devices : 4 # The number of devices currently using this array
Failed Devices : 0 # Number of damaged equipment
Spare Devices : 1 # Number of reserved disks
Layout : left-symmetric
Chunk Size : 256K #chunk Small block capacity
Consistency Policy : resync
Name : 192.168.1.13:5 (local to host 192.168.1.13)
UUID : c18e80e3:2786d97c:8fbdd2b1:c9b8c07b
Events : 18
Number Major Minor RaidDevice State
0 8 17 0 active sync /dev/sdb1
1 8 33 1 active sync /dev/sdc1
4 8 49 2 active sync /dev/sdd1
3 8 65 - spare /dev/sde1 # notice sde1 As standby equipment in the waiting area
# Last 4 OK, here it is 4 Current status of devices ,RaidDevice Refers to this Raid Disk order in # cat /proc/mdstat // Check the status
[[email protected] ~]# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md5 : active raid5 sdd1[4] sde1[3](S) sdc1[1] sdb1[0]
10473472 blocks super 1.2 level 5, 256k chunk, algorithm 2 [3/3] [UUU]
unused devices: <none> explain : The first line is : Pointed out that md05 by raid5 , And used sdd1,sde1,sdc1,sdb1, Wait for four disk devices . Brackets after each device [] The number in this disk is in RAID Order in (RaidDevice); as for sde1 hinder [S] Then represent sde1 by spare The meaning of ;
The second line is : This disk array has 10473472 individual block( Every block Unit is 1K), So the total capacity is about 9.98GB, Use RAID 5 Grade , Small block written to disk (chunk) The size is 256K, Use algorithm 2 Disk array algorithm . [m/n] Represents that this array requires m Devices , And n One device is working properly . So this md5 need 3 A device and this 3 All devices are in normal operation . hinder [UUU] It represents four required equipment ( Namely [m/n] Inside m) Start up of ,U Represents normal operation , if _ It means abnormal .
# mkfs.ext4 /dev/md5 // format
# blkid /dev/md5 // obtain UUID, write in fstab Realize automatic mount after power on

# mkdir /data2 // Create mount directory , Name and path customization
# vim /etc/fstab

# mount -a // If you enter and no error is reported, the mount is successful , This step is very important , Can be tested fstab Whether the writing is correct
# df -Th //raid Disk mounted successfully

边栏推荐
- leetcode1-3
- /*The rewriter outputs the contents of the IA array. It is required that the type defined by typedef cannot be used in the outer loop*/
- Si vous ne connaissez pas ces quatre modes de mise en cache, vous osez dire que vous connaissez la mise en cache?
- Exercise 7-4 find out the elements that are not common to two arrays (20 points)
- Time complexity and space complexity
- BGP ---- border gateway routing protocol ----- basic experiment
- Summary of several job scheduling problems
- Ruby time format conversion strftime MS matching format
- system design
- uniapp---初步使用websocket(长链接实现)
猜你喜欢

Reprint: summation formula of proportional series and its derivation process

Introduction to extensible system architecture

When I forget how to write SQL, I

Doris / Clickhouse / Hudi, a phased summary in June

Error C4996 ‘WSAAsyncSelect‘: Use WSAEventSelect() instead or define _ WINSOCK_ DEPRECATED_ NO_ WARN

Jianzhi offer 04 (implemented in C language)

【Day1】 deep-learning-basics

Huge number multiplication (C language)

Remove linked list elements

Virtual machine configuration network
随机推荐
If the uniapp is less than 1000, it will be displayed according to the original number. If the number exceeds 1000, it will be converted into 10w+ 1.3k+ display
Devop basic command
Virtual machine configuration network
Write a program to judge whether the two arrays are equal, and then write a similar program to compare the two vectors.
基于线性函数近似的安全强化学习 Safe RL with Linear Function Approximation 翻译 2
AUTOSAR from getting started to mastering 100 lectures (106) - SOA in domain controllers
Add t more space to your computer (no need to add hard disk)
2021-08-10 character pointer
[untitled]
用数据告诉你高考最难的省份是哪里!
【Day2】 convolutional-neural-networks
转载:等比数列的求和公式,及其推导过程
Dynamic memory management
Does any teacher know how to inherit richsourcefunction custom reading Mysql to do increment?
Linked list operation can never change without its roots
C language structure to realize simple address book
使用 C# 提取 PDF 文件中的所有文字(支持 .NET Core)
Architecture introduction
【Day2】 convolutional-neural-networks
When I forget how to write SQL, I