Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hT6Qo-0001xG-FP for pgsql-general@arkaria.postgresql.org; Tue, 21 May 2019 15:11:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hT6Qn-0006bL-2v for pgsql-general@arkaria.postgresql.org; Tue, 21 May 2019 15:11:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hT6Qm-0006bD-J6 for pgsql-general@lists.postgresql.org; Tue, 21 May 2019 15:11:56 +0000 Received: from mail-oi1-x241.google.com ([2607:f8b0:4864:20::241]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hT6Qj-0002Iv-K9 for pgsql-general@postgresql.org; Tue, 21 May 2019 15:11:55 +0000 Received: by mail-oi1-x241.google.com with SMTP id y10so13050485oia.8 for ; Tue, 21 May 2019 08:11:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:date:in-reply-to:references:mime-version; bh=v5zqatI94/aSYcQvQDdO6rI2NITRcBPiDmd3R7EiAsg=; b=CJSO8HK1J6/yJIZbByHOnuYf60cTWJCwSKT/cGF3osP8l7fEMQsK+w3/4+QESYHOrq 8Inyo0d4uES2NfojAVujTf+vc42EQV8Erdn8+HKGcFr1EHyGJ9uEDDd7GymaQNfHBKvC b7XWu9ZbLhvl/qnykzdgHJTZnum0rY++F9hRmFdd0QBvHjljaitdI7yrRho+TEPpKyRp QshJJOz0VHDRtnPgtPdWYXZmLAe/OMCG39322gVswW2cspqEkI8cgKvOQTxVV9jEy0cC VdYhPTbcssnwOplCzMtKdgr5HIdBezbNfAVxYlytOhUiCjljiPbAqnRWdac/fJRMjTuv JL1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:mime-version; bh=v5zqatI94/aSYcQvQDdO6rI2NITRcBPiDmd3R7EiAsg=; b=MHDMjQL+n1xrjNtxTLiC8O7DwznKDfgg4QXvQd/OXpeIN3RtbJYtCRh2NGHBm+rMGU 2KJSGQfy/QBZNYpC7ic+mytmanrTdRw9Gwao36sNsGmlcJ1LQthOKo7geQ+iERT2Z8OL a+cL/iD0/3yLA/bXj0T5qw29ij4HVfB/bQeiRvB1/O/tb5+7ryCk+XhM2LeNueXg10wC xNiJYo3971kAb7rWW7ZM0WTh2fn2UI/JMxm6fXuGd1cLsjwAk2VWFhjW76jQ3FBV3KhW YyHS/oAgGaaXGLWIhf4VvqsXYLENnkAub2SgkcGYPheO6KRpTSgQ2X6ym+PxwmVc0z0R GPKA== X-Gm-Message-State: APjAAAX8LcYZG0z5oK5sYBhgtghI0rxKVuOFHzx7NZ7ckiDZG5wKOe0I rvLGAJnoRMb0dJBCyvkeUgs= X-Google-Smtp-Source: APXvYqz4ZZmqrpjcStAb6ULK6crU1EtM1LTV5kQposL+egL7xwaR4xGLolkAIGrC/KYAc57jxWmawQ== X-Received: by 2002:aca:5c54:: with SMTP id q81mr3864412oib.91.1558451512912; Tue, 21 May 2019 08:11:52 -0700 (PDT) Received: from frodriguez-HP-Notebook ([189.208.128.209]) by smtp.googlemail.com with ESMTPSA id 62sm7667788oid.35.2019.05.21.08.11.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 May 2019 08:11:52 -0700 (PDT) Message-ID: <89183823a71abcfe7fb929e0cc888edf89186ba7.camel@gmail.com> Subject: Re: PITR based recovery in a primary/standby cluster setup From: Frank Alberto Rodriguez To: Abhijit Gharami , PostgreSQL mailing lists Date: Tue, 21 May 2019 15:11:49 +0000 In-Reply-To: References: Content-Type: multipart/alternative; boundary="=-+p/v3H14e0+psetmmvd+" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --=-+p/v3H14e0+psetmmvd+ Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: 7bit Hello.I'm not sure which replications issues you have, and I never used Wall-E before, but I get some issues with PotgreSql 10 and Barman. Try starting the primary server at first, when it finish to recovery this should start as primary, if not then go to the postgresql data directory and rename the recovery.conf to recovery.done and start the server as primary. Then start the standby server and when recovery target is reached, the standby server should not leave the recovery status and this should weep receiving wal through the archive_command, and should not rename the recovery.conf file. Regards On Tue, 2019-05-21 at 14:27 +0530, Abhijit Gharami wrote: > Hi, > > We have primary and standby PostgreSQL cluster setup and also we have > PITR enabled on it. To improve the recovery time we are thinking of > recovering the database to both primary and standby at the same time. > > These are the steps we are following: > 1. Restore the base backup to the both primary and standby server > 2. Replay the WAL files on both primary and standby and once the > recovery target is reached stop the servers > 3. Start one of the server as Primary and other one as standby > > > We have followed the above steps but when we are trying to start the > servers as primary and standby we are having replication issues. > > Could you please suggest what should be done here so that we can > recover the database in both primary as well as in standby server? > > We are using PostgrerSQL version: 9.6.12 and for PITR we are using > WAL-E. > > Regards, > Abhijit --=-+p/v3H14e0+psetmmvd+ Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
Hello.
I'm not sure which replications issues you h= ave, and I never used Wall-E before, but I get some issues with PotgreSql 1= 0 and Barman.

Try starting the primary server at f= irst, when it finish to recovery this should start as primary, if not then = go to the postgresql data directory and rename the recovery.conf to recover= y.done and start the server as primary.

Then star= t the standby server and when  recovery target  is reached, = the standby server should not leave the recovery status and this should wee= p receiving wal through the 
archive_command, and should not rename the recov= ery.conf file.

Regards

On= Tue, 2019-05-21 at 14:27 +0530, Abhijit Gharami wrote:
Hi,

We have primary and standby PostgreSQL cluster setup and also we have= PITR enabled on it. To improve the recovery time we are thinking of recove= ring the database to both primary and standby at the same time.
<= br>
These are the steps we are following:
  1. Res= tore the base backup to the both primary and standby server 
  2. Replay the WAL files on both primary and standby and once the re= covery target is reached stop the servers 
  3. Start o= ne of the server as Primary and other one as standby


We have followed the above steps but when we are trying t= o start the servers as primary and standby we are having replication issues= .

Could you please suggest what should be done her= e so that we can recover the database in both primary as well as in  s= tandby server?

We are using PostgrerSQL version: 9= .6.12 and for PITR we are using WAL-E.

Regards,
Abhijit
--=-+p/v3H14e0+psetmmvd+--