RE: Streaming Replication

From: Scot Kreienkamp <Scot(dot)Kreienkamp(at)la-z-boy(dot)com>
To: Daulat Ram <Daulat(dot)Ram(at)exponential(dot)com>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: RE: Streaming Replication
Date: 2019-04-22 15:30:01
Message-ID: BN8PR15MB32834D278BCA9BB748C815FC9A220@BN8PR15MB3283.namprd15.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Double check all the info is correct on the primary_conninfo line:

primary_conninfo = 'host=primary host port=5432 user=replication password=replication'

And check your logs. It probably says something like cannot connect to host primary.

From: Daulat Ram [mailto:Daulat(dot)Ram(at)exponential(dot)com]
Sent: Monday, April 22, 2019 5:54 AM
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Streaming Replication

ATTENTION: This email was sent to La-Z-Boy from an external source. Be vigilant when opening attachments or clicking links.
Hello Team,

I am setting a streaming replication by using two different host there is no output of select * from pg_stat_replication; I have set the parameters on both side.

Host names are :

(10.29.15.244)
(10.29.15.25)

postgres=# select * from pg_stat_replication;
pid | usesysid | usename | application_name | client_addr | client_hostname | client_port | backend_start | backend_xmin | state | sent_lsn | write_lsn | flush_lsn | replay_lsn | write_lag | flush_lag | replay_lag | sync_priority | sync_state
-----+----------+---------+------------------+-------------+-----------------+-------------+---------------+--------------+-------+----------+-----------+-----------+------------+-----------+-----------+------------+---------------+------------
(0 rows)

bash-4.4$ ps aux | grep 'postgres.*rec'
121 postgres 0:00 grep postgres.*rec
bash-4.4$

Parameters on primary are:
-----------------------------
wal_level = hot_standby
max_wal_senders = 50
wal_keep_segments = 16
max_replication_slots = 16
vacuum_defer_cleanup_age = 4

Parameters on Standby are:
----------------------------------
max_standby_archive_delay = 30s
max_standby_streaming_delay = 30s
archive_mode = on
archive_timeout = 1800
hot_standby = on

Recovery.conf @ standby:

standby_mode = on
primary_conninfo = 'host=primary host port=5432 user=replication password=replication'
trigger_file = '/tmp/touch_me_to_promote_to_me_master'

Hba.conf @primary

host all all 0.0.0.0/0 md5
host replication replication samenet md5
host replication postgres,kbcn,replication 10.29.0.0/16 md5
host all kbcn,nagios,postgres samenet md5
host all postgres 0.0.0.0/0 md5
host all kbcn,nagios,postgres 10.29.0.0/16 md5
hostnossl replication replication,postgres 172.17.0.0/16 md5
hostnossl replication replication,postgres 10.29.0.0/16 md5
hostnossl replication replication,postgres 10.29.15.25/32 md5

hba.conf @standby

host all all 0.0.0.0/0 md5
host replication replication samenet md5
host replication postgres,kbcn,replication 10.29.0.0/16 md5
host all kbcn,nagios,postgres samenet md5
host all postgres 0.0.0.0/0 md5
host all kbcn,nagios,postgres 10.29.0.0/16 md5
hostnossl replication replication,postgres 172.17.0.0/16 md5
hostnossl replication replication,postgres 10.29.0.0/16 md5

Please suggest what I have missed.

Regards,
Daulat

Scot Kreienkamp |Senior Systems Engineer | La-Z-Boy Corporate
One La-Z-Boy Drive| Monroe, Michigan 48162 | Office: 734-384-6403 | Fax: | Mobile: 7349151444 | Email: Scot(dot)Kreienkamp(at)la-z-boy(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ray O'Donnell 2019-04-22 15:30:58 Resetting identity columns
Previous Message Souvik Bhattacherjee 2019-04-22 15:27:18 Is it possible to store the output of EXPLAIN into a table