当前位置:网站首页>[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

边栏推荐
- Tables in the thesis of latex learning
- C language - stack
- Latex error: missing delimiter (. Inserted) {\xi \left( {p,{p_q}} \right)} \right|}}
- Time complexity and space complexity
- Doris / Clickhouse / Hudi, a phased summary in June
- Development guidance document of CMDB
- uniapp 处理过去时间对比现在时间的时间差 如刚刚、几分钟前,几小时前,几个月前
- PHP代码审计3—系统重装漏洞
- Devop basic command
- Knapsack problem and 0-1 knapsack problem
猜你喜欢

Architecture introduction

The most detailed teaching -- realize win10 multi-user remote login to intranet machine at the same time -- win10+frp+rdpwrap+ Alibaba cloud server

Realsense of d435i, d435, d415, t265_ Matching and installation of viewer environment

Introduction to extensible system architecture

Virtual machine configuration network

leetcode1-3

【OpenCV 例程200篇】218. 多行倾斜文字水印

What is an excellent architect in my heart?

Evolution from monomer architecture to microservice architecture

PHP代码审计3—系统重装漏洞
随机推荐
Huge number multiplication (C language)
Reprint: summation formula of proportional series and its derivation process
leetcode1-3
Recursion and divide and conquer strategy
On binary tree (C language)
AUTOSAR从入门到精通100讲(106)-域控制器中的SOA
按键精灵打怪学习-识别所在地图、跑图、进入帮派识别NPC
Doris / Clickhouse / Hudi, a phased summary in June
MySQL case
Snake (C language)
【Day1】 deep-learning-basics
Use C to extract all text in PDF files (support.Net core)
Architecture introduction
Button wizard business running learning - commodity quantity, price reminder, judgment Backpack
What is an excellent architect in my heart?
六月份阶段性大总结之Doris/Clickhouse/Hudi一网打尽
System.currentTimeMillis() 和 System.nanoTime() 哪个更快?别用错了!
Rhcsa learning practice
A little feeling
Three schemes of ZK double machine room