Thread: Clone a database to other machine

Clone a database to other machine

From
"Garg, Manjit"
Date:
Hi All,
 
I'm stuck to an issue while cloning the pgsql database, can you please help, or give any docs to help out.
 
Query - Trying to have same database on two seprate linux servers. One will be used to upport Applications and other will be used for Report generation only.
 
Want to keep both the database in Sync, hourly or nightly.
 
Kindly help to achive the same.
 
 
 

Thanks and regards,

Manjit Garg
Corbus Global Support Team
INDIA
------------------------------------------------------
Email: mgarg@corbus.com

Phone: +91-120-304-4000, Ext 252
Fax  : +91-120-256-7040

Mob : 9810679256
------------------------------------------------------

 

CONFIDENTIALITY NOTICE:This message, including any attachments hereto, (collectively the Email Message) is intended solely for the personal and confidential use of the designated recipient(s) and may contain privileged, proprietary, or otherwise private information which may be subject to attorney-client privilege or may constitute inside information protected by law. If the reader of this message is not the intended recipient, you are hereby notified of the following: (i) Any disclosure, printing, copying, or distribution of this Email Message by you or (ii) the taking of any action by you based on the contents of this Email Message or (iii) any other use of this Email Message by you, are strictly prohibited. If you have received this message in error, please notify the sender immediately and remove all traces of the electronic mail message and its attachments from your system.

Re: Clone a database to other machine

From
"Francisco Reyes"
Date:
On 12:44 pm 07/28/08 "Garg, Manjit" <mgarg@corbus.com> wrote:
> I'm stuck to an  issue while cloning the pgsql database, can you
> please help, or give any docs to  help out.

What is the issue?

> Query - Trying to  have same database on two seprate linux servers.

Have you been able to pg_dump from the source DB and then read it in the
target?

Are you trying to do replication or you just want point in times?
How large is the database?


Re: Clone a database to other machine

From
"Francisco Reyes"
Date:
On 1:32 pm 07/28/08 "Garg, Manjit" <mgarg@corbus.com> wrote:

> But, actually I want to keep both the Databse in Sync. I want clone db
> to get the data from Master in  certain intervals.

Sounds like you are looking for replication. Check
http://wiki.postgresql.org/wiki/Replication%2C_Clustering%2C_and_Connection_Pooling


Re: Clone a database to other machine

From
Lennin Caro
Date:
you can use slony-i

http://slony.info/


--- On Mon, 7/28/08, Garg, Manjit <mgarg@corbus.com> wrote:

> From: Garg, Manjit <mgarg@corbus.com>
> Subject: [GENERAL] Clone a database to other machine
> To: pgsql-general@postgresql.org
> Date: Monday, July 28, 2008, 4:44 PM
> Hi All,
>
> I'm stuck to an issue while cloning the pgsql database,
> can you please
> help, or give any docs to help out.
>
> Query - Trying to have same database on two seprate linux
> servers. One
> will be used to upport Applications and other will be used
> for Report
> generation only.
>
> Want to keep both the database in Sync, hourly or nightly.
>
> Kindly help to achive the same.
>
>
>
> Thanks and regards,
>
> Manjit Garg
> Corbus Global Support Team
> INDIA
> ------------------------------------------------------
> Email: mgarg@corbus.com
> Phone: +91-120-304-4000, Ext 252
> Fax  : +91-120-256-7040
>
> Mob : 9810679256
> ------------------------------------------------------
>
>
>
>
>
> CONFIDENTIALITY NOTICE:
> This message, including any attachments hereto,
> (collectively the Email Message) is intended solely for the
> personal and confidential use of the designated recipient(s)
> and may contain privileged, proprietary, or otherwise
> private information which may be subject to attorney-client
> privilege or may constitute inside information protected by
> law. If the reader of this message is not the intended
> recipient, you are hereby notified of the following: (i)
> Any disclosure, printing, copying, or distribution of this
> Email Message by you or (ii) the taking of any action by
> you based on the contents of this Email Message or (iii)
> any other use of this Email Message by you, are strictly
> prohibited. If you have received this message in error,
> please notify the sender immediately and remove all traces
> of the electronic mail message and its attachments from
> your system.





Re: Clone a database to other machine

From
"Asko Oja"
Date:
Hi

And you can use Londiste from Skytools. It's simpler and better suited for your task.
http://pgfoundry.org/projects/skytools/

Asko

On Mon, Jul 28, 2008 at 7:44 PM, Garg, Manjit <mgarg@corbus.com> wrote:
Hi All,
 
I'm stuck to an issue while cloning the pgsql database, can you please help, or give any docs to help out.
 
Query - Trying to have same database on two seprate linux servers. One will be used to upport Applications and other will be used for Report generation only.
 
Want to keep both the database in Sync, hourly or nightly.
 
Kindly help to achive the same.
 
 
 

