データノードをセットアップします。
実行ユーザーや環境変数などの設定や手順は、基本的に中央管理ノードと同じく、データベース多重化運用を行うことを想定しています。そのため、プライマリサーバとスタンバイサーバをそれぞれセットアップし、裁定サーバから監視するようにセットアップする必要があります。
作成手順、起動方法は“3.7 データノードのセットアップ”を参照してください。
下記はデータノード用のpostgrsql.confの設定例です。ポート番号やcluster_nameは実行環境に合わせて変更してください。なお、max_replication_slots以降の設定は、レプリケーションテーブルを利用するための設定です。レプリケーションテーブルを利用する際には、必ず見積もって設定してください。
# # Common settings for primary and standby # port=27501 shared_preload_libraries='postgres_scaleout_fdw, watchdog' wal_level = 'logical' listen_addresses = '*' # remote # for log file log_connections = on logging_collector = on log_directory = 'log' log_filename ='postgresql-%Y-%m-%d.log' # for scale out cluster_name = 'datanode1' postgres_scaleout_fdw.application_name = '%p_for_%a' max_prepared_transactions = 100 wal_arbiter = off # for watchdog watchdog.port=28501 # Replication # synchronous_standby_names = 'standby' # synchronous_commit = on # max 10 replication table max_replication_slots = 12# default(10) + 2
max_logical_replication_workers = 42# default(10) + 12 + (2 + 10 tables)
max_worker_processes = 51# default(8) + (42 + 1)
max_connections = 151# 100 + 51
スタンバイサーバは、中央管理ノードと同様に、従来のストリーミングレプリケーションの構築と同じ手順で作成してください。詳細は、“クラスタ運用ガイド(データベース多重化編)”の“スタンバイサーバのセットアップ”を参照してください。