PG Efm
main tips stats roles efm_failover

restartare standby

Prima su standby, poi master, poi witness
systemctl status efm-dbmnp.service

/usr/efm-2.1/bin/efm cluster-status DBMNP

systemctl stop efm-dbmnp.service

pg_ctl stop -D /app/ologw/pgdata/ppas/db -m fast

per ripristinare DBMNP

sul Master
1. decommentare synchronous_standby_names = 'sync_replication'; in postgresql.conf
2. pg_ctl reload

sullo Slave
restartare db102dbm e vedere se si riallinea altrimenti -> OPI ricostruzione nodo standby

Restart EFM
restartare efm-ctl prima su witness, poi nodo 2 poi nodo 1
systemctl start efm-dbmnp.service

Verificare lo stato Master-StandBy

service

in postgresql.conf
hot_standby=on

edb=# select * from pg_stat_replication;
  pid  | usesysid |  usename   | application_name |  client_addr  | client_hostname | client_port |          backend_start          | backend_xmin |   state   | sent_location | write_location | flush_location | replay_location | sync_priority | sync_state 
-------+----------+------------+------------------+---------------+-----------------+-------------+---------------------------------+--------------+-----------+---------------+----------------+----------------+-----------------+---------------+------------
 21869 |    16650 | edbrepuser | sync_replication | 10.247.153.44 |                 |       50238 | 25-AUG-17 13:32:35.88557 +02:00 |              | streaming | F/74063978    | F/74063978     | F/74063978     | F/74063978      |             1 | sync
(1 row)

edb=# show synchronous_commit ;
 synchronous_commit 
--------------------
 on
(1 row)

edb=# show synchronous_standby_names ;
 synchronous_standby_names 
---------------------------
 sync_replication
(1 row)

N.B. lo host è la macchina primaria. Il recovery.conf è presente sullo StandBy. Verifica anche il recovery.done,
$cat recovery.conf
standby_mode = on
trigger_file = '/tmp/trigger_file' 
primary_conninfo = 'host=10.247.153.56 port=5444  user=edbrepuser  password=hpsareplica application_name=sync_replication'
recovery_target_timeline = 'latest'
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License