Обсуждение: DRDB?

Поиск
Список
Период
Сортировка

DRDB?

От
"Martin Fandel"
Дата:
Hi all,

is DRDB (http://www.drbd.org/) a recommended replication-solution for
PostgreSQL? I asked some PostgreSQL-People and DRDB-People on the
Linux-Tag in germany. But I'm not very assured about this solution.

Which is the best solution? (Slony, DRDB, WAL or something else?)

Best regards,

Martin



Re: DRDB?

От
Bruce Momjian
Дата:
Martin Fandel wrote:
> Hi all,
>
> is DRDB (http://www.drbd.org/) a recommended replication-solution for
> PostgreSQL? I asked some PostgreSQL-People and DRDB-People on the
> Linux-Tag in germany. But I'm not very assured about this solution.

Uh, we really don't _recommend_ replication solutions.  However, I will
say I have heard of Slony, but never of DRDB.  It seems DRDB replicates
the file system blocks to another machine.  While this could work just
fine, it is different than something like Slony that allows you to
replicate only certain tables and allows for you to switch master and
slave roles among servers.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: DRDB?

От
Tom Lane
Дата:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Martin Fandel wrote:
>> is DRDB (http://www.drbd.org/) a recommended replication-solution for
>> PostgreSQL? I asked some PostgreSQL-People and DRDB-People on the
>> Linux-Tag in germany. But I'm not very assured about this solution.

> Uh, we really don't _recommend_ replication solutions.  However, I will
> say I have heard of Slony, but never of DRDB.  It seems DRDB replicates
> the file system blocks to another machine.

I have not probed further than the site's top page, but unless DRBD
offers some pretty strong guarantees about physical write order on the
master being duplicated on the slave, it won't work reliably for
Postgres.

            regards, tom lane

Re: DRDB?

От
"Magnus Hagander"
Дата:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Martin Fandel wrote:
> >> is DRDB (http://www.drbd.org/) a recommended
> replication-solution for
> >> PostgreSQL? I asked some PostgreSQL-People and DRDB-People on the
> >> Linux-Tag in germany. But I'm not very assured about this solution.
>
> > Uh, we really don't _recommend_ replication solutions.  However, I
> > will say I have heard of Slony, but never of DRDB.  It seems DRDB
> > replicates the file system blocks to another machine.

(Um, Bruce, we talked to Alan Robertson about this in Copenhagen a
couple of months back. So you've certainly *heard* of it :P)

> I have not probed further than the site's top page, but
> unless DRBD offers some pretty strong guarantees about
> physical write order on the master being duplicated on the
> slave, it won't work reliably for Postgres.

From what I've heard, it does guarantee this. I think it requires you to
put all your stuff on the same DRBD device (no special device for WAL).
But I'm not 100% sure on this.

For example, DB2 is supported on these devices. I would assume they have
the same requirements as postgresql in this case. (See
ftp://ftp.software.ibm.com/software/data/pubs/papers/db2halinux.pdf)

//Magnus

Re: DRDB?

От
Tom Lane
Дата:
"Magnus Hagander" <mha@sollentuna.net> writes:
>> I have not probed further than the site's top page, but
>> unless DRBD offers some pretty strong guarantees about
>> physical write order on the master being duplicated on the
>> slave, it won't work reliably for Postgres.

> From what I've heard, it does guarantee this. I think it requires you to
> put all your stuff on the same DRBD device (no special device for WAL).

That would seem pretty likely --- I don't see how a block-level driver
could synchronize operations occuring on different devices.

            regards, tom lane

Re: DRDB?

От
Bruce Momjian
Дата:
Magnus Hagander wrote:
> > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > > Martin Fandel wrote:
> > >> is DRDB (http://www.drbd.org/) a recommended
> > replication-solution for
> > >> PostgreSQL? I asked some PostgreSQL-People and DRDB-People on the
> > >> Linux-Tag in germany. But I'm not very assured about this solution.
> >
> > > Uh, we really don't _recommend_ replication solutions.  However, I
> > > will say I have heard of Slony, but never of DRDB.  It seems DRDB
> > > replicates the file system blocks to another machine.
>
> (Um, Bruce, we talked to Alan Robertson about this in Copenhagen a
> couple of months back. So you've certainly *heard* of it :P)

Oh, that was it.  Yea, I remember now!

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: DRDB?

От
Peter Eisentraut
Дата:
Martin Fandel wrote:
> Which is the best solution? (Slony, DRDB, WAL or something else?)

Slony is a master/slave replication system that can improve overall read
performance.  DRBD gives you a hot stand-by system.  Both of these are
completely different goals, which can be implemented complementarily.

A WAL-based replication gives you about the same effect as a DRBD
replication, but with DRBD you pass on all the responsibility to the
operating system.  One guy at LinuxTag told be he manages his DRBD
pairs using Linux virtual servers, which would mean that on some level
you don't even notice that you have two machines running instead of
one.  If have yet to figure that out, but it sounds quite nice.

Btw., it was probably me who told you about DRBD, but I didn't make that
up myself.  A lot of people are currently using it.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/