2

I am using Postgres 9.4 on Windows 2008 server. There are three such instances that I am using. One as master and the rest of the two are slave/standby. The version of Postgres is 9.4 in all the three instances. I have set up replication using physical slot. But the replication is not working. On querying SELECT * from pg_stat_replication; 0 rows are returned and on SELECT * from pg_replication_slots; the slot shows it is not active ('f' in the 'active' column).

I have the following configuration :

On Primary/Master:

  1. wal_level = hot_standby
  2. max_wal_senders = 2
  3. max_replication_slots = 2
  4. hot_standby = on

On Secondary/Standby:

  1. wal_level = hot_standby
  2. hot_standby = on

recovery.conf file on secondary/standby:

  1. standby_mode = on
  2. primary_conninfo = 'host=192.168.8.192 port=5432 user=postgres password=123456'
  3. primary_slot_name = 'testing'
  4. recovery_min_apply_delay = 1min

What could be missing? I have bootstrapped Standby servers with Master's data backup. Thanks.

  • When I create slot by query "SELECT * FROM pg_create_physical_replication_slot('testing');", the slot created is inactive. Why would this query create an inactive slot? – deepankardixit90 Dec 08 '15 at 09:20

1 Answers1

0

I had a similar issue on Ubuntu. For me in turned out that replication.conf was not in the right location.

According to the Postgres Wiki on Streaming Replication in the section that describes recovery.conf:

$EDITOR recovery.conf

Note that recovery.conf must be in $PGDATA directory.

It should NOT be located in the same directory as postgresql.conf

Once I moved recovery.conf to the right location and restarted Postgres, SELECT * from pg_stat_replication returned active = true.

Hope that helps.