增加部分信息

This commit is contained in:
zhengchiliu 2025-08-08 11:35:32 +08:00
parent a664705aa2
commit 06b30075b7
11 changed files with 285 additions and 36 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -1,2 +0,0 @@
# Ansible

1
CAD/CAD快捷键.md Normal file
View File

@ -0,0 +1 @@
![Clipboard_Screenshot_1747219028](./assets/Clipboard_Screenshot_1747219028.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

View File

@ -0,0 +1,14 @@
![Clipboard_Screenshot_1748796448](./assets/Clipboard_Screenshot_1748796448.png)
# 部署清单
1、tke服务器
| 服务 | 要求 | 状态 |
| ---------- | ---------------- | -------------------- |
| jumpserver | 自动化注册服务器 | 已完成部署,未自动化 |
| grafana | 对接prometheus | 未完成 |
| prometheus | 自动化注册 | 未完成 |
| argocd | 对接gitea | 未完成 |
2、个人服务器

17
折腾日记/自建NAS.md Normal file
View File

@ -0,0 +1,17 @@
配置清单:
机箱:
主板:
CPU
内存:
固态硬盘:
机械硬盘:
电源:

View File

@ -1,34 +0,0 @@
192.168.30.5 StandOS
工具层
192.168.30.10 ansible
工具层
192.168.30.200 lvs
192.168.30.220 lvs-1
192.168.30.221 lvs-2
数据层
192.168.30.211 mysql-master
192.168.30.212 mysql-slave
192.168.30.213 elasticsearch-1
192.168.30.214 elasticsearch-2
192.168.30.215 elasticsearch-3
192.168.30.216 kibana
192.168.30.217 consul-1
192.168.30.218 consul-2
192.168.30.111 minio-1
192.168.30.112 minio-2
192.168.30.113 minio-3
192.168.30.114 minio-4
应用层
192.168.30.222 k8s-master-1
192.168.30.223 k8s-master-2
192.168.30.224 k8s-master-3
192.168.30.225 k8s-node-1
192.168.30.226 k8s-node-2
192.168.30.227 k8s-node-3
192.168.30.228 k8s-node-4
192.168.30.229 k8s-node-5

BIN
运维/操作系统/Linux/.DS_Store vendored Normal file

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,253 @@
# 实测软Raid
## 一、环境介绍
| 操作系统 | 硬盘1 | 硬盘2 |
| -------------------- | ------- | ------- |
| ubuntu24.04 云服务器 | 70g ssd | 70g ssd |
## 二、测试创建Raid 1
1、创建Raid 1
```
root@VM-2-2-ubuntu:/data# mdadm -C /dev/md0 -l 1 -n 2 /dev/vdb /dev/vdc
mdadm: Note: this array has metadata at the start and
may not be suitable as a boot device. If you plan to
store '/boot' on this device please ensure that
your boot-loader understands md/v1.x metadata, or use
--metadata=0.90
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.
```
2、查看创建进度
```
###查看raid进度###
root@VM-2-2-ubuntu:/data# cat /proc/mdstat
Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid1 vdc[1] vdb[0]
73333760 blocks super 1.2 [2/2] [UU]
[===>.................] resync = 15.5% (11405312/73333760) finish=5.0min speed=206165K/sec
unused devices: <none>
```
3、创建完成
```
###Raid进度完成###
root@VM-2-2-ubuntu:/data# cat /proc/mdstat
Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid1 vdc[1] vdb[0]
73333760 blocks super 1.2 [2/2] [UU]
unused devices: <none>
```
4、格式化磁盘
```
###格式化###
root@VM-2-2-ubuntu:/data# mkfs.xfs /dev/md0
meta-data=/dev/md0 isize=512 agcount=4, agsize=4583360 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=1
= reflink=1 bigtime=1 inobtcount=1 nrext64=0
data = bsize=4096 blocks=18333440, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=16384, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
```
5、挂载
```
root@VM-2-2-ubuntu:/data# mount /dev/md0 /data
root@VM-2-2-ubuntu:/data# df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 197M 1.1M 196M 1% /run
/dev/vda2 50G 4.9G 43G 11% /
tmpfs 984M 24K 984M 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 197M 12K 197M 1% /run/user/1000
/dev/md0 70G 1.4G 69G 2% /data
root@VM-2-2-ubuntu:~# ls -l /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root 9 May 8 16:10 ata-QEMU_DVD-ROM_QM00002 -> ../../sr0
lrwxrwxrwx 1 root root 9 May 8 16:44 md-name-VM-2-2-ubuntu:0 -> ../../md0
lrwxrwxrwx 1 root root 9 May 8 16:44 md-uuid-261fcd66:9689a33e:294c4f85:6e096e48 -> ../../md0
lrwxrwxrwx 1 root root 9 May 8 16:10 virtio-disk-f6vtxkjm -> ../../vdb
lrwxrwxrwx 1 root root 9 May 8 16:10 virtio-disk-ld0km1yk -> ../../vdc
```
6、写入数据测试性能并计算文件的md5值
```
root@VM-2-2-ubuntu:/data# dd if=/dev/zero of=sun.txt bs=1M count=2048
2048+0 records in
2048+0 records out
2147483648 bytes (2.1 GB, 2.0 GiB) copied, 4.83928 s, 444 MB/s
root@VM-2-2-ubuntu:/data# md5sum sun.txt
a981130cf2b7e09f4686dc273cf7187e sun.txt
```
三、模拟单盘故障,拔掉异常的盘,然后添加新盘
1、卸载vdb尝试读取写入文件
```
root@VM-2-2-ubuntu:~# ls -l /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root 9 May 8 16:10 ata-QEMU_DVD-ROM_QM00002 -> ../../sr0
lrwxrwxrwx 1 root root 9 May 8 16:44 md-name-VM-2-2-ubuntu:0 -> ../../md0
lrwxrwxrwx 1 root root 9 May 8 16:44 md-uuid-261fcd66:9689a33e:294c4f85:6e096e48 -> ../../md0
lrwxrwxrwx 1 root root 9 May 8 16:10 virtio-disk-ld0km1yk -> ../../vdc
###可正常读取###
root@VM-2-2-ubuntu:/data# md5sum sun.txt
a981130cf2b7e09f4686dc273cf7187e sun.txt
root@VM-2-2-ubuntu:/data# cat /proc/mdstat
Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid1 vdc[1]
73333760 blocks super 1.2 [2/1] [_U]
unused devices: <none>
root@VM-2-2-ubuntu:/data# rz -E
Sent - Linux内核设计与实现第三版.pdf 9.72 MB/s Spend: 4 seconds
root@VM-2-2-ubuntu:/data# ls
Linux内核设计与实现第三版.pdf sun.txt 通用交流材料_95_1744028634000.pptx
```
2、加回单盘这里有点难受的是需要进行全盘数据校验
1. **全盘数据校验机制**
RAID1 的同步并非仅针对已写入文件,而是对整块硬盘的 **所有存储单元(包括空白区域)​** 进行校验
即使你只拔插硬盘RAID 控制器仍需逐块比对数据一致性,确保两个硬盘的镜像完全一致。
2. **触发同步的条件**
当硬盘被移除后重新插入时RAID 控制器会将其标记为「潜在不一致状态」,即使文件系统未损坏,仍需通过全盘同步消除数据差异风险
```
root@VM-2-2-ubuntu:/data# ls -al /dev/disk/by-id
total 0
drwxr-xr-x 2 root root 140 May 9 10:51 .
drwxr-xr-x 8 root root 160 May 8 16:10 ..
lrwxrwxrwx 1 root root 9 May 8 16:10 ata-QEMU_DVD-ROM_QM00002 -> ../../sr0
lrwxrwxrwx 1 root root 9 May 8 16:44 md-name-VM-2-2-ubuntu:0 -> ../../md0
lrwxrwxrwx 1 root root 9 May 8 16:44 md-uuid-261fcd66:9689a33e:294c4f85:6e096e48 -> ../../md0
lrwxrwxrwx 1 root root 9 May 9 10:51 virtio-disk-f6vtxkjm -> ../../vdb
lrwxrwxrwx 1 root root 9 May 8 16:10 virtio-disk-ld0km1yk -> ../../vdc
root@VM-2-2-ubuntu:/data# mdadm --add /dev/md0 /dev/vdb
root@VM-2-2-ubuntu:/data# cat /proc/mdstat
Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid1 vdb[2] vdc[1]
73333760 blocks super 1.2 [2/2] [UU]
unused devices: <none>
```
3、干掉另外一块盘测试数据完整性并同样加回
```
root@VM-2-2-ubuntu:/data# ls -al /dev/disk/by-id
total 0
drwxr-xr-x 2 root root 120 May 9 11:11 .
drwxr-xr-x 8 root root 160 May 8 16:10 ..
lrwxrwxrwx 1 root root 9 May 8 16:10 ata-QEMU_DVD-ROM_QM00002 -> ../../sr0
lrwxrwxrwx 1 root root 9 May 8 16:44 md-name-VM-2-2-ubuntu:0 -> ../../md0
lrwxrwxrwx 1 root root 9 May 8 16:44 md-uuid-261fcd66:9689a33e:294c4f85:6e096e48 -> ../../md0
lrwxrwxrwx 1 root root 9 May 9 10:51 virtio-disk-f6vtxkjm -> ../../vdb
root@VM-2-2-ubuntu:/data# cat /proc/mdstat
Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid1 vdb[2]
73333760 blocks super 1.2 [2/1] [U_]
unused devices: <none>
root@VM-2-2-ubuntu:/data# md5sum sun.txt
a981130cf2b7e09f4686dc273cf7187e sun.txt
root@VM-2-2-ubuntu:/data# ls -al /dev/disk/by-id
total 0
drwxr-xr-x 2 root root 140 May 9 11:13 .
drwxr-xr-x 8 root root 160 May 8 16:10 ..
lrwxrwxrwx 1 root root 9 May 8 16:10 ata-QEMU_DVD-ROM_QM00002 -> ../../sr0
lrwxrwxrwx 1 root root 9 May 8 16:44 md-name-VM-2-2-ubuntu:0 -> ../../md0
lrwxrwxrwx 1 root root 9 May 8 16:44 md-uuid-261fcd66:9689a33e:294c4f85:6e096e48 -> ../../md0
lrwxrwxrwx 1 root root 9 May 9 10:51 virtio-disk-f6vtxkjm -> ../../vdb
lrwxrwxrwx 1 root root 9 May 9 11:13 virtio-disk-ld0km1yk -> ../../vdc
root@VM-2-2-ubuntu:/data# mdadm --add /dev/md0 /dev/vdc
mdadm: added /dev/vdc
root@VM-2-2-ubuntu:/data# cat /proc/mdstat
Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid1 vdc[3] vdb[2]
73333760 blocks super 1.2 [2/1] [U_]
[>....................] recovery = 0.8% (601728/73333760) finish=6.0min speed=200576K/sec
unused devices: <none>
```
四、模拟raid 1 扩容(拔盘之前优先关机,再拔盘,然后开机!!!)
1、扩容单硬盘至75G然后挂载加回
```
root@VM-2-2-ubuntu:/data# mdadm --add /dev/md0 /dev/vdc
mdadm: added /dev/vdc
root@VM-2-2-ubuntu:/data# cat /proc/mdstat
Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid1 vdc[3] vdb[2]
73333760 blocks super 1.2 [2/1] [U_]
[>....................] recovery = 1.3% (1001728/73333760) finish=4.8min speed=250432K/sec
unused devices: <none>
```
2、等待重建完毕后再扩容另外一块磁盘并加入
```
Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid1 vdc[3] vdb[2]
73333760 blocks super 1.2 [2/2] [UU]
unused devices: <none>
Every 2.0s: cat /proc/mdstat VM-2-2-ubuntu: Fri May 9 11:42:12 2025
Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid1 vdb[2] vdc[3]
73333760 blocks super 1.2 [2/2] [UU]
unused devices: <none>
```
3、扩容Raid
```
mdadm --grow /dev/md0 --size=max
```
4、扩容文件系统
```
```