Ubuntu 20.04でインストールされるdrbdは8.4なのか9.11なのか?

Ubuntu 20.04でdrbdを使おうとしたら、drbd-utilsのバージョンは9.11.0だが、drbd自体は8.4.11 といういまいちわけがわからない状態になっていた。

2022/04/22追記:Ubuntu 22.04 LTSでも状況はほぼ同じだった。詳しくは最後尾
2023/02/20: 本文を現状にあわせて若干修正

どういうことなのか調査してみた。

なお、drbd 8.4.11として使った場合にいくつか問題点があったが、それについては別記事「Ubuntu 20.04で標準のdrbd 8.4.11を使う場合の注意点」に記載している。


ubuntuのサイトに掲載されている「Ubuntu HA – DRBD」ではバージョンに関する話は特に書いておらず「sudo apt install drbd-utils」だけでインストールは完了し、あとは/etc/drbd.confの編集、という手順になっている。

次にdrbdの開発元であるlinbitが公開している「drbd 8ドキュメント」と「drbd 9ドキュメント」を見るとそれぞれ手順が異なっている。

drbd8では標準レポジトリだけでインストールできる、という趣旨だったものが、drbd9では明示的にPPAレポジトリを使え、と変更されている。

とりあえずは「apt install drbd-utils」でインストールかな?と実行してみると普通に実行できる。

1$ sudo -i
2# apt install drbd-utils
3Reading package lists... Done
4Building dependency tree
5Reading state information... Done
6The following additional packages will be installed:
7  guile-2.2-libs libgc1c2 libgsasl7 libidn11 libkyotocabinet16v5 libmailutils6
8  libmysqlclient21 libntlm0 mailutils mailutils-common mysql-common postfix
9  ssl-cert
10Suggested packages:
11  heartbeat mailutils-mh mailutils-doc procmail postfix-mysql postfix-pgsql
12  postfix-ldap postfix-pcre postfix-lmdb postfix-sqlite sasl2-bin
13  | dovecot-common resolvconf postfix-cdb postfix-doc openssl-blacklist
14The following NEW packages will be installed:
15  drbd-utils guile-2.2-libs libgc1c2 libgsasl7 libidn11 libkyotocabinet16v5
16  libmailutils6 libmysqlclient21 libntlm0 mailutils mailutils-common
17  mysql-common postfix ssl-cert
180 upgraded, 14 newly installed, 0 to remove and 0 not upgraded.
19Need to get 9,579 kB of archives.
20After this operation, 66.5 MB of additional disk space will be used.
21Do you want to continue? [Y/n] y
22<略>

postfixとdovecotもインストールされるため下記のダイアログも開くので注意が必要。

インストール後、パッケージを調べて見ると、drbd-utilsは9.11.0だけど、drbd-docは8.4というちぐはぐな状態であることに気がつく。

1root@ubuntu143:~# apt search drbd
2Sorting... Done
3Full Text Search... Done
4collectd-core/focal 5.9.2.g-1ubuntu5 amd64
5  statistics collection and monitoring daemon (core system)
6 
7drbd-doc/focal 8.4~20151102-1 all
8  RAID 1 over TCP/IP for Linux (user documentation)
9 
10drbd-utils/focal,now 9.11.0-1build1 amd64 [installed]
11  RAID 1 over TCP/IP for Linux (user utilities)
12 
13nagios-plugins-contrib/focal 25.20191015+1ubuntu1 amd64
14  Plugins for nagios compatible monitoring systems
15 
16prometheus-hacluster-exporter/focal 0.4.0-2 amd64
17  Prometheus exporter for HA cluster services
18 
19root@ubuntu143:~#

動作させてみると /proc/drbd が返すバージョンは 「version: 8.4.11 (api:1/proto:86-101)」だった。

1root@ubuntu143:~# cat /proc/drbd
2version: 8.4.11 (api:1/proto:86-101)
3srcversion: FC3433D849E3B88C1E7B55C
4 0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-----
5    ns:6276 nr:0 dw:42864576 dr:5041 al:328 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
6root@ubuntu143:~#

drbdは9.0からauto promoteという機能が追加されたので、それを使いたい場合に、8.4だと困る、ということになる。

