pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_rewind
5+ messages / 2 participants
[nested] [flat]

* pg_rewind
@ 2020-01-23 15:39 soumik.bhattacharjee@kpn.com
  2020-01-23 15:56 ` Re: pg_rewind Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 5+ messages in thread

From: soumik.bhattacharjee@kpn.com @ 2020-01-23 15:39 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org; pgsql-admin

Hi Experts,

Initial setup was done using streaming replication and then promoted the STANDBY to MASTER.

I am trying to make my previous Master as Master by roll backing the changes happen into Standby


In Original MASTER I am running below -

/usr/lib/postgresql/12/bin$ ./pg_rewind -D $PGDATA --source-server='host=<IP Address> port=5432' -P
pg_rewind: fatal: could not connect to server: fe_sendauth: no password supplied

I'm not sure why this keeps happening.


Thanks..

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pg_rewind
  2020-01-23 15:39 pg_rewind soumik.bhattacharjee@kpn.com
@ 2020-01-23 15:56 ` Laurenz Albe <laurenz.albe@cybertec.at>
  2020-01-23 16:11   ` RE: pg_rewind soumik.bhattacharjee@kpn.com
  2020-01-27 16:01   ` RE: pg_rewind soumik.bhattacharjee@kpn.com
  0 siblings, 2 replies; 5+ messages in thread

From: Laurenz Albe @ 2020-01-23 15:56 UTC (permalink / raw)
  To: soumik.bhattacharjee@kpn.com; pgsql-admin@lists.postgresql.org; pgsql-admin

On Thu, 2020-01-23 at 15:39 +0000, soumik.bhattacharjee@kpn.com wrote:
> I am trying to make my previous Master as Master by roll backing the changes happen into Standby
> 
> In Original MASTER I am running below –
> 
> /usr/lib/postgresql/12/bin$ ./pg_rewind -D $PGDATA --source-server='host=<IP Address> port=5432' -P
> pg_rewind: fatal: could not connect to server: fe_sendauth: no password supplied
> 
> I'm not sure why this keeps happening.

Because you used the wrong user or didn't specify a password?

Try

   --source-server='host=<IP Address> port=5432 user=... password=...'

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* RE: pg_rewind
  2020-01-23 15:39 pg_rewind soumik.bhattacharjee@kpn.com
  2020-01-23 15:56 ` Re: pg_rewind Laurenz Albe <laurenz.albe@cybertec.at>
@ 2020-01-23 16:11   ` soumik.bhattacharjee@kpn.com
  1 sibling, 0 replies; 5+ messages in thread

From: soumik.bhattacharjee@kpn.com @ 2020-01-23 16:11 UTC (permalink / raw)
  To: laurenz.albe@cybertec.at; pgsql-admin@lists.postgresql.org; pgsql-admin

Thanks for your suggestion, I need now to make "wal_log_hints = on"

-----Original Message-----
From: Laurenz Albe <laurenz.albe@cybertec.at> 
Sent: donderdag 23 januari 2020 16:56
To: Bhattacharjee, Soumik <soumik.bhattacharjee@kpn.com>; pgsql-admin@lists.postgresql.org; pgsql-admin@postgresql.org
Subject: Re: pg_rewind

On Thu, 2020-01-23 at 15:39 +0000, soumik.bhattacharjee@kpn.com wrote:
> I am trying to make my previous Master as Master by roll backing the changes happen into Standby
> 
> In Original MASTER I am running below –
> 
> /usr/lib/postgresql/12/bin$ ./pg_rewind -D $PGDATA --source-server='host=<IP Address> port=5432' -P
> pg_rewind: fatal: could not connect to server: fe_sendauth: no password supplied
> 
> I'm not sure why this keeps happening.

Because you used the wrong user or didn't specify a password?

