DRBD – Migrating DRBD resources [対訳]

DRBD – Migrating DRBD resources(http://www.drbd.org/drbd8-howto0.html) の対訳。

誤訳がありましたらコメントにてご指摘ください。

前: DRBD – Getting started [対訳] 次: DRBD – Integrating with Heartbeat V1 [対訳]

Suppose we have our DRBD resource r0, corresponding to /dev/drbd0, mounted on /mnt on one cluster node (joe), and want to mount it on the other (jane). This page outlines the process of doing this manually.

以下を想定する。DRBD リソース r0 がある。r0 は /dev/drbd0 に該当する。r0 はクラスターノードの一方(joe) で /mnt にマウントされている。そしてもう一方のクラスターノード(jane) でマウントしたい。このページではこれを手動で行う方法について説明していく。

Notes

ノート

This walk-through demonstrates the steps in switching resources over manually, which is helpful if you want to test DRBD or see how it works. In any practical configuration, you would have the switch-over/fail-over process managed by a cluster manager.

このデモではリソースの切り替えを手動で行う。もし DRBD のテストをしたいとかどんな感じで動作するのか知りたいのであればとても参考になるだろう。実際の設定ではクラスターマネージャを用いたスイッチオーバ/フェイルオーバをすることになるだろう。

In either scenario, you need to ensure that /etc/drbd.conf is identical on both nodes.

いずれにせよ、確実に両方のノードの /etc/drbd.conf が同じ内容である必要がある。

Initial status

初期状態

At first, let’s have a look what the current DRBD status is from joe’s perspective:

最初に、 joe 側で DRBD の状態がどのようになっているかを確認する。

root@joe:~# cat /proc/drbd
version: 8.0.0 (api:86/proto:86)
SVN Revision: 2759 build by florian@sour, 2007-02-21 16:06:15
0: cs:Connected st:Primary/Secondary ds:UpToDate/UpToDate C r---
ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0
resync: used:0/31 hits:0 misses:0 starving:0 dirty:0 changed:0
act_log: used:0/257 hits:0 misses:0 starving:0 dirty:0 changed:0
Releasing the device

デバイスの解放

The first thing we do now is free /dev/drbd0 (if we don’t do this, DRBD will refuse to change that device’s status):

まず最初にすることは /dev/drbd0 を解放すること(こうしないと DRBD はデバイスの状態を変えようとしても拒否する)。

root@joe:~# umount /dev/drbd0
Demoting the resource

リソースを降格させる

Then we demote r0 on joe, so that the device is secondary on both nodes:

そしたら joe の r0 を降格させる。そうすると両方のノードでデバイスはセカンダリとなる。

root@joe:~# drbdadm secondary r0
root@joe:~# cat /proc/drbd
version: 8.0.0 (api:86/proto:86)
SVN Revision: 2759 build by florian@sour, 2007-02-21 16:06:15
0: cs:Connected st:Secondary/Secondary ds:UpToDate/UpToDate C r---
ns:0 nr:0 dw:0 dr:0 al:0 bm:81 lo:0 pe:0 ua:0 ap:0
resync: used:0/31 hits:0 misses:0 starving:0 dirty:0 changed:0
act_log: used:0/257 hits:0 misses:0 starving:0 dirty:0 changed:0
Promoting the resource

リソースを昇格させる

At this time we can promote jane to become the primary node for this resource:

この時点で jane をこのリソースに対するプライマリノードに昇格させることができる。

root@jane:~# drbdadm primary r0
root@jane:~# cat /proc/drbd
version: 8.0.0 (api:86/proto:86)
SVN Revision: 2759 build by florian@sour, 2007-02-21 16:06:15
0: cs:Connected st:Primary/Secondary ds:UpToDate/UpToDate C r---
ns:0 nr:0 dw:0 dr:0 al:0 bm:81 lo:0 pe:0 ua:0 ap:0
resync: used:0/31 hits:0 misses:0 starving:0 dirty:0 changed:0
act_log: used:0/257 hits:0 misses:0 starving:0 dirty:0 changed:0
Using the resource

リソースを利用する

Finally, we can mount the device on Jane:

最後に jane でデバイスをマウント出来る。

root@jane:~# mount /dev/drbd0 /mnt
Other things you might want to try

ほかに試してみたいこと

DRBD disallows a few things so as to keep you from shooting yourself in the foot. You might try the following things just to see what happens:

DRBD は自分で自分の足を撃ってしまわないよういくつかの制限を設けている。なにが起きるのかを確認するために次の事柄をためしてみたいかもしれない。

  • Demoting a primary device to secondary while it’s still mounted. This will fail with a “device held open by someone” error.

    まだマウントされている状態でプライマリデバイスをセカンダリに降格させようとする。この場合 “device held open by someone” というエラーで失敗するだろう。
  • Making a device primary while the other one is primary too, unless this is explicitly allowed.

    (明示的に許可されていない状態で)他方がプライマリの状態でデバイスをプライマリにしようとする。
  • Mounting the backing device directly, while being used by DRBD.

    DRBD で利用されている状態でブロックデバイスを直接マウントしようとする。
前: DRBD – Getting started [対訳] 次: DRBD – Integrating with Heartbeat V1 [対訳]

Comments are closed.