Thread: Two instances of Postgres with single data directory

Two instances of Postgres with single data directory

From
dineshkaarthick
Date:
All,

I need to know is it possible to execute two instances of Postgres with
single data directory shared between the two instances.

This is to know if we can achieve Oracle RAC like cluster for Postgres.

Regards
Dina



--
View this message in context:
http://postgresql.nabble.com/Two-instances-of-Postgres-with-single-data-directory-tp5826788.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


Re: Two instances of Postgres with single data directory

From
Michael Paquier
Date:
On Thu, Nov 13, 2014 at 9:17 PM, dineshkaarthick
<dineshkaarthick@yahoo.co.uk> wrote:
> All,
>
> I need to know is it possible to execute two instances of Postgres with
> single data directory shared between the two instances.
No, a server instance cannot run on a data folder being used by an
existing instance.
--
Michael


Re: Two instances of Postgres with single data directory

From
dineshkaarthick
Date:
Michael,

Appreciate your quick response. Thank you.

I would like to know how is the "Shared Disk Failover" replication achieved
if it is not possible to share the data directory ? I am referring to the
1st solution in the mentioned link,
http://www.postgresql.org/docs/9.3/static/different-replication-solutions.html

Regards
Dina



--
View this message in context:
http://postgresql.nabble.com/Two-instances-of-Postgres-with-single-data-directory-tp5826788p5826972.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


Re: Two instances of Postgres with single data directory

From
Devrim Gündüz
Date:
Hi,

On Fri, 2014-11-14 at 02:57 -0700, dineshkaarthick wrote:
> I would like to know how is the "Shared Disk Failover" replication
> achieved if it is not possible to share the data directory ? I am
> referring to the 1st solution in the mentioned link,
> http://www.postgresql.org/docs/9.3/static/different-replication-solutions.html

It is not a replication -- it is HA solution. That particular one can be
used along with Red Hat Cluster Suite (now called Red Hat High
Availability Addon). A presentation is here:

http://www.gunduz.org/download.php?dlid=208

Regards,
--
Devrim GÜNDÜZ
Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR


Attachment

Re: Two instances of Postgres with single data directory

From
Albe Laurenz
Date:
dineshkaarthick wrote:
> I would like to know how is the "Shared Disk Failover" replication achieved
> if it is not possible to share the data directory ? I am referring to the
> 1st solution in the mentioned link,
> http://www.postgresql.org/docs/9.3/static/different-replication-solutions.html

You have some cluster software that makes dead sure that one node is *not*
running the database server before starting it on the other.

Yours,
Laurenz Albe

Re: Two instances of Postgres with single data directory

From
John R Pierce
Date:
On 11/14/2014 2:24 AM, Albe Laurenz wrote:
dineshkaarthick wrote:
> I would like to know how is the "Shared Disk Failover" replication achieved
> if it is not possible to share the data directory ? I am referring to the
> 1st solution in the mentioned link,
> http://www.postgresql.org/docs/9.3/static/different-replication-solutions.html
You have some cluster software that makes dead sure that one node is *not*
running the database server before starting it on the other.

more specifically, that the data volume isn't even MOUNTED by the other server.   typically this is enforced with hardware 'fencing' such that the standby server is blocked from even trying to mount the shared volume, until it decides to take over, then it fences the original 'master', unfences itself, and mounts the volume, then starts its copy of postgresql.    this fencing is often done in a storage switch (fiberchannel most commonly).



-- 
john r pierce                                      37N 122W
somewhere on the middle of the left coast