このauto promoteは、両ノードが再起動した際に最初にdrbdデバイスにアクセスしてきたノードを自動的にprimaryに設定してくれる、という機能である。(8.xまでは両方ともSecondaryのままで、手動でprimaryに設定する必要があった)

というわけで、drbd9を使いたい場合は、PPAレポジトリを追加してlinbitが提供するdrbd9をインストールする必要がある。

ドキュメントに書かれているPPAレポジトリ情報は誤りがあり、正しくは「https://launchpad.net/~linbit/+archive/ubuntu/linbit-drbd9-stack」だった。

ここにあるように「add-apt-repository ppa:linbit/linbit-drbd9-stack」を実行してPPAレポジトリを追加する。

1root@ubuntu143:~# add-apt-repository ppa:linbit/linbit-drbd9-stack
2 This PPA contains DRBD9, drbd-utils, LINSTOR (client, python API, server).
3 
4This differs from official, production grade LINBIT repositories in several ways, including:
5- We push RCs immediately to the PPA
6- We don't push hotfixes, these usually have to wait until the next RC/release
7- We only keep 2 LTS versions up to date (Bionic and Focal, but not Xenial)
8 
9For support and access to official repositories see:
10https://www.linbit.com or write an email to: sales AT linbit.com
11 More info: https://launchpad.net/~linbit/+archive/ubuntu/linbit-drbd9-stack
12Press [ENTER] to continue or Ctrl-c to cancel adding it.
13 
14Hit:1 http://jp.archive.ubuntu.com/ubuntu focal InRelease
15Get:2 http://jp.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
16Get:3 http://jp.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
17Get:4 http://jp.archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
19Get:6 http://ppa.launchpad.net/linbit/linbit-drbd9-stack/ubuntu focal/main amd64 Packages [2,344 B]
20Get:7 http://ppa.launchpad.net/linbit/linbit-drbd9-stack/ubuntu focal/main Translation-en [1,308 B]
21Fetched 356 kB in 3s (137 kB/s)
22Reading package lists... Done
23root@ubuntu143:~#

で・・・linbit提供のdrbdはdkmsモジュールとして提供されるため「apt install drbd-utils drbd-dkms」を実行してインストールすることになる。

今回のテスト環境ではdrbd8が既にインストールされていたので、最初に「apt update;apt upgrade」を実行してapt-utilsのバージョンアップを行った。

1root@ubuntu143:~# apt update
3Get:2 http://jp.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
4Get:3 http://jp.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
5Get:4 http://jp.archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
7Fetched 328 kB in 1s (538 kB/s)
8Reading package lists... Done
9Building dependency tree
10Reading state information... Done
111 package can be upgraded. Run 'apt list --upgradable' to see it.
12root@ubuntu143:~# apt list --upgradable
13Listing... Done
14drbd-utils/focal 9.19.1-1ppa1~focal1 amd64 [upgradable from: 9.11.0-1build1]
15N: There is 1 additional version. Please use the '-a' switch to see it
16root@ubuntu143:~# apt upgrade
17Reading package lists... Done
18Building dependency tree
19Reading state information... Done
20Calculating upgrade... Done
21The following packages will be upgraded:
22  drbd-utils
231 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
24Need to get 720 kB of archives.
25After this operation, 75.8 kB of additional disk space will be used.
26Do you want to continue? [Y/n] y
27Get:1 http://ppa.launchpad.net/linbit/linbit-drbd9-stack/ubuntu focal/main amd64 drbd-utils amd64 9.19.1-1ppa1~focal1 [720 kB]
28Fetched 720 kB in 3s (214 kB/s)
29Preconfiguring packages ...
30(Reading database ... 72754 files and directories currently installed.)
31Preparing to unpack .../drbd-utils_9.19.1-1ppa1~focal1_amd64.deb ...
32Unpacking drbd-utils (9.19.1-1ppa1~focal1) over (9.11.0-1build1) ...
33Setting up drbd-utils (9.19.1-1ppa1~focal1) ...
34 
35Configuration file '/etc/drbd.d/global_common.conf'
36 ==> Modified (by you or by a script) since installation.
37 ==> Package distributor has shipped an updated version.
38   What would you like to do about it ?  Your options are:
39    Y or I  : install the package maintainer's version
40    N or O  : keep your currently-installed version
41      D     : show the differences between the versions
42      Z     : start a shell to examine the situation
43 The default action is to keep your current version.
44*** global_common.conf (Y/I/N/O/D/Z) [default=N] ? y
45Installing new version of config file /etc/drbd.d/global_common.conf ...
46Installing new version of config file /etc/init.d/drbd ...
47Processing triggers for man-db (2.9.1-1) ...
48Processing triggers for systemd (245.4-4ubuntu3.13) ...
49root@ubuntu143:~#

