pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ashok kumar Mani <amani@accelaero.com>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: RE: Help needed for replication issue
Date: Fri, 24 Apr 2020 03:59:42 +0000
Message-ID: <AM0P191MB0708528875CC8EC97A7A7838AED00@AM0P191MB0708.EURP191.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <CAON0DaxcWXYcQip-k-1E=MEJJofqHK9q7fcxD_7V_uCzh=gS3Q@mail.gmail.com>
References: <AM0P191MB0708A91927576F3527317C81AED30@AM0P191MB0708.EURP191.PROD.OUTLOOK.COM>
	<CAON0DaxcWXYcQip-k-1E=MEJJofqHK9q7fcxD_7V_uCzh=gS3Q@mail.gmail.com>

Classification: External

Hi Pathiria,


Step1:-  Enable the below parameters in postgresql.conf file for hotstandby

wal_level=replica         [ Default : hot_standby]

wal_log_hints = on

synchronous_commit = on

wal_log_hints = on

archive_mode = on        [

archive_timeout = 30

archive_command = 'scp %p 172.30.8.199:/data/ARCHIVELOG/%f'





step 2:- #Replication

max_wal_senders = 10

wal_keep_segments = 3200        # in logfile segments, 16MB each; 0 disables[

hot_standby = on

hot_standby_feedback = on               # send info from standby to prevent query conflicts

#Log file configurations

log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'

log_rotation_age = 0

log_rotation_size = 100MB
log_timezone = 'GMT'


Step3:- backup master database then transfer into replica server by using rsync



[postgres@de284194 ~]$ psql -c "SELECT pg_start_backup('label', true)"

pg_start_backup

-----------------

10/DA000028

(1 row)



[postgres@de284194 pg_data]$ rsync -cva --inplace --exclude=*pg_xlog* \

> ${PGDATA}/ 172.29.7.194:$PGDATA

sending incremental file list

./

pg_wal/archive_status/0000000100000010000000CC.done

pg_wal/archive_status/0000000100000010000000CD.00000028.backup.done

pg_wal/archive_status/0000000100000010000000CD.done

pg_wal/archive_status/0000000100000010000000D5.done

pg_xact/

pg_xact/0000

sent 1,053,663,924 bytes  received 21,480 bytes  15,160,941.06 bytes/sec

total size is 1,053,341,161  speedup is 1.00

[postgres@de284194 pg_data]$


Step 4:- Stop the backup

[postgres@de284194 pg_data]$ psql -c "select pg_stop_backup(), current_timestamp"

NOTICE:  pg_stop_backup complete, all required WAL segments have been archived

Step 5;- Create recovery.conf



postgres=# SELECT pg_create_physical_replication_slot('amos_prod_replica1');

pg_create_physical_replication_slot

-------------------------------------

(amos_prod_replica1,)

(1 row)



Start the db server in replica server:-

Regards,
Ashok



From: Prince Pathria <prince.pathria@goevive.com>
Sent: Thursday, April 23, 2020 1:00 PM
To: Ashok kumar Mani <amani@accelaero.com>
Cc: pgsql-admin@postgresql.org; pgsql-admin@lists.postgresql.org
Subject: Re: Help needed for replication issue


Information Security Email Alert: This email is from an EXTERNAL source. Please use caution when clicking on links or opening attachments from an unknown or suspicious sender. To report a suspected phishing email, Send us an Email on Servicedesk@accelaero.com<mailto:Servicedesk@accelaero.com>

Hey Ashok,

Please share the steps you've followed till now so we help further.

Thanks!
Happy to help :)
Prince Pathria Systems Engineer | Certified Kubernetes Administrator | AWS Solutions Architect Evive +91 9478670472 goevive.com<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgoevive.com%2F&data=02%7C01%7Ca...;


On Thu, Apr 23, 2020 at 11:44 AM Ashok kumar Mani <amani@accelaero.com<mailto:amani@accelaero.com>> wrote:

Classification: Internal

Dear All,
I have created Postgresql 10.6 hot standb ,but while creating physical replication slots by default it is in inactive more
I recreated the standby but still I am unable to make slots is in active and also I could not able to see the LSN value on both sites.


Regards,
Ashok

view thread (9+ messages)  latest in thread

Message-ID: <AM0P191MB0708528875CC8EC97A7A7838AED00@AM0P191MB0708.EURP191.PROD.OUTLOOK.COM>
Permalink:  ../AM0P191MB0708528875CC8EC97A7A7838AED00@AM0P191MB0708.EURP191.PROD.OUTLOOK.COM/
Also on:    postgresql.org/message-id/AM0P191MB0708528875CC8EC97A7A7838AED00@AM0P191MB0708.EURP191.PROD.OUTLOOK.COM

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: amani@accelaero.com
  Subject: Re: Help needed for replication issue
  In-Reply-To: <AM0P191MB0708528875CC8EC97A7A7838AED00@AM0P191MB0708.EURP191.PROD.OUTLOOK.COM>
  References: <AM0P191MB0708A91927576F3527317C81AED30@AM0P191MB0708.EURP191.PROD.OUTLOOK.COM> <CAON0DaxcWXYcQip-k-1E=MEJJofqHK9q7fcxD_7V_uCzh=gS3Q@mail.gmail.com> <AM0P191MB0708528875CC8EC97A7A7838AED00@AM0P191MB0708.EURP191.PROD.OUTLOOK.COM>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox