Configuration¶
Barmanには2種類の構成ファイルがあります。
グローバル/一般的な構成
サーバー構成
メイン構成ファイル(デフォルトで/etc/barman.conf
に設定)には、メインディレクトリ、システムユーザー、ログファイルなどの一般的なオプションが含まれています。
Barmanによってバックアップされるサーバーごとに1つのサーバー構成ファイルは、
/etc/barman.d ディレクトリにあり、 .conf
サフィックスが必要です。
重要
: For historical reasons, you can still have one single configuration file containing both global and server options. However, for maintenance reasons, this approach is deprecated.
Barmanの構成ファイルはINIフォーマットに従います。
構成ファイルは、異なる種類のパラメーターを受け入れます。
文字列
列挙型
整数
boolean、
on/true/1も受け入れられ、off/false/0も受け入れられます。
それらのどれも引用する必要はありません。
注:一部のenum はoff を許可しますが、false
は許可しません。
オプションの範囲¶
すべての構成オプションにはスコープがあります。
グローバル
サーバー
global/server :一般的にグローバルレベルで設定できるサーバーオプション
グローバルオプションは、INIファイルで[barman]
ラベルで識別されるGeneralセクションで使用できます。
[barman]
; ... global and global/server options go here
サーバーオプションは、構成ファイル内の角括弧で囲まれた行で指定されるサーバーセクションでのみ指定できます([
および] )。
serverセクションは、そのサーバーのIDをBarmanで表します。次の例では、pg
という名前のサーバーのセクションを指定します。
[pg]
; Configuration options for the
; server named pg go here
Barmanにはサーバー名として使用できない予約語が2つあります。
barman:グローバルセクションの識別子all: Barmanが管理するすべてのサーバーでいくつかのコマンドを順番に実行できる便利なショートカット
Barmanは、柔軟性を失うことなく構成が必要なオプションの数を削減しようとする 構成よりも規約 の設計パラダイムを実装します。したがって、一部のサーバーオプションはグローバルレベルで定義してサーバーレベルでオーバーライドできるため、ユーザーは一般的な動作を指定して1つ以上のサーバーに対して調整できます。これらのオプションには、global/server スコープがあります。
使用可能なすべての構成とその範囲のリストについては、 section 5 of the 'man' page を参照してください。
man 5 barman
構成例¶
以下は、メイン構成ファイルの基本的な例です。
[barman]
barman_user = barman
configuration_files_directory = /etc/barman.d
barman_home = /var/lib/barman
log_file = /var/log/barman/barman.log
log_level = INFO
compression = gzip
一方、以下の例は、ストリーミングバックアップを使用するサーバー構成ファイルです。
[streaming-pg]
description = "Example of PostgreSQL Database (Streaming-Only)"
conninfo = host=pg user=barman dbname=postgres
streaming_conninfo = host=pg user=streaming_barman
backup_method = postgres
streaming_archiver = on
slot_name = barman
次のコードは、 rsync
/SSHを使用した従来のバックアップの基本的な例を示しています。
[ssh-pg]
description = "Example of PostgreSQL Database (via Ssh)"
ssh_command = ssh postgres@pg
conninfo = host=pg user=barman dbname=postgres
backup_method = rsync
parallel_jobs = 1
reuse_backup = link
archiver = on
詳細については、配布されているbarman.conf
ファイル、およびssh-server.conf-template
およびstreaming-server.conf-template
テンプレートファイルを参照してください。