Contents
出版物やマニュアルにも目を通してください。
DRBDはLinuxオペレーティングシステム向けにPhilippReisnerとLarsEllenbergが開発しているプログラムです。
Distributed (分散した)
Replicated (複製(ミラー)された)
Block
Device (ブロックデバイス)
の略です。あるマシンのブロックデバイスを別のマシンのブロックデバイスにリアルタイムでミラーできます。heartbeatと組み合わせて、HA Linuxクラスタを構成できます。
LinBitをご覧ください。
DRBD最新バージョンはLinBitダウンロードページからダウンロードできます。DRBDはDebian、SuSE、RedHatその他の多くのディストリビューションに取り込まれています。
gitリポジトリもあります。
もちろん可能です。しかしこれらはDRBDのオプションではありません。適切なVPNなどを設定してください。ネットワークレイヤのプログラムが面倒を見てくれるはずです。軽量級ソリューションとしては、たとえばCIPE projectがあります。もちろん、IPSECやOpenVPNもこの目的で利用できます。
簡単な回答: No!. 次項目の質問と回答も見てください。
したがって、セカンダリ側でマウントしなければならない場合は、あらかじめセカンダリからプライマリに切り替えてください。あくまで両デバイスを同時にマウントするとうまく動作しません。ただしDRBD V8は2つのノードをともにプライマリにするモードをサポートします。次項目の回答を見てください。任意の数のクライアントから両ノードのデータにアクセスしなければならない場合は、HaNFSを使うことも検討してください。
If you need not just a mirrored, but a shared filesystem, use OCFS2 or GFS2 for example. But these are much slower, and typically expect write access on all nodes in question. If we have more than one node concurrently modifying distributed devices, we have some "interessting" problems to decide which part of the device is up-to-date on which node, and what blocks need to be resynchronized in which direction. These problems have been solved. You need to net { allow-two-primaries; } to activate this mode. But the handling of DRBD in "cluster fs mode" is still more complex and cumbersome than "classical" one-node-at-a-time access.
Also have a look at the DRBD Changelog.
ローカルディスクに対しては、DRBDはdisk-sizeパラメータの値を使います。この値は、デバイスの物理サイズ以下でなければならず、またパラメータを指定しなかった場合には物理サイズそのものが使われます。そして2台のDRBDが相互に接続されたときに、両ノードのサイズの最小値が共通のディスクサイズになります。この流れを無視すると、深刻な問題に陥る可能性があります。つまり、適切なdisk-size値を設定せずにDRBDを設定して1ノードだけで起動してしまい、小さいディスクサイズのノードと接続し、さらに実行中にディスクサイズを縮小するような流れを実行すると、Your size hint is bogus, please change to <some value>というメッセージがsyslogに出力されます。その結果DRBDの上位レイヤであるファイルシステムは混乱に陥ります。 したがって、2ノードのディスクサイズが異なる場合には、DRBDに管理させたい領域のディスクサイズを明示的に指定してください。DRBD-0.7は対向ノードのディスクサイズを自ノードのメタデータに書き込みます。したがって、DRBD-0.7ではdisk-sizeパラメータは使えません(設定ファイルに書くことはできません)。
実行中のカーネルとカーネルソースツリーの.config`が異なるのが原因です。SuSE Linuxでは、正しいconfigは次のコマンドで得られます。cd /usr/src/linux/ && make cloneconfig && make dep通常は、カーネルを再コンパイルする必要はなく、DRBDのみを再コンパイルします。作業前にdrbdソースコード中のINSTALLファイルに目を通して、正しい手順で再コンパイルしてください。
はい。LVM2の場合、スナップショットも読み書き可能です。このため、スナップショットボリュームでもジャーナルのリプレイが可能になります。詳しくは、2007年4月8日にdrbd-userメーリングリストに投稿されたA Summary of LVM snapshots with DRBDを参照してください。
http://linux-vserver.org/advanced+DRBD+mount+issues が役立つかもしれません。
非常に興味深い議論が http://lists.xensource.com/archives/html/xen-users/ にあります。
Outdated, applies to drbd versions prior drbd-0.6.4 only For historical reasons replicate used to work backwards. Most physical devices do have a pretty slow thoughput when writing data backwards.
double check the value of sync-max in the net {} section (drbd-0.6) resp. rate in the syncer {} section (drbd-0.7). Keep in mind that the default value is very low, and the default unit is kByte/sec!
check whether DMA is enabled
You may want to play with the values of protocol and sndbuf-size. If your NIC supports it, you may want to enable "jumbo frames" (up the value of the MTU). If nothing helps, ask the list for known good and performant setups...
not stopped
Note that all processes waiting for disk io are counted as runable! Therefore, if a lot of processes wait for disk io, the "load average" goes straight up, though the system actually may be almost idle cpu-wise ... E.g. crash your nfs server, and start 100 ls /path/to/non-cached/dir/on/nfs/mount-point on a client... you get a "load average" of 100+ for as long as the nfs timeout, which might be weeks ... though the cpu does nothing. Verify your system load by other means, e.g. vmstat, sysstat/sar. This will give you an idea of the bottleneck of your system. Some ideas are using multiple disks (not just partitions!) or even a RAID with 10.000rpm SCSI disks and probably even a Gigabit Ethernet. Even on a Fast Ethernet device you will rarely see more then 6 MByte per second. (100 MBit/s is at most 12.5 MByte/s minus protocol overhead and latency etc.).
DRBD-0.6 only
Exit code 255 is most likely from a script generated die, which include a verbose error message. Capture the output of that script. this is the debugfile directive in your ha.cf, iirc. If that does not help, do it by hand, and see what error message it gives. datadisk says something like cannot promote to primary, sychronization running or fsck failed or ...
Feature ...
DRBD does not automaticaly mount the partition. The script datadisk (or drbddisk in 0.7) is made for that purpose. It is intended to be called by hartbeat.
For each device, drbd will (try to) allocate X MB of bitmap, plus some constant amount (<1MB). X = storage_size_in_GB/32, so 1 TB storage -> 32 MB bitmap.
By default Linux allocates 128MB to Vmalloc. For systems using more than 4TB, this may cause an issue.
If you get the following error message in /var/log/messages, Try a Linux 2.6 hugemem kernel.
kernel: allocation failed: out of vmalloc space - use vmalloc=<size> to increase size.
Unconfigured |
Device waits for configuration. |
StandAlone |
Not trying to connect to peer, IO requests are only passed on locally. |
Unconnected |
Transitory state, while bind() blocks. |
WFConnection |
Device waits for configuration of other side. |
WFReportParams |
Transitory state, while waiting for first packet on a new TCP connection. |
Connected |
Everything is fine. |
Timeout, BrokenPipe, NetworkFailure |
Transitory states when connection was lost. |
|
|
SyncingAll |
All blocks of the primary node are being copied to the secondary node. |
SyncingQuick |
The secondary is updated, by copying the blocks which were updated since the now secondary node has left the cluster. |
SyncPaused |
Sync of this device has paused while higher priority (lower sync-group value) device is resyncing. |
|
|
WFBitMap{S,T} |
Transitory state when synchronization starts; "dirty"-bits are exchanged. |
SyncSource |
Synchronization in progress, this node has the good data. |
SyncTarget |
Synchronization in progress, this node has inconsistent data. |
PausedSync{S,T} |
see SyncPaused. |
SkippedSync{S,T} |
you should never see this. "Developers only" |
Primary |
the active node; may access the device. |
Secondary |
the passive node; must not access the device; expects mirrored writes from the other node. |
Unconfigured |
this is not a role, obviously. |
Diskless |
No storage attached, or storage had IO errors previously and got detached. |
Attaching |
in the process of attaching the local storage |
Failed |
storage had io errors |
Negotiating |
storage attached, but is not yet decided whether it is UpToDate |
Inconsistent |
storage is Inconsistent (e.g. half way during bitmap based resync) |
Outdated |
storage is consistent, but not UpToDate |
DUnknown |
(peer's) storage state is not known |
Consistent |
storage is consistent, not yet decided whether it is UpToDate or Outdated |
storage is good |
ns |
network send |
nr |
network receive |
dw |
disk write |
dr |
disk read |
al |
activity log updates (0.7) |
bm |
bitmap updates (0.7) |
lo |
reference count on local device |
pe |
pending (waiting for ack) |
ua |
unack'd (still need to send ack) |
ap |
application requests expecting io-completion |