Nbd » История » Версия 6
Андрей Волков, 2017-12-06 13:47
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 | echo 30000 > /proc/sys/dev/raid/speed_limit_max |
||
42 | busybox nbd-client 172.31.53.254 51621 /dev/nbd0 |
||
43 | # sed -i '/filter = /s:"r|/dev/nbd.*|", ::' /etc/lvm/lvm.conf |
||
44 | pvcreate /dev/nbd0 |
||
45 | vgextend data /dev/nbd0 |
||
46 | lvconvert -m1 --type raid1 data/static /dev/nbd0 |
||
47 | lvs |
||
48 | </pre> |
||
49 | |||
50 | <pre> |
||
51 | LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert |
||
52 | static data rwi-aor--- 200.00g 0.15 |
||
53 | </pre> |
||
54 | |||
55 | h2. После завершения синхронизации |
||
56 | |||
57 | <pre> |
||
58 | umount /dev/mapper/data-static |
||
59 | NAME=static; lvconvert --splitmirrors 1 --name $NAME.copy data/$NAME /dev/nbd0 && lvchange -an data/$NAME.copy |
||
60 | vgsplit data data.copy /dev/nbd0 |
||
61 | sync |
||
62 | ps axuwwf | grep busybox |
||
63 | kill -9 2085 |
||
64 | </pre> |