1

I have setup my replication as per https://www.digitalocean.com/community/tutorials/how-to-set-up-master-slave-replication-on-postgresql-on-an-ubuntu-12-04-vps.

When I start my slave and check for logs, it says

2016-03-17 04:03:02 UTC LOG:  shutting down
2016-03-17 04:03:02 UTC LOG:  database system is shut down
2016-03-17 04:03:03 UTC LOG:  database system was shut down in recovery at 2016-03-17 04:03:02 UTC
2016-03-17 04:03:03 UTC LOG:  entering standby mode
2016-03-17 04:03:03 UTC LOG:  redo starts at 2D/57000210
2016-03-17 04:03:03 UTC LOG:  consistent recovery state reached at 2D/57014BE8
2016-03-17 04:03:03 UTC LOG:  invalid record length at 2D/57014BE8
2016-03-17 04:03:03 UTC LOG:  database system is ready to accept read only connections
2016-03-17 04:03:03 UTC LOG:  started streaming WAL from primary at 2D/57000000 on timeline 1
2016-03-17 04:03:03 UTC LOG:  incomplete startup packet

My pg_hba.conf entry is as follows:

 host    replication     replication     10.50.80.12/32          trust

My recovery.conf is as follows:

standby_mode = 'on'
primary_conninfo = 'host=10.50.80.11 port=5432 user=replication password=replication'

But when I do,

SELECT * 
FROM pg_stat_replication; 

nothing is shown.

Please help if I am missing something.

Also, do I have to create the databases in slave as in master?

  • How do you see replication is not working? It clearly tells 'started streaming WAL from primary'... – dezso Mar 17 '16 at 13:15
  • @dezso I have few databases in master...after slave goes into replication, I do not see those databases in slave.....I am not sure if I am verifying correctly.....Also, select pg_is_in_recovery() ; returns me false.....Please let me know how could I verify otherwise? – Ashok Mar 17 '16 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.