Quantcast
Channel: OSAKANA TAROのメモ帳
Viewing all articles
Browse latest Browse all 1108

Ubuntu 20.04でdrbdを使う場合の注意点

$
0
0

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

drbd 8ドキュメント」と「drbd 9ドキュメント」を見るとそれぞれ手順が違う。

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

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

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

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

root@ubuntu143:~# apt search drbd
Sorting... Done
Full Text Search... Done
collectd-core/focal 5.9.2.g-1ubuntu5 amd64
  statistics collection and monitoring daemon (core system)

drbd-doc/focal 8.4~20151102-1 all
  RAID 1 over TCP/IP for Linux (user documentation)

drbd-utils/focal,now 9.11.0-1build1 amd64 [installed]
  RAID 1 over TCP/IP for Linux (user utilities)

nagios-plugins-contrib/focal 25.20191015+1ubuntu1 amd64
  Plugins for nagios compatible monitoring systems

prometheus-hacluster-exporter/focal 0.4.0-2 amd64
  Prometheus exporter for HA cluster services

root@ubuntu143:~#

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

root@ubuntu143:~# cat /proc/drbd
version: 8.4.11 (api:1/proto:86-101)
srcversion: FC3433D849E3B88C1E7B55C
 0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-----
    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
root@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レポジトリを追加する。

root@ubuntu143:~# add-apt-repository ppa:linbit/linbit-drbd9-stack
 This PPA contains DRBD9, drbd-utils, LINSTOR (client, python API, server).

This differs from official, production grade LINBIT repositories in several ways, including:
- We push RCs immediately to the PPA
- We don't push hotfixes, these usually have to wait until the next RC/release
- We only keep 2 LTS versions up to date (Bionic and Focal, but not Xenial)

For support and access to official repositories see:
https://www.linbit.com or write an email to: sales AT linbit.com
 More info: https://launchpad.net/~linbit/+archive/ubuntu/linbit-drbd9-stack
Press [ENTER] to continue or Ctrl-c to cancel adding it.

Hit:1 http://jp.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://jp.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://jp.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Get:4 http://jp.archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:5 http://ppa.launchpad.net/linbit/linbit-drbd9-stack/ubuntu focal InRelease [24.4 kB]
Get:6 http://ppa.launchpad.net/linbit/linbit-drbd9-stack/ubuntu focal/main amd64 Packages [2,344 B]
Get:7 http://ppa.launchpad.net/linbit/linbit-drbd9-stack/ubuntu focal/main Translation-en [1,308 B]
Fetched 356 kB in 3s (137 kB/s)
Reading package lists... Done
root@ubuntu143:~#

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

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

root@ubuntu143:~# apt update
Hit:1 http://jp.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://jp.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://jp.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Get:4 http://jp.archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:5 http://ppa.launchpad.net/linbit/linbit-drbd9-stack/ubuntu focal InRelease
Fetched 328 kB in 1s (538 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.
root@ubuntu143:~# apt list --upgradable
Listing... Done
drbd-utils/focal 9.19.1-1ppa1~focal1 amd64 [upgradable from: 9.11.0-1build1]
N: There is 1 additional version. Please use the '-a' switch to see it
root@ubuntu143:~# apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  drbd-utils
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 720 kB of archives.
After this operation, 75.8 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ppa.launchpad.net/linbit/linbit-drbd9-stack/ubuntu focal/main amd64 drbd-utils amd64 9.19.1-1ppa1~focal1 [720 kB]
Fetched 720 kB in 3s (214 kB/s)
Preconfiguring packages ...
(Reading database ... 72754 files and directories currently installed.)
Preparing to unpack .../drbd-utils_9.19.1-1ppa1~focal1_amd64.deb ...
Unpacking drbd-utils (9.19.1-1ppa1~focal1) over (9.11.0-1build1) ...
Setting up drbd-utils (9.19.1-1ppa1~focal1) ...

Configuration file '/etc/drbd.d/global_common.conf'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** global_common.conf (Y/I/N/O/D/Z) [default=N] ? y
Installing new version of config file /etc/drbd.d/global_common.conf ...
Installing new version of config file /etc/init.d/drbd ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.13) ...
root@ubuntu143:~#

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

