Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 1293B133798E for ; Thu, 11 Nov 2010 04:05:02 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 13074-04 for ; Thu, 11 Nov 2010 08:04:54 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wy0-f200.google.com (mail-wy0-f200.google.com [74.125.82.200]) by mail.postgresql.org (Postfix) with ESMTP id 7BCDE1337B6C for ; Thu, 11 Nov 2010 04:04:53 -0400 (AST) Received: by wyb32 with SMTP id 32so321796wyb.7 for ; Thu, 11 Nov 2010 00:04:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.213.28.199 with SMTP id n7mr135470ebc.10.1289462691208; Thu, 11 Nov 2010 00:04:51 -0800 (PST) In-Reply-To: <4CDAF80A.8060804@nrc-cnrc.gc.ca> Message-ID: <0015175907eea929050494c26d92@google.com> Date: Thu, 11 Nov 2010 08:04:51 +0000 Subject: Re: PG HA solution using DBRD From: tsoupl@gmail.com To: Isabella Ghiurea , "tsoupl@gmail.com" Cc: "pgsql-admin@postgresql.org" Content-Type: multipart/alternative; boundary=0015175907eea928e90494c26d8f X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.889 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, T_FRT_BELOW2=0.01 X-Spam-Level: X-Archive-Number: 201011/86 X-Sequence-Number: 36052 --0015175907eea928e90494c26d8f Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Actually, if you are using DRBD as shared disk HA solution (am I correct or you are using postgresql replication, like streaming and hot standby?), then all the PG_DATA directory has to be on DRBD. So, if you power off your 1st node and start your second (pointing the same DRBD PG_DATA directory) it will continue from were the 1st node stopped (if fsync was enabled, if not you may loose the last entries performed on memory but not committed on disk). For this to happen you have to change the data path of the second nodes postgresql script, found under /etc/init.d/ to point to DRBD's $PG_DATA directory. Hope I was helpful. On Nov 10, 2010 9:52pm, Isabella Ghiurea wrote: > Thanks for reply. > DBRD cfg we have :primary/primary both of the servers can be used for > writes/active while only one will be active always and other one is > passive ( PG is offline) > the user data directories and pg_xlog is using DBRD, the PG software > directory and $PG_DATA is local on each server. > Isabella > tsoupl@gmail.com wrote: > Hi, > What king of configuration do you have on DRBD? is it Primary/primary or > Primary secondary? > On Nov 10, 2010 12:12am, Isabella Ghiurea > isabella.ghiurea@nrc-cnrc.gc.ca> wrote: > > Hi All, > > > > I 'm testing a HA solution for a PG version 9.01 database configured > using DBRD for pg_xlog directory and user data /table space partitions.( > block disk changes are copied from master to slave ) > > > > the archive mode option is off for both master and slaver node, when I > power off master without a clean PG shutdown the slave database server > will not start. Bellow is the errror, what are my option to increase the > checkpoint frequency ? > > > > archive_mode is off for both server > > > > > > > > database system was interrupted; last known up at 2010-11-09 08:27:02 > PST > > > > 2010-11-09 13:20:03 PST [8505]: [2-1] LOG: could not open > file "pg_xlog/00000001000000BC00000006" (log file 188, segment 6): No > such file or directory > > > > 2010-11-09 13:20:03 PST [8505]: [3-1] LOG: invalid primary checkpoint > record > > > > 2010-11-09 13:20:03 PST [8505]: [4-1] LOG: could not open > file "pg_xlog/00000001000000BC00000006" (log file 188, segment 6): No > such file or directory > > > > 2010-11-09 13:20:03 PST [8505]: [5-1] LOG: invalid secondary checkpoint > record > > > > 2010-11-09 13:20:03 PST [8505]: [6-1] PANIC: could not locate a valid > checkpoint record > > > > 2010-11-09 13:20:03 PST [8499]: [2-1] LOG: startup process (PID 8505) > was terminated by signal 6: Aborted > > > > 2010-11-09 13:20:03 PST [8499]: [3-1] LOG: aborting startup due to > startup process failure > > > > postgres@proc5-15:errorlog$ > > > Thank you > > > > Isabella > > > > > > > -- > > > > ----------------------------------------------------------- > > > > Isabella A. Ghiurea > > > > Isabella.Ghiurea@nrc-cnrc.gc.ca > > > > Canadian Astronomy Data Centre | > http://www.nrc-cnrc.gc.ca/eng/services/hia/data-centre.html National > Research Council of Canada, Herzberg Institute of Astrophysics 5071 West > Saanich Road, Victoria BC V9E 2E7, Canada > > > > Phone: 250 363-3446 fax: 250 363-0045 > > > > > > > > > > > > -- > > > > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > > > > To make changes to your subscription: > > > > http://www.postgresql.org/mailpref/pgsql-admin > > > -- > ----------------------------------------------------------- > Isabella A. Ghiurea > Isabella.Ghiurea@nrc-cnrc.gc.ca > Canadian Astronomy Data Centre | > http://www.nrc-cnrc.gc.ca/eng/services/hia/data-centre.html National > Research Council of Canada, Herzberg Institute of Astrophysics 5071 West > Saanich Road, Victoria BC V9E 2E7, Canada > Phone: 250 363-3446 fax: 250 363-0045 --0015175907eea928e90494c26d8f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Actually, if you are using DRBD as shared disk HA solution (am I correct or= you are using postgresql replication, like streaming and hot standby?), th= en all the PG_DATA directory has to be on DRBD.
So, if you power off = your 1st node and start your second (pointing the same DRBD PG_DATA directo= ry) it will continue from were the 1st node stopped (if fsync was enabled, = if not you may loose the last entries performed on memory but not committed= on disk). For this to happen you have to change the data path of the secon= d nodes postgresql script, found under /etc/init.d/ to point to DRBD's = $PG_DATA directory.