Thanks and regards,

Manjit Garg
Corbus Global Support Team
INDIA
------------------------------------------------------
Email: mgarg@corbus.com

Phone: +91-120-304-4000, Ext 252
Fax  : +91-120-256-7040

Mob : 9810679256
------------------------------------------------------

 

CONFIDENTIALITY NOTICE:This message, including any attachments hereto, (collectively the Email Message) is intended solely for the personal and confidential use of the designated recipient(s) and may contain privileged, proprietary, or otherwise private information which may be subject to attorney-client privilege or may constitute inside information protected by law. If the reader of this message is not the intended recipient, you are hereby notified of the following: (i) Any disclosure, printing, copying, or distribution of this Email Message by you or (ii) the taking of any action by you based on the contents of this Email Message or (iii) any other use of this Email Message by you, are strictly prohibited. If you have received this message in error, please notify the sender immediately and remove all traces of the electronic mail message and its attachments from your system.


Re: Clone a database to other machine

From
"Garg, Manjit"
Date:
Hi,

Yes, I'm able to pg_dump the database to other server. And database is
working fine there.

But, actually I want to keep both the Databse in Sync. I want clone db
to get the data from Master in  certain intervals.

DB dump size is 3 GB.


Thanks and regards,



-----Original Message-----
From: Francisco Reyes [mailto:lists@stringsutils.com]
Sent: Monday, July 28, 2008 10:42 PM
To: Garg, Manjit
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Clone a database to other machine

On 12:44 pm 07/28/08 "Garg, Manjit" <mgarg@corbus.com> wrote:
> I'm stuck to an  issue while cloning the pgsql database, can you
> please help, or give any docs to  help out.

What is the issue?

> Query - Trying to  have same database on two seprate linux servers.

Have you been able to pg_dump from the source DB and then read it in the
target?

Are you trying to do replication or you just want point in times?
How large is the database?


Re: Clone a database to other machine

From
Raymond O'Donnell
Date:
On 28/07/2008 18:32, Garg, Manjit wrote:

> But, actually I want to keep both the Databse in Sync. I want clone db
> to get the data from Master in  certain intervals.
>
> DB dump size is 3 GB.

In that case, a cron job which dumps the data from the master and
reloads it on the other machine may be your best bet.

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

Re: Clone a database to other machine

From
Raymond O'Donnell
Date:
On 30/07/2008 15:56, Garg, Manjit wrote:

> Actually I was looking for some method / tool (utility) which keeps both
> the database on different servers in sync automatically.

Ah, OK - I thought you meant that you needed a clone at specific
intervals. You can use Slony (www.slony.info) to do this. A couple of
caveats, however:

(i) If you use the 1.* version (the only currently stable version), you
can't use pg_dump to dump from the slaves - this is because Slony 1.*
rewrites the system catalogues in strange ways. :-)

(ii) Slony 2.0 (currently at RC1) does allow you to get a consistent
dump from the slaves, but you need to be running PostgreSQL 8.3 or later.

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

Re: Clone a database to other machine

From
"Garg, Manjit"
Date:
 Hi ,

Actually I was looking for some method / tool (utility) which keeps both
the database on different servers in sync automatically.

Looking for some features into postgres.conf file if possible.


Thanks and regards,

Manjit Garg


-----Original Message-----
From: Raymond O'Donnell [mailto:rod@iol.ie]
Sent: Wednesday, July 30, 2008 8:22 PM
To: Garg, Manjit
Cc: lists@stringsutils.com; pgsql-general@postgresql.org
Subject: Re: [GENERAL] Clone a database to other machine

On 28/07/2008 18:32, Garg, Manjit wrote:

> But, actually I want to keep both the Databse in Sync. I want clone db

> to get the data from Master in  certain intervals.
>
> DB dump size is 3 GB.

In that case, a cron job which dumps the data from the master and
reloads it on the other machine may be your best bet.

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie Galway Cathedral Recitals:
http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

Re: Clone a database to other machine

From
Chris
Date:
Garg, Manjit wrote:
>  Hi ,
>
> Actually I was looking for some method / tool (utility) which keeps both
> the database on different servers in sync automatically.
>
> Looking for some features into postgres.conf file if possible.

There's no built in replication for postgres at the moment.

Check out slony (http://slony.info/) - it's a master->multiple slave
replication system and seems to work pretty well.

--
Postgresql & php tutorials
http://www.designmagick.com/

Re: Clone a database to other machine

From
"Henry - Zen Search SA"
Date:
On Thu, July 31, 2008 10:07 am, Chris wrote:
> Garg, Manjit wrote:
> Check out slony (http://slony.info/) - it's a master->multiple slave
> replication system and seems to work pretty well.

You can also try SkyTools (http://pgfoundry.org/projects/skytools/) - it's
far simpler to use and to manage (eg, when things go wrong [they do]).

Regards
Henry