From b3033cee078c69e95106152e3ef24dcfeac06f6b Mon Sep 17 00:00:00 2001 From: Bernhard Radermacher Date: Mon, 23 Feb 2026 15:48:21 +0100 Subject: [PATCH] wip --- Dockerfile | 4 ++-- pgpool.conf | 23 +++++++++++++++++++++++ pool_hba.conf | 3 +++ pool_passwd | 1 + 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 pgpool.conf create mode 100644 pool_hba.conf create mode 100644 pool_passwd diff --git a/Dockerfile b/Dockerfile index 5e8ecbe..c3b4518 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,8 +23,8 @@ RUN apt-get update && \ chown postgres: /var/lib/postgresql/.ssh && \ chmod g-w,o-w /var/lib/postgresql -COPY --chmod=600 --chown=postgres authorized_keys id_ed25519 /var/lib/postgresql/.ssh/ - +COPY --chmod=600 --chown=postgres:postgres authorized_keys id_ed25519 /var/lib/postgresql/.ssh/ +COPY --chmod=600 --chown=postgres:postgres pgpool.conf pool_hba.conf pool_passwd /etc/pgpool2/ COPY --chmod=755 entrypoint.sh /usr/local/bin/ ENTRYPOINT ["entrypoint.sh"] diff --git a/pgpool.conf b/pgpool.conf new file mode 100644 index 0000000..e6a206c --- /dev/null +++ b/pgpool.conf @@ -0,0 +1,23 @@ +backend_clustering_mode = 'streaming_replication' +listen_addresses = '*' +port = 5432 +backend_hostname0 = 'postgres1' +backend_port0 = 5432 +backend_weight0 = 1 +backend_data_directory0 = '/var/lib/postgresql/data' +backend_flag0 = 'ALLOW_TO_FAILOVER' +backend_hostname1 = 'postgres2' +backend_port1 = 5432 +backend_weight1 = 1 +backend_data_directory1 = '/var/lib/postgresql/data' +backend_flag1 = 'ALLOW_TO_FAILOVER' +enable_pool_hba = on +logdir = '/var/log/pgool' +sr_check_user = 'pgpool' +sr_check_password = 'secret' +health_check_period = 10 +health_check_user = 'pgpool' +health_check_password = 'secret' +recovery_user = 'pgpool' +recovery_password = 'secret' +recovery_1st_stage_command = 'basebackup.sh' \ No newline at end of file diff --git a/pool_hba.conf b/pool_hba.conf new file mode 100644 index 0000000..48d1fa2 --- /dev/null +++ b/pool_hba.conf @@ -0,0 +1,3 @@ +local all all trust +host all all 127.0.0.1/32 trust +host all all all scram-sha-256 diff --git a/pool_passwd b/pool_passwd new file mode 100644 index 0000000..6fddd99 --- /dev/null +++ b/pool_passwd @@ -0,0 +1 @@ +pgpool:TEXTsecret