Try

   --source-server='host=<IP Address> port=5432 user=... password=...'



Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* RE: pg_rewind
  2020-01-23 15:39 pg_rewind soumik.bhattacharjee@kpn.com
  2020-01-23 15:56 ` Re: pg_rewind Laurenz Albe <laurenz.albe@cybertec.at>
@ 2020-01-27 16:01   ` soumik.bhattacharjee@kpn.com
  2020-01-28 08:48     ` Re: pg_rewind Laurenz Albe <laurenz.albe@cybertec.at>
  1 sibling, 1 reply; 5+ messages in thread

From: soumik.bhattacharjee@kpn.com @ 2020-01-27 16:01 UTC (permalink / raw)
  To: laurenz.albe@cybertec.at; +Cc: pgsql-admin@lists.postgresql.org; pgsql-admin



-----Original Message-----
From: Laurenz Albe <laurenz.albe@cybertec.at> 
Sent: donderdag 23 januari 2020 16:56
To: Bhattacharjee, Soumik <soumik.bhattacharjee@kpn.com>; pgsql-admin@lists.postgresql.org; pgsql-admin@postgresql.org
Subject: Re: pg_rewind


> 
> In Original MASTER I am running below –
> 
> /usr/lib/postgresql/12/bin$ ./pg_rewind -D $PGDATA --source-server='host=<IP Address> port=5432' -P
> pg_rewind: fatal: could not connect to server: fe_sendauth: no password supplied
> 
> I'm not sure why this keeps happening.

Because you used the wrong user or didn't specify a password?

Try

   --source-server='host=<IP Address> port=5432 user=... password=...'


-- 
Thanks for your suggestion, I made the "wal_log_hints = on".

I set the "wal_log_hints = on" , but enabling this parameter "on" in new MASTER(old SLAVE) needs a restart-- which I cannot do as all application transactions are going on there now.

Also I used pg_rewind in old MASTER(which now I want to make as new SLAVE) and it was successful, but this also needs restart of new MASTER(old SLAVE) which is again an issue.

Command used: ./pg_rewind -D $PGDATA --source-server='host=<IP Address> port=5432 user=postgres password=xxxx

Could you please suggest how to get this to work to keep the MASTER(old SLAVE) up & running and make the old MASTER(new SLAVE)




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pg_rewind
  2020-01-23 15:39 pg_rewind soumik.bhattacharjee@kpn.com
  2020-01-23 15:56 ` Re: pg_rewind Laurenz Albe <laurenz.albe@cybertec.at>
  2020-01-27 16:01   ` RE: pg_rewind soumik.bhattacharjee@kpn.com
@ 2020-01-28 08:48     ` Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 0 replies; 5+ messages in thread

From: Laurenz Albe @ 2020-01-28 08:48 UTC (permalink / raw)
  To: soumik.bhattacharjee@kpn.com; +Cc: pgsql-admin@lists.postgresql.org; pgsql-admin

On Mon, 2020-01-27 at 16:01 +0000, soumik.bhattacharjee@kpn.com wrote:
> I set the "wal_log_hints = on" , but enabling this parameter "on" in new MASTER(old SLAVE) needs a restart--
> which I cannot do as all application transactions are going on there now.
> 
> Also I used pg_rewind in old MASTER(which now I want to make as new SLAVE) and it was successful,
> but this also needs restart of new MASTER(old SLAVE) which is again an issue.
> 
> Command used: ./pg_rewind -D $PGDATA --source-server='host=<IP Address> port=5432 user=postgres password=xxxx
> 
> Could you please suggest how to get this to work to keep the MASTER(old SLAVE) up & running and make the old MASTER(new SLAVE)

If you want to use "pg_rewind", you have to plan for that ahead of time
by either using data page checksums or enabling "wal_log_hints".

The first requires longer don time, the second a restart.
There is no way to do that retroactively.

Just use "pg_basebackup" to create a new standby, and enable
"wal_log_hints" next time you get a chance to restart.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2020-01-28 08:48 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-01-23 15:39 pg_rewind soumik.bhattacharjee@kpn.com
2020-01-23 15:56 ` Laurenz Albe <laurenz.albe@cybertec.at>
2020-01-23 16:11   ` soumik.bhattacharjee@kpn.com
2020-01-27 16:01   ` soumik.bhattacharjee@kpn.com
2020-01-28 08:48     ` Laurenz Albe <laurenz.albe@cybertec.at>

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