Re: Sharing data directories between machines

Поиск
Список
Период
Сортировка
От Steve Atkins
Тема Re: Sharing data directories between machines
Дата
Msg-id 5874FA79-5B38-4F65-9B63-4708656ACE2E@blighty.com
обсуждение исходный текст
Ответ на Sharing data directories between machines  (JD Wong <jdmswong@gmail.com>)
Ответы Re: Sharing data directories between machines  (Andrew Sullivan <ajs@crankycanuck.ca>)
Список pgsql-general
On Aug 6, 2013, at 10:45 AM, JD Wong <jdmswong@gmail.com> wrote:

> Hi all!
>
> I have two servers, which share a large mounted drive.  I would like to share postgres databases between them
dynamicallyso that when one makes changes, they are immediately available in the other.   
>
> I tried moving the data directory over to the mounted drive, and pointing both postgresql.confs to that one.  I was
ableto have both access the same databases, but they can't share changes.  It's like they're running on two separate
datadirectories, even though show data_directory reports the same path for each. 

That'll likely damage your database, probably irrecoverably.

> How can I make them play nicely?

You can't do it by sharing the disk files, at all. The two instances will trash each others data.

If you want multiple database servers for redundancy, or you want to be able to offload read access to a second server,
takea look at hot standby servers. http://www.postgresql.org/docs/9.2/static/high-availability.html 

If you really want to be able to write to either database and have it replicated to the other one immediately, you
shouldprobably rethink what you need. It can be done (with multimaster replication) but it's almost never the right
approach.

Cheers,
  Steve





В списке pgsql-general по дате отправления:

Предыдущее
От: Davide Setti
Дата:
Сообщение: Re: Sharing data directories between machines
Следующее
От: John R Pierce
Дата:
Сообщение: Re: Sharing data directories between machines