root@ubuntu143:~# apt install drbd-dkms
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  autoconf automake autopoint autotools-dev binutils binutils-common
  binutils-x86-64-linux-gnu build-essential cpp cpp-9 dctrl-tools debhelper
  dh-autoreconf dh-strip-nondeterminism dkms dpkg-dev dwz fakeroot g++ g++-9
  gcc gcc-9 gcc-9-base gettext intltool-debian libalgorithm-diff-perl
  libalgorithm-diff-xs-perl libalgorithm-merge-perl libarchive-cpio-perl
  libarchive-zip-perl libasan5 libatomic1 libbinutils libc-dev-bin libc6-dev
  libcc1-0 libcroco3 libcrypt-dev libctf-nobfd0 libctf0 libdebhelper-perl
  libdpkg-perl libfakeroot libfile-fcntllock-perl
  libfile-stripnondeterminism-perl libgcc-9-dev libgomp1 libisl22 libitm1
  liblsan0 libltdl-dev libmail-sendmail-perl libmpc3 libquadmath0
  libstdc++-9-dev libsub-override-perl libsys-hostname-long-perl libtool
  libtsan0 libubsan1 linux-libc-dev m4 make manpages-dev po-debconf
Suggested packages:
  autoconf-archive gnu-standards autoconf-doc binutils-doc cpp-doc
  gcc-9-locales debtags dh-make menu debian-keyring g++-multilib
  g++-9-multilib gcc-9-doc gcc-multilib flex bison gdb gcc-doc gcc-9-multilib
  gettext-doc libasprintf-dev libgettextpo-dev glibc-doc bzr libtool-doc
  libstdc++-9-doc gfortran | fortran95-compiler gcj-jdk m4-doc make-doc
  libmail-box-perl
The following NEW packages will be installed:
  autoconf automake autopoint autotools-dev binutils binutils-common
  binutils-x86-64-linux-gnu build-essential cpp cpp-9 dctrl-tools debhelper
  dh-autoreconf dh-strip-nondeterminism dkms dpkg-dev drbd-dkms dwz fakeroot
  g++ g++-9 gcc gcc-9 gcc-9-base gettext intltool-debian
  libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl
  libarchive-cpio-perl libarchive-zip-perl libasan5 libatomic1 libbinutils
  libc-dev-bin libc6-dev libcc1-0 libcroco3 libcrypt-dev libctf-nobfd0 libctf0
  libdebhelper-perl libdpkg-perl libfakeroot libfile-fcntllock-perl
  libfile-stripnondeterminism-perl libgcc-9-dev libgomp1 libisl22 libitm1
  liblsan0 libltdl-dev libmail-sendmail-perl libmpc3 libquadmath0
  libstdc++-9-dev libsub-override-perl libsys-hostname-long-perl libtool
  libtsan0 libubsan1 linux-libc-dev m4 make manpages-dev po-debconf
0 upgraded, 66 newly installed, 0 to remove and 0 not upgraded.
Need to get 47.8 MB of archives.
After this operation, 208 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
<略>
drbd.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-90-generic/updates/dkms/

drbd_transport_tcp.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-90-generic/updates/dkms/

depmod..........

DKMS: install completed.
Processing triggers for install-info (6.7.0.dfsg.2-5) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Processing triggers for man-db (2.9.1-1) ...
root@ubuntu143:~#

これで再起動

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

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

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

root@ubuntu143:~# apt search drbd
Sorting... Done
Full Text Search... Done
collectd-core/focal 5.9.2.g-1ubuntu5 amd64
  statistics collection and monitoring daemon (core system)

drbd-dkms/focal,now 9.1.4-1ppa1~focal1 all [installed]
  RAID 1 over TCP/IP for Linux module source

drbd-doc/focal 8.4~20151102-1 all
  RAID 1 over TCP/IP for Linux (user documentation)

drbd-module-source/focal 9.1.4-1ppa1~focal1 all
  RAID 1 over TCP/IP for Linux module source

drbd-reactor/focal 0.5.0-1ppa1~focal1 amd64
  Monitors DRBD resources via plugins.

drbd-utils/focal,now 9.19.1-1ppa1~focal1 amd64 [installed]
  RAID 1 over TCP/IP for Linux (user utilities)

drbd8-utils/focal 2:9.19.1-1ppa1~focal1 amd64
  transitional dummy package

linstor-common/focal 1.16.0-1ppa1~focal1 all
  DRBD distributed resource management utility

linstor-controller/focal 1.16.0-1ppa1~focal1 all
  DRBD distributed resource management utility

linstor-satellite/focal 1.16.0-1ppa1~focal1 all
  DRBD distributed resource management utility

nagios-plugins-contrib/focal 25.20191015+1ubuntu1 amd64
  Plugins for nagios compatible monitoring systems

prometheus-hacluster-exporter/focal 0.4.0-2 amd64
  Prometheus exporter for HA cluster services

root@ubuntu143:~#


Viewing all articles
Browse latest Browse all 1108

Trending Articles