バックアップソフトウエアです 本家様 [[http://blog.bacula.org/>+http://blog.bacula.org/]] 本家様 [[http://blog.bacula.org/>+http://blog.bacula.org/]] マニュアル[[http://blog.bacula.org/documentation/documentation/>+http://blog.bacula.org/documentation/documentation/]] 下記6の要素があるようで、ここではDirectorとConsole、Monitor、Catalogを一つにまとめ3つの要素として扱う -&color(orangered){Bacula Director}; バックアップを統括。リストア、バックアップ検証、アーカイブを管理する。デーモンが稼働する bacula-director, bacula-common, bacula-libs, bacula-libs-sql, logwatch, mailx -&color(orangered){Bacula Console}; Directorに繋がって、処理を依頼するプログラム。テキストベースでもGUIベースのものもある。 bacula-console, bacula-console-bat, bacula-libs, libmng, pciutils, qt, qt-settings, qt-x11 -&color(orangered){Catalog}; バックアップされたファイルの場所とかを収録するデータベース。MySQL、PostgreSQL、SQLiteらに対応済み ここではPostgreSQLを使用します。 -&color(orangered){Bacula Monitor}; Bacula Directors、Bacula File Daemons、Bacula Storage Daemonsを監視するプログラム ~ -&color(magenta){Bacula Storage}; バックアップ先で稼働。大容量ディスク/テープ装置を持つ bacula-storage, bacula-common, bacula-libs, bacula-libs-sql, mt-st ~ -&color(limegreen){Bacula File}; バックアップ対象で稼働する。 bacula-client, bacula-common, bacula-libs もちろん構成によっては全部が1台で動かしても構わない。 でも、バックアップ対象(&color(limegreen){File};)が複数あって、&color(orangered){director};と&color(magenta){storage};が一緒となるのが多いのかな? 一応、仮想マシンとかデータベースのオンラインバックアップもできるようだけど、こちらは料金が発生するみたい。 まぁファイルだけのバックアップを行うのなら、これでいいかな。 関連:[[VTL]], [[Bacula/configuration]], [[Bacula/labeling]], [[Bacula/bat]], [[Bacula/bconsole]], [[Bacula/memo]] ***構成図 [#d5720f01] &ref(2015y05m30d_093913113.png,nolink,noborder); 3台構成で、&color(orangered){director};、&color(magenta){storage};、&color(limegreen){file};で構築してみた。OSは共にCentOS7 ***&color(orangered){director}; [#sfa8aaaf] まずCatalogを収めるデータベース(PostgreSQL)をインストールして、Unix domain socketでtrust認証を可能にさせる。 &color(red){*};&size(10){IPv4でmd5認証接続でも構わない}; #code(nonumber){{ [root@director ~]# yum install postgresql-server [root@director ~]# postgresql-setup initdb [root@director ~]# vi /var/lib/pgsql/data/pg_hba.conf - local all all peer + local all all trust [root@director ~]# systemctl enable postgresql [root@director ~]# systemctl start postgresql }} これでCatalogの準備は完了で、次にBacula Directorをインストールする。 #code(nonumber){{ [root@director ~]# curl -o /etc/yum.repos.d/slaanesh-Bacula-epel-7.repo \ https://copr.fedorainfracloud.org/coprs/slaanesh/Bacula/repo/epel-7/slaanesh-Bacula-epel-7.repo [root@director ~]# sed -i 's/enabled=1/enabled=0/' /etc/yum.repos.d/slaanesh-Bacula-epel-7.repo [root@director ~]# yum --enablerepo=slaanesh-Bacula install bacula-director bacula-console }} これで/etc/passwdにbaculaユーザが作成されます。 その後、&color(orangered){bacula-director};パッケージに含まれているCatalog向けのSQLを実行します。 これでBacula向けのデータベースとテーブルらと、そのテーブルを操作できるpostgres内ユーザ(bacula)が作られる。 #code(nonumber){{ [root@director ~]# su - postgres -c /usr/libexec/bacula/create_postgresql_database [root@director ~]# su - postgres -c /usr/libexec/bacula/make_postgresql_tables [root@director ~]# su - postgres -c /usr/libexec/bacula/grant_postgresql_privileges [root@director ~]# psql -U bacula -l データベース一覧 名前 | 所有者 | エンコーディング | 照合順序 | Ctype(変換演算子) | アクセス権 -----------+----------+------------------+------------+-------------------+----------------------- bacula | postgres | SQL_ASCII | C | C | postgres | postgres | UTF8 | ja_JP.utf8 | ja_JP.utf8 | template0 | postgres | UTF8 | ja_JP.utf8 | ja_JP.utf8 | =c/postgres + | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | ja_JP.utf8 | ja_JP.utf8 | =c/postgres + | | | | | postgres=CTc/postgres (4 行) [root@director ~]# }} &color(white,blue){留意}; 当然このdirectorとは違うマシンのpostgresも利用できる もし違うマシンのpostgres、違うユーザで使用するなら/etc/bacula/bacula-dir.confのCatalog項を修正する。 #code(nonumber){{ Catalog { Name = MyCatalog dbname = "bacula"; dbuser = "bacula"; dbpassword = "" } }} これで&color(orangered){bacula-director};のインストールは完了 ***&color(magenta){storage}; [#ub0dd368] バックアップ先のマシンに&color(magenta){bacula-storage};パッケージをインストールします。 #code(nonumber){{ [root@storage ~]# yum --enablerepo=slaanesh-Bacula install bacula-storage }} インストールと同時に/etc/passwdにbaculaユーザが作成されます。またBacula Storageのデーモンも作られる。 #code(nonumber){{ [root@storage ~]# getent passwd |grep bacula bacula:x:133:133:Bacula Backup System:/var/spool/bacula:/sbin/nologin [root@storage ~]# [root@storage ~]# systemctl list-unit-files |grep bacula bacula-sd.service disabled [root@storage ~]# }} ***&color(limegreen){File};(CentOS7) [#a7b281c9] いわゆるバックアップソフトのクライアントをバックアップ対象マシンにインストールします。 #code(nonumber){{ [root@client ~]# yum --enablerepo=slaanesh-Bacula install bacula-client [root@client ~]# systemctl list-unit-files |grep bacula bacula-fd.service disabled [root@client ~]# }} ***設定 [#v1dbab40] 設定はかなり複雑で [[Bacula/configuration]] にて提示します。 ***日本語文字化け [#mc506e6d] bconsoleで日本語があると文字化けが生じる。 /etc/sysconfig/bacula-dirにLANG=Cを追加すれば回避可能 #code(diff,nonumber){{ --- /etc/sysconfig/bacula-dir.orig 2018-01-29 21:31:18.000000000 +0900 +++ /etc/sysconfig/bacula-dir 2018-05-16 21:47:25.352246182 +0900 @@ -3,6 +3,7 @@ DIR_USER=bacula DIR_GROUP=bacula +LANG=C # Useful for debugging # }}