Обсуждение: mirroring a server and/or hot standby

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

mirroring a server and/or hot standby

От
John Bleichert
Дата:
Hello All,

I am looking for documentation pointers on how to move the contents of an existing/working single-instance server to a new instance. As in: I have a Postgres server running in a VM and I want to move it to a different OS in a different VM guest. 

Is there a way to gracefully do this? Is there a way to "sync" to a new server? Do I need to do this the hard way by manually copying all the data over to a new server with SQL?

It seems that setting up a hot standby server may be the way to go but chapter 25 in the user doc is scant on setup/install detail for this configuration. I am also interested in setting up an offsite hot standby server for failover.

Suggestions for tools and/or further reading welcome!

Thanks in advance,

John

Re: mirroring a server and/or hot standby

От
Дата:

Hello John,

 

Since you mentioned a different OS and want to copy the entire instance it would seem that pg_dumpall is the way to go.

 

You would then import the dump into the new instance using psql.

 

See:

http://www.postgresql.org/docs/9.4/static/app-pg-dumpall.html

http://www.postgresql.org/docs/9.4/static/app-psql.html

 

Best regards,

Holger Friedrich

 

From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of John Bleichert
Sent: Wednesday, June 24, 2015 3:55 PM
To: pgsql-general@postgresql.org
Subject: [GENERAL] mirroring a server and/or hot standby

 

Hello All,

 

I am looking for documentation pointers on how to move the contents of an existing/working single-instance server to a new instance. As in: I have a Postgres server running in a VM and I want to move it to a different OS in a different VM guest. 

 

Is there a way to gracefully do this? Is there a way to "sync" to a new server? Do I need to do this the hard way by manually copying all the data over to a new server with SQL?

 

It seems that setting up a hot standby server may be the way to go but chapter 25 in the user doc is scant on setup/install detail for this configuration. I am also interested in setting up an offsite hot standby server for failover.

 

Suggestions for tools and/or further reading welcome!

 

Thanks in advance,

 

John

Re: mirroring a server and/or hot standby

От
John Bleichert
Дата:
I use pg_dumpall for regular backups and can definitely use one of those backups to kickstart the new server. Would I then configure that new server instance as a standby server as per doc section 18.6? 

Or should I just setup the standby server first? Having re-read 18.6 I think this is what I want.

Thanks!

John


Re: mirroring a server and/or hot standby

От
Дата:

John Bleichert wrote on Wednesday, June 24, 2015 4:21 PM:

Ø  Would I then configure that new server instance as a standby server as per doc section 18.6?

Ø  Or should I just setup the standby server first? Having re-read 18.6 I think this is what I want.

 

I may be wrong but I’m not sure a master-standby setup will work for you given that you mentioned different OSes.  Then again, I’m not sure it won’t either.  Section 25.2.1 says,

 

“It is usually wise to create the primary and standby servers so that they are as similar as possible, at least from the perspective of the database server. In particular, the path names associated with tablespaces will be passed across unmodified, so both primary and standby servers must have the same mount paths for tablespaces if that feature is used. […] In any case the hardware architecture must be the same — shipping from, say, a 32-bit to a 64-bit system will not work.”

 

(And I am not sure whether this applies to file-based log shipping, streaming replication, or both.)  At least the docs did not say that different OSes will not work at all.  If you do happen to use tablespaces and exactly one of your different OSes is Windows then the thing with the unmodified path names will not work (obviously).