2009年6月10日水曜日

DRBD7からDRBD8.3.1への移行テスト(2)

前回書いている途中にもnfs-commonまわりがトラブる。

drbdはバージョンが変わって、設定ファイルが少しかわり、ディスクのメタデータも互換性がなくなっているので、パッケージ名を変えてdrbd-toolsにした。

起動後、lrp_load でパッケージを読み込もうとしたが、ネットワークの環境がことなるのでアドレスを取り直した。dhcpクライアントは udhcpcに変わっている。ボンディングを行う、ifenslaveは正常に動作していたようでbond0ができていたので、bond0にアドレスをつけ直した。

# udhcpc -i bond0
# lrp_load -b drbd-tools

drbdが自動起動して、設定ファイルの互換性が無いのでパースエラーがでる。
設定ファイルを抜き出すとこんな感じ。

resource r0 {
protocol C;
incon-degr-cmd "echo '!DRBD! pri on incon-degr' | wall ; sleep 60 ; halt -f";

startup {
wfc-timeout 180;
degr-wfc-timeout 120; # 2 minutes.
}

disk {
on-io-error pass_on;
}

net {
connect-int 10; # 10 seconds (unit = 1 second)
ping-int 10; # 10 seconds (unit = 1 second)
}

syncer {
rate 10M;
group 1;
al-extents 257;
}

on db1 {
device /dev/drbd0;
disk /dev/vg/lvother;
address 192.168.XXX.XX:7788;
meta-disk internal;
}

on db2{
device /dev/drbd0;
disk /dev/vg/lvother;
address 192.168.YYY.YY:7788;
meta-disk internal;
}
}


これの場合だと
group=1 を消す

それと
incon-degr-cmd "echo '!DRBD! pri on incon-degr' | wall ; sleep 60 ; halt -f";
の行を編集して。
handlers{
pri-on-incon-degr "echo '!DRBD! pri on incon-degr' | wall ; sleep 60 ; halt -f";
}

にする。(意味が分かっていないので自己責任で)

次に、ディスクのメタデータをアップグレードする。互換性がなくなるので、これはやらないで、新規のディスクでdrbdを動作させてデータを移行したほうがいいと思うが、これはテストなので問答無用でアップグレードする。

関係ないが、sshするので全部受信許可した
# iptables -I INPUT -j ACCEPT

drbdadmのヘルプ

# drbdadm

USAGE: drbdadm [OPTION...] [-- DRBDSETUP-OPTION...] COMMAND {all|RESOURCE...}

OPTIONS:
{--stacked|-S}
{--dry-run|-d}
{--verbose|-v}
{--config-file|-c} val
{--drbdsetup|-s} val
{--drbdmeta|-m} val
{--drbd-proxy-ctl|-p} val
{--sh-varname|-n} val
{--force|-f}

COMMANDS:
attach detach
connect disconnect
up down
primary secondary
invalidate invalidate-remote
outdate resize
syncer verify
pause-sync resume-sync
adjust wait-connect
wait-con-int role
cstate dstate
dump dump-xml
create-md show-gi
get-gi dump-md
wipe-md hidden-commands

Version: 8.3.1 (api:88)
GIT-hash: fd40f4a8f9104941537d1afc8521e584a6d3003c build by kitakura@c2duo, 2009-06-08 07:27:18

missing arguments


リソース名がr0のディスクをつくる。

# drbdadm create-md r0

--== This is a new installation of DRBD ==--
Please take part in the global DRBD usage count at http://usage.drbd.org.

The counter works anonymously. It creates a random number to identify
your machine and sends that random number, along with
DRBD's version number, to usage.drbd.org.

The benefits for you are:
* In response to your submission, the server (usage.drbd.org) will tell you
how many users before you have installed this version (8.3.1).
* With a high counter LINBIT has a strong motivation to
continue funding DRBD's development.

http://usage.drbd.org/cgi-bin/insert_usage.pl?nu=6522805258890751169&git=fd40f4a8f9104941537d1afc8521e584a6d3003c

In case you want to participate but know that this machine is firewalled,
simply issue the query string with your favorite web browser or wget.
You can control all of this by setting 'usage-count' in your drbd.conf.

* You may enter a free form comment about your machine, that gets
used on usage.drbd.org instead of the big random number.
* If you wish to opt out entirely, simply enter 'no'.
* To count this node without comment, just press [RETURN]

よく分かっていないが、インターネットにアクセスして登録っぽいことをするのか
とにかくRETURN

--== Thank you for participating in the global usage survey ==--
The server's response is:

you are the 1796th user to install this version

From now on, drbdadm will contact usage.drbd.org only when you update
DRBD or when you use 'drbdadm create-md'. Of course it will continue
to ask you for confirmation as long as 'usage-count' is at its default
value of 'ask'.

Just press [RETURN] to continue:


1796番目のユーザーらしい。さらにリターン

md_offset 5368705024
al_offset 5368672256
bm_offset 5368508416

Found ext3 filesystem which uses 5111808 kB
current configuration leaves usable 5242684 kB

Even though it looks like this would place the new meta data into
unused space, you still need to confirm, as this is only a guess.

Do you want to proceed?
[need to type 'yes' to confirm]

そして yes。

You want me to create a v08 style flexible-size internal meta data block.
There apears to be a v07 fixed-size internal meta data block
already in place on /dev/vg/lvother at byte offset 5234491392

Convert the existing v07 meta-data to v08?
[need to type 'yes' to confirm] yes

Converting meta data...
Writing meta data...
New drbd meta data block successfully created.

--== Creating metadata ==--
As with nodes, we count the total number of devices mirrored by DRBD at
at http://usage.drbd.org.

The counter works anonymously. It creates a random number to identify
the device and sends that random number, along with
DRBD's version number, to usage.drbd.org.

http://usage.drbd.org/cgi-bin/insert_usage.pl?nu=6522805258890751169&ru=8999730253493416010&rs=5368709120

* If you wish to opt out entirely, simply enter 'no'.
* To continue, just press [RETURN]
success

たぶん success

masterを落として、このアップグレードをslaveでも行う。
そして、slaveを落として masterでdrbdが起動することを確認して、
slaveを上げる予定

ーーーーつづく

0 件のコメント: