Thread: 2 servers with 1 database cluster

2 servers with 1 database cluster

From
"Mark Cubitt"
Date:
Hi,
 
we are currently running 2 web/database servers with apache and postgess (and php etc),
these have differnet sites on them at the moment but we are gonna have them load blanced and have both sites on each server.
 
we will be using storage space with the hosting company to hold the pages and the database cluster.
 
we are planning to have a copy of postgress running on both servers accessing the cluster on the storage space at the same time,
is this possiable and if so is there any possiable problems.
 
and how would the database cluster handle 2 accesses to the same record at once?
 
thanks in advance for any nad all help
 
regards
 
Mark Cubitt

Re: 2 servers with 1 database cluster

From
Richard Huxton
Date:
On Monday 09 Jun 2003 4:49 pm, Mark Cubitt wrote:
> Hi,
>
> we are currently running 2 web/database servers with apache and postgess
> (and php etc), these have differnet sites on them at the moment but we are
> gonna have them load blanced and have both sites on each server.
>
> we will be using storage space with the hosting company to hold the pages
> and the database cluster.
>
> we are planning to have a copy of postgress running on both servers
> accessing the cluster on the storage space at the same time, is this
> possiable and if so is there any possiable problems.

If you mean two postmasters accessing a shared disk - no this is not possible
- your data will be corrupted.
I recall a long discussion on this some months ago, you might like to look at
the archives.

> and how would the database cluster handle 2 accesses to the same record at
> once?

Badly.

You want one of two things:
1. One shared PG installation behind your two webservers
2. Two individual PG installations replicating between each other.

--
  Richard Huxton

Re: 2 servers with 1 database cluster

From
"scott.marlowe"
Date:
As another poster already pointed out, running two postmasters against the
same storage is officially a Very Bad Idea.

Also, it sounded like you might be looking at network attached storage
etc. to put your database on.  While isn't a Very Bad Idea, it is a path
fraught with danger.  For a database server, you're probably better off
having one very fast box that's either replicated or simply hot backed up
nightly from the live box.  Any dual CPU machine with a gig of memory and
a stack of drives underneath it can handle two front end application
servers handily.