Skip site navigation (1) Skip section navigation (2)

Re: PostgreSQL in Shared Disk Failover mode on FreeBSD+CARP+RAIDZ

From: snoop(at)email(dot)it
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: PostgreSQL in Shared Disk Failover mode on FreeBSD+CARP+RAIDZ
Date: 2010-12-21 03:03:46
Message-ID: 4fc20ec1f2580041eaddda903bb4a868@213.152.156.147 (view raw or flat)
Thread:
Lists: pgsql-admin
> On Mon, Dec 20, 2010 at 6:23 PM,  <snoop(at)email(dot)it> wrote:
> > Hi everybody,
> > I'm trying to figure out a way to setup a PostgreSQL HA cluster
solution.
> >
> > For the record:
> > - I've already tried pgpool-II 2.x in Synchronous Multi Master
Replication
> > mode and I was satisfied by it's functionality but concerned about
having
> > the same data growing on several nodes
> 
> What actual concerns did you have?  Just a question of too many
> spinning disks in your machines or something?  There are some issues
> with race conditions and such with statement level replication to be
> aware of.

Well, I'd prefer a big single storage instead of "too many spinning disks"
around mainly for maintenance reasons, to avoid replication and too much
network traffic.
Thanks for the "race conditions" tip.

> 
> > - I've upgraded to pgpool-II 3.0.x on FreeBSD (from ports) but it's very
> > buggy at the moment
> > - I don't like the idea of having fixed size (16 megs regardless of the
> > committed transaction number!) WAL logs often "shipped" from one node to
> > another endangering my network performance (asynchronous replication)
> 
> Streaming replication in 9.0 doesn't really work that way, so you
> could use that now with a hot standby ready to be failed over to as
> needed.

Mmm, so I can use an hot standby setup without any need for replication
(same data dir) and no need for STONITH?
Sorry if my questions sound trivial to you but my experience with PostgreSQL
is quite limited and this would be my first "more complex" configuration and
I'm trying to figure out the best way to go. Unfortunately it's not that
easy to figure it out going through the documentation only.

> 
> > I've done some research and I've an idea of different possible
solutions,
> > but I'd honestly like to implement it using CARP in a "Shared Disk
Failover"
> > fashion.
> > Unfortunately this doesn't really seem to be a common way according to
the
> > very limited information available on the net and that's why I'm going
to
> > ask here.
> 
> Yeah, there's a lot of things you have to be careful of to prevent
> data corruption.  If two postgresql instances mount and start on the
> same data share, you will immediately have a corrupted data store and
> have to restore from backup.
> 
> > My idea: two nodes (i386) with FreeBSD 8.1 and PostgreSQL 9.0.2, CARP
> > providing network failover and a shared data dir on a RAIDZ solution.
> 
> Only one at a time.  Ever.  So you'll need fencing software / hardware
> for your shared data drives.
> 
> > I'm
> > pretty sure that CARP would do the job properly indirectly avoiding even
the
> > dangerous writing on the data dir from both nodes at the same time (that
> > would apparently badly screw up the DB) by redirecting any network
> > connection to the active DB and to him only.
> 
> You'll need more than carp.
> 
> > BUT ... I'm seriously concerned about the already active connections
client
> > <-> server during the failover.
> > Example:
> >
> > client A connects to server A
> > server A fails so does the client A connection
> > CARP redirects any upcoming connection to the DB to server B now
> > client A reconnects and is now operating on server B
> > THEN
> > server A comes back up
> 
> Stop.  FULL STOP.  If A goes down, you need to STONITH (Shoot the
> other node in the head) so it cannot under any circumstances come back
> up on accident.  It's a good idea to have either or both fencing for
> your network switch and a power switch you can use a signal to to
> power down server A.
> 
> > Did anyone here try such a configuration by any chance?
> 
> There are people on the list using multiple machines pointing at
> single storage arrays with fencing and STONITH technology.  I'm not,
> we just use slony and manual failover for our stuff. 
 --
 Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP
autenticato? GRATIS solo con Email.it: http://www.email.it/f
 
 Sponsor:
 MisterCupido.com crea i tuoi regali personalizzati ai prezzi più bassi del
web... e questa settimana ci sono più sconti che mai!
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=11031&d=20101221



Responses

pgsql-admin by date

Next:From: Scott MarloweDate: 2010-12-21 03:30:43
Subject: Re: PostgreSQL in Shared Disk Failover mode on FreeBSD+CARP+RAIDZ
Previous:From: Scott MarloweDate: 2010-12-21 01:43:59
Subject: Re: PostgreSQL in Shared Disk Failover mode on FreeBSD+CARP+RAIDZ

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group