pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
WAL segment NOT FOUND - Postgres 9.2
6+ messages / 4 participants
[nested] [flat]

* WAL segment NOT FOUND - Postgres 9.2
@ 2016-06-02 01:49  Patrick Baker <patrickbakerbr@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Patrick Baker @ 2016-06-02 01:49 UTC (permalink / raw)
  To: pgsql-admin

Hi guys,


I got one master and two slaves.

   - slave01 = replication from master - working fine
   - slave02 = server is configured to delay for 345600 seconds (4 days).

The issue is on the slave02 server

*Recovery.conf:*

restore_command = 'exec nice -n 19 ionice -c 2 -n 7 ../../bin/segment.sh
"../wal_archive/%f" "%p" 345600'

At about 10 days ago, I had an issue with my MASTER, and the server had to
be restarted.

*PROBLEM:*

The replication on the slave02 server is not working. When looking the
logs, I see:

WAL segment `../wal_archive/00000002000011E800000012` not found

I tried to copy manually that file, from my backups, then I get another
error:

Archived WAL segment `../wal_archive/00000002000011E800000012` is
newer than the configured delay (345600 seconds)

So it seems the database hasn't been replicated since MAY 17:

*on slave02 server:*

ls -la /var/lib/pgsql/9.2/wal_archive:

postgres postgres 16777216 May 17 18:16 00000002000011E80000000F
postgres postgres 16777216 May 17 18:18 00000002000011E800000010
postgres postgres 16777216 May 17 18:18 00000002000011E800000011




- Is there anything I can do to solve the problem? Without having to syn
all the DATABASE again?

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

* Re: WAL segment NOT FOUND - Postgres 9.2
@ 2016-06-02 02:35  Ian Barwick <ian@2ndquadrant.com>
  parent: Patrick Baker <patrickbakerbr@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Ian Barwick @ 2016-06-02 02:35 UTC (permalink / raw)
  To: Patrick Baker <patrickbakerbr@gmail.com>; pgsql-admin

On 06/02/2016 10:49 AM, Patrick Baker wrote:
> Hi guys,
> 
> 
> I got one master and two slaves.
> 
>    - slave01 = replication from master - working fine
>    - slave02 = server is configured to delay for 345600 seconds (4 days).
> 
> The issue is on the slave02 server
> 
> *Recovery.conf:*
> 
> restore_command = 'exec nice -n 19 ionice -c 2 -n 7 ../../bin/segment.sh
> "../wal_archive/%f" "%p" 345600'
> 
> At about 10 days ago, I had an issue with my MASTER, and the server had to
> be restarted.
> 
> *PROBLEM:*
> 
> The replication on the slave02 server is not working. When looking the
> logs, I see:
> 
> WAL segment `../wal_archive/00000002000011E800000012` not found
> 
> I tried to copy manually that file, from my backups, then I get another
> error:
> 
> Archived WAL segment `../wal_archive/00000002000011E800000012` is
> newer than the configured delay (345600 seconds)

This message is presumably generated by your "segment.sh" script. I'd
guess the file you copied is ending up with a very recent timestamp
which is causing it to be rejected by the script.

> So it seems the database hasn't been replicated since MAY 17:
> 
> *on slave02 server:*
> 
> ls -la /var/lib/pgsql/9.2/wal_archive:
> 
> postgres postgres 16777216 May 17 18:16 00000002000011E80000000F
> postgres postgres 16777216 May 17 18:18 00000002000011E800000010
> postgres postgres 16777216 May 17 18:18 00000002000011E800000011

Guessing again - you want to be shipping the logs to the standby, but for
some reason they're not arriving in that directory. Is the
archive_command on the master working correctly? Are there any
errors in the log on the master?

Regards

Ian Barwick


-- 
 Ian Barwick                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



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

* Re: WAL segment NOT FOUND - Postgres 9.2
@ 2016-06-05 00:53  Patrick Baker <patrickbakerbr@gmail.com>
  parent: Ian Barwick <ian@2ndquadrant.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Patrick Baker @ 2016-06-05 00:53 UTC (permalink / raw)
  To: Ian Barwick <ian@2ndquadrant.com>; +Cc: pgsql-admin

Hi guys,


So... My servers are:

1 master
2 slaves (streaming replication)
1 backup server (replication using WAL FILES)

