Re: PostgreSQL and 2-node failover cluster solutions - Mailing list pgsql-admin

From Ragnar Kjørstad
Subject Re: PostgreSQL and 2-node failover cluster solutions
Date
Msg-id 20021006152114.A24076@vestdata.no
Whole thread Raw
In response to Re: PostgreSQL and 2-node failover cluster solutions  (Chris Miles <chris_pg002@psychofx.com>)
Responses Re: PostgreSQL and 2-node failover cluster solutions
List pgsql-admin
On Sun, Oct 06, 2002 at 02:06:49PM +0100, Chris Miles wrote:
> > Uh; why would you want to do that?
> > Databases work much better with local storage than over NFS.
>
> They also work very well, if not as good, with dedicated NFS storage, when
> setup properly.  I have built both a large Oracle server on Sun E6500 using
> dedicated Netapp NFS storage (connected directly with dual Gigabit fibre)
> and a medium sized pair of PostgreSQL servers using Netapp NFS again.
>
> The advantage in the latter case is the ease of database failover between
> servers.  The same could be done with multi-homed scsi disk or SAN but
> in this case Netapps were available.  The speed is more than sufficient.

Well; if you have a single NetApp then you still have a single point of
failure (avoiding that is the whole purpose of failover, right?), and if
you have two of them then it's one pretty damn expensive
postgresql-server :)

Anyway.....

> > There are a very large number of linux failover software packages;
> > commercial and free. They all have their pros and cons - I prefer
> > heartbeat because of it's simplicity. (the main drawback of heartbeat is
> > that it does not yet implement service-monitoring - but you can do that
> > outside heartbeat if you want to)
>
> I have not had a close look at Heartbeat yet.  Simplicity is one of
> my requirements, so I am interested.  Could you describe your setup?
> I presume you are using it to failover PostgreSQL servers?

No, currently we're only using it for failover lvs- and file-servers.
The principle is the same though: Heartbeat runs on two servers
connected with multiple "heartbeat-channels" (ethernet, serial....).
They constantly monitor each other, and if the secondary server looses
contact with the primary it will start the "services" locally. In your
case the services would be an IP-address and the postgresql-server.

You also need some "fencing" to make sure that the two servers don't
both start postgresql by accident. This is done with "stonith" (Shoot
the other node in the head) - before the secondary server starts
postgresql it will cut the power to the primary server to make sure it's
not up.

That's pretty much it.

Be awere that failover doesn't solve any problem in the world though: If
postgresql corrupts it's files, both servers are screwed. Also, failover
will complicate the setup, and in general a more complicated setup means
more downtime (operator-error) - so, make sure you read the
documentation and understand how it works (or pay someone to do it for
you).


--
Ragnar Kjørstad

pgsql-admin by date:

Previous
From: Chris Miles
Date:
Subject: Re: PostgreSQL and 2-node failover cluster solutions
Next
From: Jun Tanamal
Date:
Subject: Re: affected by ISP/DNS change