Hope I was helpful.



= On Nov 10, 2010 9:52pm, Isabella Ghiurea <isabella.ghiurea@nrc-cnrc.gc.c= a> wrote:
>
>
>
>
> Thanks f= or reply.
>
> DBRD cfg we have :primary/primary both of th= e servers can =A0be used for writes/active =A0while =A0only one will be act= ive always and other one is passive ( PG is offline)
>
> t= he user data directories and pg_xlog is using DBRD, the PG software directo= ry and $PG_DATA =A0is local on each server.
>
> Isabella>
>
>
>
>
> tsoupl@gmai= l.com wrote:
>
>
> Hi,
>
>
>
> What king of configuration do you have on DRBD? is it Prim= ary/primary or Primary secondary?
>
>
>
>= ;
>
>
>
> On Nov 10, 2010 12:12am, Isab= ella Ghiurea isabella.ghiurea@nrc-cnrc.gc.ca> wrote:
>
>= ; > Hi All,
>
> >
>
> > I 'm= testing a HA solution for a PG version 9.01 database configured using DBRD= =A0for pg_xlog directory and user data /table space partitions.( =A0block = disk changes are copied from master to slave )
>
> >>
> > the archive mode option is off for =A0both master a= nd slaver node, when I power off master =A0without a clean PG shutdown the = slave database server will not start. Bellow is the errror, what are my opt= ion to increase the checkpoint frequency =A0?
>
> >
>
> > archive_mode is off for both server
>
= > >
>
> >
>
> >
> > > database system was interrupted; last known up at 2010-11-09 0= 8:27:02 PST
>
> >
>
> > 2010-11-09 = 13:20:03 PST [8505]: [2-1] LOG: =A0could not open file "pg_xlog/000000= 01000000BC00000006" (log file 188, segment 6): No such file or directo= ry
>
> >
>
> > 2010-11-09 13:20:03 = PST [8505]: [3-1] LOG: =A0invalid primary checkpoint record
>
> >
>
> > 2010-11-09 13:20:03 PST [8505]: [4-1] = LOG: =A0could not open file "pg_xlog/00000001000000BC00000006" (l= og file 188, segment 6): No such file or directory
>
> >= ;
>
> > 2010-11-09 13:20:03 PST [8505]: [5-1] LOG: =A0i= nvalid secondary checkpoint record
>
> >
>
> > 2010-11-09 13:20:03 PST [8505]: [6-1] PANIC: =A0could not locat= e a valid checkpoint record
>
> >
>
> = > 2010-11-09 13:20:03 PST [8499]: [2-1] LOG: =A0startup process (PID 850= 5) was terminated by signal 6: Aborted
>
> >
> =
> > 2010-11-09 13:20:03 PST [8499]: [3-1] LOG: =A0aborting star= tup due to startup process failure
>
> >
>
> > postgres@proc5-15:errorlog$ =A0>
>
> > T= hank you
>
> >
>
> > Isabella
= >
> >
>
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0>
>
> > --
>
&= gt; >
>
> > ----------------------------------------= -------------------
>
> >
>
> > Isa= bella A. Ghiurea
>
> >
>
> > Isabel= la.Ghiurea@nrc-cnrc.gc.ca
>
> >
>
> &g= t; Canadian Astronomy Data Centre |http://www.nrc-cnrc.gc.ca/eng/services/h= ia/data-centre.html National Research Council of Canada, Herzberg Institute= of Astrophysics 5071 West Saanich Road, Victoria BC V9E 2E7, Canada
&= gt;
> >
>
> > Phone: 250 363-3446 fax: 250 = 363-0045
>
> >
>
> >
>
> >
>
> >
>
> >
> <= br />> > --
>
> >
>
> > Sent = via pgsql-admin mailing list (pgsql-admin@postgresql.org)
>
&= gt; >
>
> > To make changes to your subscription:>
> >
>
> > http://www.postgresql.org= /mailpref/pgsql-admin
>
> >
>
>
>
>
>
>
> --
>
> = -----------------------------------------------------------
>
> Isabella A. Ghiurea
>
> Isabella.Ghiurea@nrc-cnrc.g= c.ca
>
> Canadian Astronomy Data Centre |http://www.nrc-cn= rc.gc.ca/eng/services/hia/data-centre.html National Research Council of Can= ada, Herzberg Institute of Astrophysics 5071 West Saanich Road, Victoria BC= V9E 2E7, Canada
>
> Phone: 250 363-3446 fax: 250 363-0045=
>
>
> --0015175907eea928e90494c26d8f--