The backup server is not updated... it seems the WAL ARCHIVES have failed
and the server is not updated.

The error that I see on the pg_log:
WAL segment `../wal_archive/00000002000011E800000012` not found


Question:
Can I make the server be replicated by using streaming replication, so the
server would be updated.. and then I go back to the WAL ARCHIVE?

We use WAL ARCHIVE because we keep it 4 days old:
restore_command = 'exec nice -n 19 ionice -c 2 -n 7 ../../bin/segment.sh
> "../wal_archive/%f" "%p" 345600'


Thanks

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

* Re: WAL segment NOT FOUND - Postgres 9.2
@ 2016-06-05 01:00  Patrick Baker <patrickbakerbr@gmail.com>
  parent: Patrick Baker <patrickbakerbr@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Patrick Baker @ 2016-06-05 01:00 UTC (permalink / raw)
  To: Ian Barwick <ian@2ndquadrant.com>; +Cc: pgsql-admin

2016-06-05 12:53 GMT+12:00 Patrick Baker <patrickbakerbr@gmail.com>:

> Hi guys,
>
>
> So... My servers are:
>
> 1 master
> 2 slaves (streaming replication)
> 1 backup server (replication using WAL FILES)
>
> The backup server is not updated... it seems the WAL ARCHIVES have failed
> and the server is not updated.
>
> The error that I see on the pg_log:
> WAL segment `../wal_archive/00000002000011E800000012` not found
>
>
> Question:
> Can I make the server be replicated by using streaming replication, so the
> server would be updated.. and then I go back to the WAL ARCHIVE?
>

*Current recovery.conf:*
#primary_conninfo = 'host= port=5432 user=replicator application_name='
restore_command = 'exec nice -n 19 ionice -c 2 -n 7 ../../bin/restore.bash
"../wal_archive/%f" "%p" 345600'

*New recovery.conf (To set streaming replication on):*
primary_conninfo = 'host=mymasterserver port=5432 user=replicator
application_name='
restore_command = 'exec nice -n 19 ionice -c 2 -n 7 ../../bin/restore.bash
"../wal_archive/%f" "%p"'


By doing that, I'd active streaming replication on my backup server.

After the database be updated, I can go backup to the replication by wal
files ?

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

* Re: WAL segment NOT FOUND - Postgres 9.2
@ 2016-06-06 23:53  Patrick B <patrickbakerbr@gmail.com>
  parent: Patrick Baker <patrickbakerbr@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Patrick B @ 2016-06-06 23:53 UTC (permalink / raw)
  To: Ian Barwick <ian@2ndquadrant.com>; +Cc: pgsql-admin

Can I update the database just by setting the server as slave using
streaming replication?

Or I have to re-sync all the data folder and then set it as slave with
streaming replication?

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

* Re: WAL segment NOT FOUND - Postgres 9.2
@ 2016-06-08 09:18  Venkata Balaji N <nag1010@gmail.com>
  parent: Patrick B <patrickbakerbr@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Venkata Balaji N @ 2016-06-08 09:18 UTC (permalink / raw)
  To: Patrick B <patrickbakerbr@gmail.com>; +Cc: Ian Barwick <ian@2ndquadrant.com>; pgsql-admin

On Tue, Jun 7, 2016 at 9:53 AM, Patrick B <patrickbakerbr@gmail.com> wrote:

> Can I update the database just by setting the server as slave using
> streaming replication?
>
> Or I have to re-sync all the data folder and then set it as slave with
> streaming replication?
>

If you are replaying WALs continuously without any issues, then, you can
just add *standby_mode='on'*  and then, restart the standby database, that
should do.


Regards,
Venkata B N

Fujitsu Australia

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


end of thread, other threads:[~2016-06-08 09:18 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-06-02 01:49 WAL segment NOT FOUND - Postgres 9.2 Patrick Baker <patrickbakerbr@gmail.com>
2016-06-02 02:35 ` Ian Barwick <ian@2ndquadrant.com>
2016-06-05 00:53   ` Patrick Baker <patrickbakerbr@gmail.com>
2016-06-05 01:00     ` Patrick Baker <patrickbakerbr@gmail.com>
2016-06-06 23:53       ` Patrick B <patrickbakerbr@gmail.com>
2016-06-08 09:18         ` Venkata Balaji N <nag1010@gmail.com>

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