Automati c аварийного переключения не происходит в repmgr - PullRequest
0 голосов
/ 02 мая 2020

У меня есть postgres активный / резервный кластер из 2 узлов, я использовал repmgr для создания кластера. Проблема в том, что автоматическое аварийное переключение c не происходит, когда я останавливаю службы postgres на главном узле. Содержимое файла repmgr.conf на ведущем устройстве выглядит следующим образом:

node_id=1
data_directory='/data/pgdatabase/masterdb/data'
node_name=node1
conninfo='host=IP-Of-Master user=repmgr dbname=repmgr'
failover=automatic
promote_command='repmgr standby promote -f /etc/repmgr/11/repmgr.conf --log-to-file'
follow_command='repmgr standby follow -f /etc/repmgr/11/repmgr.conf --log-to-file  --upstream-node-id=%n'
log_file='/var/log/repmgr/repmgr.log'
log_level=NOTICE
reconnect_attempts=4
reconnect_interval=5
repmgrd_service_start_command='sudo systemctl repmgr11 start'
repmgrd_service_stop_command='sudo systemctl repmgr11 stop'

Содержимое postgresql .conf выглядит следующим образом:

listen_addresses = '*'
shared_preload_libraries = 'repmgr'
max_wal_senders = 15
max_replication_slots = 15
wal_level = 'replica'
hot_standby = on
archive_mode = on
archive_command = 'cp %p /var/lib/pgsql/11/archive/%f'

Содержимое одинаково на ожидаемом ведущем и ведомом устройствах. имя, которое является узлом 2 на ведомом устройстве. Может кто-нибудь направить меня, что может быть возможной причиной автоматизации c отказоустойчивости не происходит

1 Ответ

0 голосов
/ 03 мая 2020

Я решил это сам, мне нужно было создать файл / etc / default / repmgrd и добавить в него следующие строки

REPMGRD_ENABLED=yes
REPMGRD_CONF="/etc/repmgr.conf"
...