Cloning PostgreSQL 8.3.7

Поиск
Список
Период
Сортировка
Искать

Cloning PostgreSQL 8.3.7

От:
Tomas Ramanauskas <Tomas.Ramanauskas@springer.com>
Дата:

Hi, guys,

 

I’m new to PostgreSQL and I’m currently involved in cloning PostgreSQL 8.3.7 to a different server (as a first step of migration to 9.3 version project).

 

 

I’m able to clone the db server and everything is working, but I’m not entirely sure how manual application of WAL files works /  is triggered.

 

After DB is cloned, I want to apply all the changes since the database was cloned.

I want to do it as a one-off operation, I don’t want to create “warm standby”. I also want to verify and make sure that all WAL files got applied.

 

I’m not sure if PG applies all the WAL files it finds in pg_xlog or I need to run a specific command to do that?

I just copied all the WAL files to pg_xlog and started PG, but there is nothing in the log files indicating that WAL files actually got applied.

 

 

I also posted same question also here:

https://stackoverflow.com/questions/24784042/cloning-postgresql-8-3-7

 

 

Kind regards,

Tomas

Re: Cloning PostgreSQL 8.3.7

От:
Jerry Sievers <gsievers19@comcast.net>
Дата:
Tomas Ramanauskas  writes:

> Hi, guys,
>
> Im new to PostgreSQL and Im currently involved in cloning PostgreSQL 8.3.7 to a different server (as a first step of migration to 9.3 version project).
>
> Im able to clone the db server and everything is working, but Im not entirely sure how manual application of WAL files works /  is triggered.
>
> After DB is cloned, I want to apply all the changes since the database was cloned.
>
> I want to do it as a one-off operation, I dont want to create warm standby. I also want to verify and make sure that all WAL files got applied.

You are describing a hot-backup and point in time recovery  which is
well documented in   the standard Pg doc set.  

You will replay all available WALs and your clone will come online at
that point. 

<>
> Im not sure if PG applies all the WAL files it finds in pg_xlog or I need to run a specific command to do that?
>
> I just copied all the WAL files to pg_xlog and started PG, but there is nothing in the log files indicating that WAL files actually got applied.
>
> I also posted same question also here:
>
> https://stackoverflow.com/questions/24784042/cloning-postgresql-8-3-7
>
> Kind regards,
>
> Tomas
>

-- 
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net
p: 312.241.7800

Re: Cloning PostgreSQL 8.3.7

От:
Tomas Ramanauskas <Tomas.Ramanauskas@springer.com>
Дата:
Hi, Jerry,

Thanks for the answer.

I read this document before posting the question:
http://www.postgresql.org/docs/8.3/static/continuous-archiving.html

I already have WAL archiving set up which archives WAL files to remote location:
archive_mode = on
archive_command = '/my_script.sh %p %f'


The only thing I didn't do - was creating recovery.conf file.

It's not clear if this file is mandatory or optional if I don't need "restore_command" to do any WAL copy for me (I already copied all archived WAL files to pg_xlog manually).
And I'm interested to do the point in time recovery to the end of the WAL log which is the default value for recovery_target_time.


And everything worked fine for me, there were just no messages written in the log file (pg_log) indicating that WAL apply was actually performed.




Tomas


-----Original Message-----
From: Jerry Sievers [mailto:gsievers19@comcast.net] 
Sent: 16 July 2014 22:07
To: Tomas Ramanauskas
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Cloning PostgreSQL 8.3.7

Tomas Ramanauskas  writes:

> Hi, guys,
>
> Im new to PostgreSQL and Im currently involved in cloning PostgreSQL 8.3.7 to a different server (as a first step of migration to 9.3 version project).
>
> Im able to clone the db server and everything is working, but Im not entirely sure how manual application of WAL files works /  is triggered.
>
> After DB is cloned, I want to apply all the changes since the database was cloned.
>
> I want to do it as a one-off operation, I dont want to create warm standby. I also want to verify and make sure that all WAL files got applied.

You are describing a hot-backup and point in time recovery  which is
well documented in   the standard Pg doc set.  

You will replay all available WALs and your clone will come online at that point. 

<>
> Im not sure if PG applies all the WAL files it finds in pg_xlog or I need to run a specific command to do that?
>
> I just copied all the WAL files to pg_xlog and started PG, but there is nothing in the log files indicating that WAL files actually got applied.
>
> I also posted same question also here:
>
> https://stackoverflow.com/questions/24784042/cloning-postgresql-8-3-7
>
> Kind regards,
>
> Tomas
>

--
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net
p: 312.241.7800

FAQ