Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jRpVQ-0003I6-QY for pgsql-admin@arkaria.postgresql.org; Fri, 24 Apr 2020 04:00:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jRpVN-0001g9-7s for pgsql-admin@arkaria.postgresql.org; Fri, 24 Apr 2020 03:59:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jRpVM-0001fs-Hh for pgsql-admin@lists.postgresql.org; Fri, 24 Apr 2020 03:59:57 +0000 Received: from mail-eopbgr140132.outbound.protection.outlook.com ([40.107.14.132] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jRpVD-000211-E2 for pgsql-admin@postgresql.org; Fri, 24 Apr 2020 03:59:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PWnRGGUUjQlTfWhVHuvRC6YbqC0XmIDV58Bp2L2JtvwxPlmEk7Uo98VFzUcwey8xkt+0/zyHS1kjv9gAhoQjqEm0eUEuSmRFTR9u3guQAol86xsS0kpqMyn6F1B0KGj8mohTQ6AusJAkQI623XSMFUmFYdCdmMpLeWTr6pUhOVvgFrFQv0elSN9hJZBK46McmISeGRR4O4gf9sn7Jw2UPbd9NOtxfMPEjoiN1svABBwo6osOxHPVDrmcvK46PI5HanTWBILHKZ8ymBMK7F3InJWq3SNPhq6PntdLazsFCDPFeM9rpqhwVgHLNCkmePVdj1cOnTDJSzmQFh6R/ch33g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q3NLxXgpXi76jZu5ID/B/CcAjp8HGhLJCDUNelGDLNo=; b=ddvri0a/XnxQHdMYVA6NNLTkx4RZ06D/1bA9klnvwU3rIX/a/UYbmskVYah68g8F56KwxnX74A1MOHKqksBxW2dHtHagu8WeTxBuFrQvJ2LJZSMdb2/8QsD+CBki0PfzDuZg+lRwYBvw6FXCyqrLyNuBvH/BaOIvBFkvqrBU33Vc8Hb4jT40gM7toxbzgY/vFrvNTpis4VxTAIR7FaV1k3tYq1KQQuuFawjZq4DKO8pO4MVH7WGMRUGUNJA45KoOpkiV3z1cTe2lHGERNOuD04KY5TjqNeIrHsEjIVllAgxEiccjBaWa9BlFhaw5Q+RI3sd7ykzz+7efbtM3VWXUaw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=accelaero.com; dmarc=pass action=none header.from=accelaero.com; dkim=pass header.d=accelaero.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=accelaero.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q3NLxXgpXi76jZu5ID/B/CcAjp8HGhLJCDUNelGDLNo=; b=C1j3rPs8HyVc3jB57Lep4cqOx6zLM7xMERRvZ3XRt/YoaOJeI4/ir3bHio2HUwM2fj5lVsw/RVhbhJrVn9fdP2NiGxud0PduQ3ZilHhcW4xQKmWELZx9EBf6bp1V4TwtD9jmfG5zZnYfNOu04bFgmx9weH4Ot3XsoIeQzwBmnu4= Received: from AM0P191MB0708.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:153::8) by AM0P191MB0529.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:15f::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Fri, 24 Apr 2020 03:59:43 +0000 Received: from AM0P191MB0708.EURP191.PROD.OUTLOOK.COM ([fe80::543:76b5:fb40:eda9]) by AM0P191MB0708.EURP191.PROD.OUTLOOK.COM ([fe80::543:76b5:fb40:eda9%2]) with mapi id 15.20.2937.020; Fri, 24 Apr 2020 03:59:43 +0000 From: Ashok kumar Mani To: "pgsql-admin@postgresql.org" , "pgsql-admin@lists.postgresql.org" Subject: RE: Help needed for replication issue Thread-Topic: Help needed for replication issue Thread-Index: AdYZMmWwUBnVUTR6QkCgUVG5dRzvNQAGy22AABQdeQA= Date: Fri, 24 Apr 2020 03:59:42 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_916ea167-67b1-4080-9c86-674eefeb4f23_Enabled=True; MSIP_Label_916ea167-67b1-4080-9c86-674eefeb4f23_SiteId=7bbb8a4d-7f1b-4a58-9b3a-c250fb8023e3; MSIP_Label_916ea167-67b1-4080-9c86-674eefeb4f23_Owner=amani@accelaero.com; MSIP_Label_916ea167-67b1-4080-9c86-674eefeb4f23_SetDate=2020-04-23T18:47:18.3846999Z; MSIP_Label_916ea167-67b1-4080-9c86-674eefeb4f23_Name=External - General; MSIP_Label_916ea167-67b1-4080-9c86-674eefeb4f23_Application=Microsoft Azure Information Protection; MSIP_Label_916ea167-67b1-4080-9c86-674eefeb4f23_ActionId=bed214fd-ee6b-415b-af43-2a5beb131381; MSIP_Label_916ea167-67b1-4080-9c86-674eefeb4f23_Extended_MSFT_Method=Manual authentication-results: spf=none (sender IP is ) smtp.mailfrom=amani@accelaero.com; x-originating-ip: [2001:8f8:1423:81a:bc39:a333:e6ff:6990] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 677ce7cd-1d91-4372-cfef-08d7e803eb93 x-ms-traffictypediagnostic: AM0P191MB0529: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:972; x-forefront-prvs: 03838E948C x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0P191MB0708.EURP191.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(136003)(39850400004)(396003)(346002)(376002)(366004)(478600001)(33656002)(52536014)(8676002)(6506007)(7696005)(53546011)(8936002)(81156014)(186003)(316002)(66946007)(66476007)(64756008)(66446008)(9686003)(71200400001)(2906002)(66556008)(55016002)(76116006)(86362001)(5660300002)(110136005);DIR:OUT;SFP:1102; received-spf: None (protection.outlook.com: accelaero.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: csqPgK/0xeTWIifX3tpUyicAvJLfVBWzsCAisuyHcVXNsLN4H9AVlRJ04w8focDJLf6vlqap3jT4gkrAYnuntAkerQb6gSYlWQkfG2E0XeDytsBLUMzL8zPicpOsOmylE5tFPENJrxUIyXXNY0DsLRBoE/DKh4VlO9l9Va6p3h9yKUKGoHxSR8ZmtPWHBgChMGKQn7AWisdXNA/kXS6UkBAuZ/Eu39pAuFkkEIoJ9Mf03GU7d48p/CVtLl9IWAlhJFU+OIEkC/Lh2czRoE9HFUqLfnB2ExwHFSYvSSuWAn0YGR5B/SSvBqoHf4gRpoS0FtXfntkYUwEqCSGRzeyaUPGCk9frTta/5YKVyT/XVrKd3fJO02TP72EJGiJ3Oc6RdmT+tWCS66TjbALgTyo5kv9d7OWMANsLBh1/YLyYL2TTwQCMqwiWCGwH6Vx04EhggWKTZpqmzJJ1bJ8FBMcmHDEzbYbU8nfhOXZlFPjgOAnmVkMuCjosnyHdQtmFe+eMwf7yGGLwNpLLJSNyCJJwcw== x-ms-exchange-antispam-messagedata: +ia9inou4+3UP5tzApfToIXaaODtxVwF2I+dbmzpIs/U0OVhZdRDr3L+d2HmAMoJE0ngo1OAGCcJJupK849LG4kGX5f/wWZh7q+fJrrpplZYk4ZbztKm1PrGNkHcoXYr6+0Rde6Z8r7HiaGQc4zGCUPp7a1F5SaK4M94DFNGR3B3Vj6MSVTgZj30xpXSJoSkZF0MUEPHiQbWYe9rdIu1zw== x-ms-exchange-transport-forked: True Content-Type: multipart/alternative; boundary="_000_AM0P191MB0708528875CC8EC97A7A7838AED00AM0P191MB0708EURP_" MIME-Version: 1.0 X-OriginatorOrg: accelaero.com X-MS-Exchange-CrossTenant-Network-Message-Id: 677ce7cd-1d91-4372-cfef-08d7e803eb93 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Apr 2020 03:59:42.9798 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 7bbb8a4d-7f1b-4a58-9b3a-c250fb8023e3 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: NaIlqoEoM7PzH+gRiR51Tn7AVkFIso47bT7bUMAC8fchuNPCiXOF13zKZxJBxBhC+/5htgyPGqoKNnzp70xQ5g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0P191MB0529 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --_000_AM0P191MB0708528875CC8EC97A7A7838AED00AM0P191MB0708EURP_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Classification: External Hi Pathiria, Step1:- Enable the below parameters in postgresql.conf file for hotstandby wal_level=3Dreplica [ Default : hot_standby] wal_log_hints =3D on synchronous_commit =3D on wal_log_hints =3D on archive_mode =3D on [ archive_timeout =3D 30 archive_command =3D 'scp %p 172.30.8.199:/data/ARCHIVELOG/%f' step 2:- #Replication max_wal_senders =3D 10 wal_keep_segments =3D 3200 # in logfile segments, 16MB each; 0 disab= les[ hot_standby =3D on hot_standby_feedback =3D on # send info from standby to preve= nt query conflicts #Log file configurations log_filename =3D 'postgresql-%Y-%m-%d_%H%M%S.log' log_rotation_age =3D 0 log_rotation_size =3D 100MB log_timezone =3D 'GMT' Step3:- backup master database then transfer into replica server by using r= sync [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=3D*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_time= stamp" NOTICE: pg_stop_backup complete, all required WAL segments have been archi= ved Step 5;- Create recovery.conf postgres=3D# 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 Sent: Thursday, April 23, 2020 1:00 PM To: Ashok kumar Mani 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. Pl= ease use caution when clicking on links or opening attachments from an unkn= own or suspicious sender. To report a suspected phishing email, Send us an = Email on 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 On Thu, Apr 23, 2020 at 11:44 AM Ashok kumar Mani > wrote: Classification: Internal Dear All, I have created Postgresql 10.6 hot standb ,but while creating physical repl= ication slots by default it is in inactive more I recreated the standby but still I am unable to make slots is in active an= d also I could not able to see the LSN value on both sites. Regards, Ashok --_000_AM0P191MB0708528875CC8EC97A7A7838AED00AM0P191MB0708EURP_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

= Classification: External

 

Hi Pathiria,

 

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

wal_level=3Dreplica     =     [ Default : hot_standby]

wal_log_hints =3D on

synchronous_commit =3D on    =              &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;   

wal_log_hints =3D on     = ;             &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp; 

archive_mode =3D on     =    [           =             &nb= sp;            =             &nb= sp;            =             &nb= sp;            =             &nb= sp;            =             &nb= sp;  

archive_timeout =3D 30    &nb= sp;             = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;

archive_command =3D 'scp %p 172.30.8.199:/data/AR= CHIVELOG/%f'

        &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;  

 

step 2:- #Replication

max_wal_senders =3D 10    &nb= sp;      

wal_keep_segments =3D 3200    &nbs= p;   # in logfile segments, 16MB each; 0 disables[

hot_standby =3D on

hot_standby_feedback =3D on   &nbs= p;           # send info = from standby to prevent query conflicts

#Log file configurations

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

log_rotation_age =3D 0

log_rotation_size =3D 100MB

log_t= imezone =3D 'GMT'         &nbs= p; 

=  

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@de28419= 4 pg_data]$ rsync -cva --inplace --exclude=3D*pg_xlog* \<= /p>

> ${PGDATA}/ 1= 72.29.7.194:$PGDATA

sending increment= al file list

./

pg_wal/archive_st= atus/0000000100000010000000CC.done

pg_wal/archive_st= atus/0000000100000010000000CD.00000028.backup.done

pg_wal/archive_st= atus/0000000100000010000000CD.done

pg_wal/archive_st= atus/0000000100000010000000D5.done

pg_xact/

pg_xact/0000=

sent 1,053,663,92= 4 bytes  received 21,480 bytes  15,160,941.06 bytes/sec

total size is 1,0= 53,341,161  speedup is 1.00

[postgres@de28419= 4 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=3D# SELECT pg_create_physical_replication_slot('amos_prod_replic= a1');

pg_create_physical_replication_slot

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

(amos_prod_replica1,)

(1 row)

 

 

 

S= tart the db server in replica server:-

<= o:p> 

R= egards,

A= shok

<= o:p> 

<= o:p> 

 

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 lin= ks or opening attachments from an unknown or suspicious sender. To report a= suspected phishing email, Send us an Email on Servicedesk@accelaero.com<= /span>

 

Hey Ashok,


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

 

Thanks!

Happy to help :)

Prince Pathria Systems Engineer | Certif= ied Kubernetes Administrator | AWS Solutions Architect Evive +91 947867= 0472 goevive.com

 

 

On Thu, Apr 23, 2020 at 11:44 AM Ashok kumar Mani &l= t;amani@accelaero.com> wrote:=

Classification= : Internal

 

Dear All,

I have creat= ed Postgresql 10.6 hot standb ,but while creating physical replication slot= s 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 cou= ld not able to see the LSN value on both sites.

 

 

Regards,

Ashok=

 

 

 

--_000_AM0P191MB0708528875CC8EC97A7A7838AED00AM0P191MB0708EURP_--