次に、「apt install drbd-dkms」でdrbd本体をインストールした。

1root@ubuntu143:~# apt install drbd-dkms
2Reading package lists... Done
3Building dependency tree
4Reading state information... Done
5The following additional packages will be installed:
6  autoconf automake autopoint autotools-dev binutils binutils-common
7  binutils-x86-64-linux-gnu build-essential cpp cpp-9 dctrl-tools debhelper
8  dh-autoreconf dh-strip-nondeterminism dkms dpkg-dev dwz fakeroot g++ g++-9
9  gcc gcc-9 gcc-9-base gettext intltool-debian libalgorithm-diff-perl
10  libalgorithm-diff-xs-perl libalgorithm-merge-perl libarchive-cpio-perl
11  libarchive-zip-perl libasan5 libatomic1 libbinutils libc-dev-bin libc6-dev
12  libcc1-0 libcroco3 libcrypt-dev libctf-nobfd0 libctf0 libdebhelper-perl
13  libdpkg-perl libfakeroot libfile-fcntllock-perl
14  libfile-stripnondeterminism-perl libgcc-9-dev libgomp1 libisl22 libitm1
15  liblsan0 libltdl-dev libmail-sendmail-perl libmpc3 libquadmath0
16  libstdc++-9-dev libsub-override-perl libsys-hostname-long-perl libtool
17  libtsan0 libubsan1 linux-libc-dev m4 make manpages-dev po-debconf
18Suggested packages:
19  autoconf-archive gnu-standards autoconf-doc binutils-doc cpp-doc
20  gcc-9-locales debtags dh-make menu debian-keyring g++-multilib
21  g++-9-multilib gcc-9-doc gcc-multilib flex bison gdb gcc-doc gcc-9-multilib
22  gettext-doc libasprintf-dev libgettextpo-dev glibc-doc bzr libtool-doc
23  libstdc++-9-doc gfortran | fortran95-compiler gcj-jdk m4-doc make-doc
24  libmail-box-perl
25The following NEW packages will be installed:
26  autoconf automake autopoint autotools-dev binutils binutils-common
27  binutils-x86-64-linux-gnu build-essential cpp cpp-9 dctrl-tools debhelper
28  dh-autoreconf dh-strip-nondeterminism dkms dpkg-dev drbd-dkms dwz fakeroot
29  g++ g++-9 gcc gcc-9 gcc-9-base gettext intltool-debian
30  libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl
31  libarchive-cpio-perl libarchive-zip-perl libasan5 libatomic1 libbinutils
32  libc-dev-bin libc6-dev libcc1-0 libcroco3 libcrypt-dev libctf-nobfd0 libctf0
33  libdebhelper-perl libdpkg-perl libfakeroot libfile-fcntllock-perl
34  libfile-stripnondeterminism-perl libgcc-9-dev libgomp1 libisl22 libitm1
35  liblsan0 libltdl-dev libmail-sendmail-perl libmpc3 libquadmath0
36  libstdc++-9-dev libsub-override-perl libsys-hostname-long-perl libtool
37  libtsan0 libubsan1 linux-libc-dev m4 make manpages-dev po-debconf
380 upgraded, 66 newly installed, 0 to remove and 0 not upgraded.
39Need to get 47.8 MB of archives.
40After this operation, 208 MB of additional disk space will be used.
41Do you want to continue? [Y/n] y
42<略>
43drbd.ko:
44Running module version sanity check.
45 - Original module
46   - No original module exists within this kernel
47 - Installation
48   - Installing to /lib/modules/5.4.0-90-generic/updates/dkms/
49 
50drbd_transport_tcp.ko:
51Running module version sanity check.
52 - Original module
53   - No original module exists within this kernel
54 - Installation
55   - Installing to /lib/modules/5.4.0-90-generic/updates/dkms/
56 
57depmod..........
58 
59DKMS: install completed.
60Processing triggers for install-info (6.7.0.dfsg.2-5) ...
61Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
62Processing triggers for man-db (2.9.1-1) ...
63root@ubuntu143:~#

