Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung | |||
server:drbd [2018/09/11 17:25] – st | server:drbd [2020/07/07 15:21] (aktuell) – [DRBD] st | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ====== DRBD ====== | ||
+ | |||
+ | DRBD ist eine Art [[server: | ||
+ | |||
+ | In Kombination mit [[wpde> | ||
+ | |||
+ | <box 100% red round right | **veraltet**> | ||
+ | :!: der Artikel ist aus 2014 und veraltet. Alternativen sind Lösungen wie der [[software: | ||
+ | </ | ||
+ | |||
+ | ^ Kernel-Version ^ enthaltene drbd-Version ^ | ||
+ | | 2.6.33 | 8.3.7 | | ||
+ | | 2.6.34 | 8.3.7 | | ||
+ | | 2.6.35 | 8.3.8 | | ||
+ | | 2.6.36 | 8.3.8.1 | | ||
+ | | 2.6.37 | 8.3.9 | | ||
+ | | 2.6.38 | 8.3.9 | | ||
+ | | 2.6.39 | 8.3.10 | | ||
+ | | 3.0 - 3.4 | 8.3.11 | | ||
+ | | 3.5 - 3.7 | 8.3.13 | | ||
+ | | 3.8 | 8.4 | | ||
+ | |||
+ | |||
+ | ===== Links ===== | ||
+ | |||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | |||
+ | ===== drbd und Xen ===== | ||
+ | |||
+ | ==== Links ==== | ||
+ | |||
+ | * [[drbd]] | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | |||
+ | |||
+ | ===== Installation unter Debian Etch ===== | ||
+ | |||
+ | In Etch ist lediglich drbd Version 0.7 enthalten die mittels dem module-assistant als Modul passend zum kernel kompiliert wird. D. h. bei Updates von drbd oder dem Kernel muss das Kernelmodul neu übersetzt werden. | ||
+ | |||
+ | Weiterhin werden die Kernelquellen (linux-header) benötigt, diese sind für Xen im Paket | ||
+ | '' | ||
+ | Beim Aufruf von module-assistant werden diese benötigen Komponenten jedoch dazu installiert. | ||
+ | |||
+ | < | ||
+ | aptitude install module-assistant build-essential drbd0.7-module-source | ||
+ | m-a a-i drbd0.7 | ||
+ | </ | ||
+ | |||
+ | * die 2 Warnungen scheinen keine Auswirkungen zu haben: < | ||
+ | WARNING: / | ||
+ | </ | ||
+ | |||
+ | Das Modul kann erstmal testweise mit dem Befehl | ||
+ | < | ||
+ | |||
+ | * Die beiden Hosts sind erstmal inkonsistent, | ||
+ | * Also müssen wir auf dem Master die Ressource aktivieren. | ||
+ | < | ||
+ | < | ||
+ | master:~# cat /proc/drbd | ||
+ | version: 0.7.21 (api: | ||
+ | SVN Revision: 2326 build by root@file, 2008-10-01 17:29:19 | ||
+ | 0: cs: | ||
+ | ns:5656576 nr:0 dw:0 dr:5656576 al:0 bm:345 lo:0 pe:0 ua:0 ap:0 | ||
+ | [==> | ||
+ | finish: 0:31:01 speed: 23,060 (20,492) K/ | ||
+ | version: 0.7.21 (api: | ||
+ | SVN Revision: 2326 build by root@file, 2008-10-01 17:29:19 | ||
+ | 0: cs: | ||
+ | ns:48698492 nr:0 dw:0 dr:48698492 al:0 bm:2973 lo:0 pe:0 ua:0 ap: | ||
+ | |||
+ | ^ Kürzel ^ Bedeutung ^ | ||
+ | | cs | connection state | | ||
+ | | st | node state (local/ | ||
+ | | ld | local data consistency | | ||
+ | | ds | data consistency | | ||
+ | | ns | network send | | ||
+ | | nr | network receive | | ||
+ | | dw | disk write | | ||
+ | | dr | disk read | | ||
+ | | pe | pending (waiting for ack) | | ||
+ | | ua | unack' | ||
+ | | al | access log write count | | ||
+ | |||
+ | * Der Ressource fehlt jetzt noch ein Dateisystem, | ||
+ | |||
+ | |||
+ | ===== Installation unter Debian Lenny ===== | ||
+ | |||
+ | In Lenny ist drbd Version 8.0.14 enthalten. | ||
+ | |||
+ | Für AMD64: | ||
+ | |||
+ | < | ||
+ | aptitude install drbd8-modules-2.6.26-2-amd64 drbd8-utils | ||
+ | </ | ||
+ | Die Version 8.3 kann über [[http:// | ||
+ | |||
+ | |||
+ | ===== Rollen manuell umschalten ===== | ||
+ | Falls der primary neu startet, wird beim starten gesynct und der status ist secondary/ | ||
+ | |||
+ | * auf dem aktuellen primary (wird secondary): < | ||
+ | * auf dem aktuellen secondary (wird neuer primary):< | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==== Links ==== | ||
+ | * [[http:// | ||
+ | |||
+ | |||
+ | ===== Begriffe ===== | ||
+ | * **syncronitäts-Bitmap**: | ||
+ | * **activity-log**: | ||
+ | |||
+ | |||
+ | |||
+ | ===== Konfiguration ===== | ||
+ | |||
+ | Konfigurationsdatei erstellen und exakt gleich :!: auf beide hosts verteilen. Siehe auch < | ||
+ | |||
+ | |||
+ | ===== Beispiel ===== | ||
+ | |||
+ | < | ||
+ | # | ||
+ | # drbd-conf - SYNC CHANGES ALWAYS BETWEEN ALL NODES! | ||
+ | # | ||
+ | |||
+ | |||
+ | global { | ||
+ | # | ||
+ | } | ||
+ | |||
+ | # | ||
+ | # 50G mirrored partition | ||
+ | # | ||
+ | resource r50g { | ||
+ | |||
+ | # C is: data has reached _both_ local and remote DISK | ||
+ | protocol C; | ||
+ | incon-degr-cmd "echo ' | ||
+ | # incon-degr-cmd "halt -f"; | ||
+ | |||
+ | |||
+ | startup { | ||
+ | |||
+ | # Wait for connection timeout if this node was a degraded cluster. | ||
+ | # In case a degraded cluster (= cluster with only one node left) | ||
+ | # is rebooted, this timeout value is used. | ||
+ | degr-wfc-timeout 120; # 2 minutes. | ||
+ | } | ||
+ | |||
+ | disk { | ||
+ | # if the lower level device reports io-error you have the choice of | ||
+ | # " | ||
+ | # | ||
+ | # | ||
+ | # " | ||
+ | # " | ||
+ | # | ||
+ | # | ||
+ | on-io-error | ||
+ | } | ||
+ | |||
+ | net{ | ||
+ | # | ||
+ | } | ||
+ | |||
+ | |||
+ | syncer { | ||
+ | # Limit the bandwith used by the resynchronisation process. | ||
+ | # default unit is kByte/sec; optional suffixes K,M,G are allowed. | ||
+ | rate 20M; | ||
+ | } | ||
+ | |||
+ | on xeon { | ||
+ | device | ||
+ | disk / | ||
+ | address | ||
+ | meta-disk | ||
+ | } | ||
+ | |||
+ | on debfail { | ||
+ | device | ||
+ | disk / | ||
+ | address | ||
+ | meta-disk | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | * Es gibt also zwei Hosts (xeon und debfail) | ||
+ | * diese haben jeweils 2 Netzwerkkarten | ||
+ | * eine für das normale Intranet | ||
+ | * eine direkte cross-over Verbindung (172.16.0.1 und 172.16.0.2) zum jeweils anderen um split-brain durch defekten Switch zu vermeiden. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==== drbdadm ==== | ||
+ | |||
+ | drbdadm BEFEHL RESSOURCE | ||
+ | |||
+ | also z.B. '' | ||
+ | |||
+ | * **Befehle** (commands): | ||
+ | * attach / detach | ||
+ | * connect / disconnect | ||
+ | * up / down | ||
+ | * primary / secondary | ||
+ | * invalidate / invalidate_remote | ||
+ | * resize / syncer | ||
+ | * adjust / wait_connect | ||
+ | * **state** (master/ | ||
+ | * dump / wait_con_int | ||
+ | Version: 0.7.21 | ||
+ | |||
+ | |||