How to use repmgr with PostgreSQL 10?
-
08-03-2021 - |
Question
Followed the official repmgr document, I set these items to the configuration file:
shared_preload_libraries = 'repmgr'
max_wal_senders = 10
max_replication_slots = 10
wal_level = 'hot_standby'
hot_standby = on
archive_mode = on
However, in the /var/lib/pgsql/10/data/postgresql.conf
file, something default as
#wal_level = replica # minimal, replica, or logical
# (change requires restart)
Doesn't have hot_standby
option.
If I use the config as repmgr document, when I want to create a database or user, alwasy hanging.
createuser -s myuser
createdb -E UNICODE -l en_US.UTF-8 -T template0 mydb -O myuser
But use the default postgresql configuration will work well.
So how to use repmgr
with PostgreSQL 10 correctly?
La solution
The repmgr doc you linked to says to use wal_level = 'hot_standby'
with PG versions 9.5 or older, and wal_level = 'replica'
for PG versions 9.6 or newer.
# Ensure WAL files contain enough information to enable read-only queries # on the standby. # # PostgreSQL 9.5 and earlier: one of 'hot_standby' or 'logical' # PostgreSQL 9.6 and later: one of 'replica' or 'logical' # ('hot_standby' will still be accepted as an alias for 'replica') # # See: https://www.postgresql.org/docs/current/static/runtime-config-wal.html#GUC-WAL-LEVEL
You're using PostgreSQL 10, so replica
or logical
should be used for this option.
Licencié sous: CC-BY-SA avec attribution
Non affilié à dba.stackexchange