これで再起動

すると下記の様にdrbdのバージョンが「version: 9.1.4 (api:2/proto:110-121)」となった。

1root@ubuntu143:~# cat /proc/drbd
2version: 9.1.4 (api:2/proto:110-121)
3GIT-hash: e4de25c3a65811b0fa4733b1c2a000ee322f5cfa build by root@ubuntu143, 2021-11-24 07:10:11
4Transports (api:17): tcp (9.1.4)
5root@ubuntu143:~#

この状態でdrbd関連パッケージの状態を確認する下記の様になっていた。

1root@ubuntu143:~# apt search drbd
2Sorting... Done
3Full Text Search... Done
4collectd-core/focal 5.9.2.g-1ubuntu5 amd64
5  statistics collection and monitoring daemon (core system)
6 
7drbd-dkms/focal,now 9.1.4-1ppa1~focal1 all [installed]
8  RAID 1 over TCP/IP for Linux module source
9 
10drbd-doc/focal 8.4~20151102-1 all
11  RAID 1 over TCP/IP for Linux (user documentation)
12 
13drbd-module-source/focal 9.1.4-1ppa1~focal1 all
14  RAID 1 over TCP/IP for Linux module source
15 
16drbd-reactor/focal 0.5.0-1ppa1~focal1 amd64
17  Monitors DRBD resources via plugins.
18 
19drbd-utils/focal,now 9.19.1-1ppa1~focal1 amd64 [installed]
20  RAID 1 over TCP/IP for Linux (user utilities)
21 
22drbd8-utils/focal 2:9.19.1-1ppa1~focal1 amd64
23  transitional dummy package
24 
25linstor-common/focal 1.16.0-1ppa1~focal1 all
26  DRBD distributed resource management utility
27 
28linstor-controller/focal 1.16.0-1ppa1~focal1 all
29  DRBD distributed resource management utility
30 
31linstor-satellite/focal 1.16.0-1ppa1~focal1 all
32  DRBD distributed resource management utility
33 
34nagios-plugins-contrib/focal 25.20191015+1ubuntu1 amd64
35  Plugins for nagios compatible monitoring systems
36 
37prometheus-hacluster-exporter/focal 0.4.0-2 amd64
38  Prometheus exporter for HA cluster services
39 
40root@ubuntu143:~#

2022/04/22追記

Ubuntu 22.04 LTSが出たので状況を確認してみた。

