Nbd » История » Версия 9
Андрей Волков, 2017-12-07 02:03
1 | 5 | Андрей Волков | h1. 1. nbd (debian) |
---|---|---|---|
2 | 1 | Андрей Волков | |
3 | h2. На сервере |
||
4 | |||
5 | 3 | Андрей Волков | *apt-get install qemu-utils* не ниже 2.1 |
6 | 1 | Андрей Волков | |
7 | 3 | Андрей Волков | *qemu-nbd -p 2000 -b 192.168.122.101 -f raw /dev/ssd6/hermes-storage &* |
8 | 1 | Андрей Волков | |
9 | h2. На клиенте |
||
10 | |||
11 | *nbd-client 192.168.122.101 2000 /dev/nbd0* |
||
12 | |||
13 | <pre> |
||
14 | Negotiation: ..size = 716800MB |
||
15 | bs=1024, sz=751619276800 bytes |
||
16 | </pre> |
||
17 | 2 | Андрей Волков | |
18 | *vi /etc/lvm/lvm.conf* |
||
19 | |||
20 | <pre> |
||
21 | filter = [ "a|^/dev/[hs]d[a-f][0-9]$|", "a|^/dev/nbd[0-9]+$|", "r/.*/" ] |
||
22 | </pre> |
||
23 | |||
24 | 1 | Андрей Волков | *pvcreate /dev/nbd0* |
25 | 5 | Андрей Волков | |
26 | h1. nbd (gentoo) |
||
27 | |||
28 | h2. На сервере |
||
29 | |||
30 | 6 | Андрей Волков | <pre> |
31 | lvcreate -L 210g -n temp-space vg-name |
||
32 | qemu-nbd -p 51621 -b 172.31.53.254 -f raw /dev/vg-name/temp-space & |
||
33 | </pre> |
||
34 | |||
35 | h2. На клиенте |
||
36 | |||
37 | <pre> |
||
38 | modprobe nbd |
||
39 | modprobe raid1 |
||
40 | echo 1 > /sys/module/raid1/parameters/max_queued_requests |
||
41 | 8 | Андрей Волков | # 30000 == 30Мбайт/сек ~ 300Мбит/сек |
42 | 6 | Андрей Волков | echo 30000 > /proc/sys/dev/raid/speed_limit_max |
43 | busybox nbd-client 172.31.53.254 51621 /dev/nbd0 |
||
44 | # sed -i '/filter = /s:"r|/dev/nbd.*|", ::' /etc/lvm/lvm.conf |
||
45 | 9 | Андрей Волков | |
46 | # "a|/dev/nbd[0-9]+$|", |
||
47 | # filter = |
||
48 | # global_filter = |
||
49 | |||
50 | 6 | Андрей Волков | pvcreate /dev/nbd0 |
51 | vgextend data /dev/nbd0 |
||
52 | lvconvert -m1 --type raid1 data/static /dev/nbd0 |
||
53 | lvs |
||
54 | </pre> |
||
55 | |||
56 | <pre> |
||
57 | LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert |
||
58 | static data rwi-aor--- 200.00g 0.15 |
||
59 | </pre> |
||
60 | |||
61 | h2. После завершения синхронизации |
||
62 | |||
63 | 7 | Андрей Волков | https://redmine.ekb-info.ru/projects/gnu-linux/wiki/Lvm-mirroring |