start repmgrd
This commit is contained in:
@@ -8,5 +8,6 @@ RUN apt-get update && \
|
||||
|
||||
COPY --chmod=666 repmgr.conf /etc/repmgr.conf
|
||||
COPY --chmod=644 --chown=postgres profile /var/lib/postgresql/.profile
|
||||
COPY --chmod=755 postgres.sh /usr/local/bin/postgres
|
||||
COPY docker-entrypoint-initdb.d/* /docker-entrypoint-initdb.d/
|
||||
|
||||
|
||||
@@ -69,6 +69,7 @@ case "$REPMGR_NODE_ROLE" in
|
||||
echo "hot_standby = on" >> /var/lib/postgresql/data/postgresql.conf
|
||||
echo "max_wal_senders = 10" >> /var/lib/postgresql/data/postgresql.conf
|
||||
echo "max_replication_slots = 10" >> /var/lib/postgresql/data/postgresql.conf
|
||||
echo "shared_preload_libraries = 'repmgr'" >> /var/lib/postgresql/data/postgresql.conf
|
||||
if [[ -n $POSTGRES_MAX_CONNECTIONS ]]; then
|
||||
echo "max_connections = ${POSTGRES_MAX_CONNECTIONS}" >> /var/lib/postgresql/data/postgresql.conf
|
||||
fi
|
||||
|
||||
7
postgres.sh
Normal file
7
postgres.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
repmgrd -f /etc/repmgr.conf --pid-file /tmp/repmgrd.pid &
|
||||
|
||||
export PATH="/usr/lib/postgresql/15/bin:${PATH}"
|
||||
|
||||
exec "$@"
|
||||
@@ -1,3 +1,8 @@
|
||||
data_directory = '/var/lib/postgresql/data'
|
||||
use_replication_slots = on
|
||||
pg_bindir = '/usr/lib/postgresql/15/bin/'
|
||||
failover = automatic
|
||||
promote_command = '/usr/bin/repmgr standby promote -f /etc/repmgr.conf --log-to-file'
|
||||
follow_command = '/usr/bin/repmgr standby follow -f /etc/repmgr.conf --log-to-file --upstream-node-id=%n'
|
||||
primary_visibility_consensus = on
|
||||
|
||||
|
||||
Reference in New Issue
Block a user