1user$ apt search drbd
2Sorting... Done
3Full Text Search... Done
4drbd-doc/jammy 8.4~20220106-1 all
5  RAID 1 over TCP/IP for Linux (user documentation)
6 
7drbd-utils/jammy 9.15.0-1build2 amd64
8  RAID 1 over TCP/IP for Linux (user utilities)
9 
10monitoring-plugins-contrib/jammy 37.20211217ubuntu1 amd64
11  Plugins for nagios compatible monitoring systems
12 
13prometheus-hacluster-exporter/jammy 1.2.3-2 amd64
14  Prometheus exporter for HA cluster services
15 
16user@ubuntu2204:~$ modinfo drbd
17filename:       /lib/modules/5.15.0-25-generic/kernel/drivers/block/drbd/drbd.ko
18alias:          block-major-147-*
19license:        GPL
20version:        8.4.11
21description:    drbd - Distributed Replicated Block Device v8.4.11
22author:         Philipp Reisner <phil@linbit.com>, Lars Ellenberg <lars@linbit.com>
23srcversion:     C369F58AE19642816B00C81
24depends:        lru_cache,libcrc32c
25retpoline:      Y
26intree:         Y
27name:           drbd
28vermagic:       5.15.0-25-generic SMP mod_unload modversions
29sig_id:         PKCS#7
30signer:         Build time autogenerated kernel key
31sig_key:        43:DE:0B:33:F7:CF:5A:CE:F6:19:E2:2A:DD:DD:1D:BD:4D:ED:8E:ED
32sig_hashalgo:   sha512
33signature:      72:7A:0C:A3:E5:31:68:E8:FC:55:61:6F:FF:E1:11:B1:90:9F:8D:DF:
34                29:E0:16:9D:C5:6D:0A:D4:A6:48:88:87:E0:5B:46:73:96:24:8A:1D:
35                51:1E:39:4B:A4:20:65:42:2F:A7:2B:6A:ED:AE:8B:4E:FD:0F:E5:94:
36                7C:03:0D:53:1F:21:C4:09:AF:7A:91:32:23:0E:E2:3A:32:79:FF:0B:
37                36:E7:BC:7A:5E:72:A0:6E:05:2C:04:B6:4B:01:77:65:5A:43:EA:AB:
38                F0:BE:B0:97:2E:65:81:7B:90:67:76:E5:64:2D:EF:8A:9A:3F:21:DD:
39                CF:A6:C8:3B:87:4D:C1:1C:6C:F8:AD:F2:01:C2:DC:BD:CA:3F:85:4C:
40                A8:A6:B3:C5:83:C8:13:76:31:77:51:8C:37:3D:D4:77:00:29:8F:BE:
41                1A:E3:C4:1F:EE:96:1E:24:24:9A:77:BE:F4:7C:40:4D:BD:34:83:69:
42                8D:0C:E6:DA:FC:F0:65:74:52:86:EA:8F:26:2B:71:5B:BB:79:73:0C:
43                26:D1:66:4D:FC:71:B2:E4:B3:0B:4D:85:EC:CF:98:CB:E6:83:C6:79:
44                28:F1:BF:23:CC:30:68:0E:F4:50:85:04:D1:AF:87:31:E0:4E:A5:1D:
45                5B:F7:6F:18:34:17:E9:8D:84:6C:B5:2C:9F:6F:38:DA:4D:9D:4B:3F:
46                38:6D:38:5E:02:56:23:DB:B3:F4:06:6E:EE:52:F1:09:62:59:1A:BA:
47                57:1E:E7:10:0F:61:E1:86:5C:3E:ED:67:D6:AF:9F:CE:69:F3:38:D4:
48                EA:91:30:72:7F:B3:02:08:82:0F:C4:4B:8C:85:86:6E:4A:9F:E3:51:
49                78:A7:4D:C2:E1:E2:7D:20:F5:42:F6:A7:6F:76:76:04:B9:93:E7:99:
50                53:9A:3F:6D:61:AA:31:B2:04:59:BE:E4:16:E3:8C:4E:D0:58:0A:FE:
51                FF:1C:79:D6:5E:72:72:3D:A0:41:47:DC:04:8C:04:04:C6:E7:6A:55:
52                5A:E7:FC:B1:C5:B5:CD:C3:D3:03:3A:B8:3E:C1:24:87:93:DD:34:1A:
53                4B:97:3B:61:7C:CB:E9:34:90:C2:C5:C5:2A:79:74:D1:49:E6:50:A1:
54                9F:35:AA:14:38:1B:0F:01:27:4E:44:F5:0F:7C:28:41:77:0A:AB:A9:
55                0A:43:0C:CB:69:27:B8:E4:CA:FA:E9:01:12:A3:57:D2:7B:9F:9F:8E:
56                4D:A1:F9:5B:12:AD:F8:87:FA:49:F2:E3:72:D4:2A:A4:6F:EF:C7:13:
57                2D:96:BF:E9:7C:3F:63:5B:60:C7:33:7B:5C:FA:9A:3A:66:83:41:63:
58                B6:67:18:DC:D4:5F:D6:4B:5F:DA:F2:74
59parm:           allow_oos:DONT USE! (bool)
60parm:           disable_sendpage:bool
61parm:           proc_details:int
62parm:           minor_count:Approximate number of drbd devices (1-255) (uint)
63parm:           usermode_helper:string
64user@ubuntu2204:$

drbd-utilsのバージョンが 9.15.0 にアップデートしているが、kernelに含まれているdrbd は8.4.11 のままとなっていた。

“Ubuntu 20.04でインストールされるdrbdは8.4なのか9.11なのか?” への1件の返信

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Statcounter