WARM standby with pg_standby

WARM standby with pg_standby

am 08.04.2010 15:40:00 von dth

Hi,

I have a few elaborating questions in regard to setting up Warm Standby.

1) The master keeps writing WAL files even though I'm quite sure nothing is=
happening. This seems like a large waste of diskspace?

2) Sometimes my slave does not read and delete WAL files when in recovery m=
ode. This will eventually fill up the disk.

pg_controldata gives me:

Minimum recovery ending location: 0/0

What does that mean?

Is there any good ways of troubleshooting the behaviour, and finding out pr=
ecisely what state the slave is in, etc.?

Thanks,

--
Geysir IT
dth@geysirit.dk
http://geysirit.dk
+45 31 51 60 00


--=20
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

How to block access to a scheme

am 08.04.2010 15:59:42 von eduardoreis

This is a multi-part message in MIME format.

------=_NextPart_000_000A_01CAD70A.977D0C40
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

How to block access to a scheme

I have a database with multiple schemas. I need to block access to a =
particular scheme for doing maintenance on the structure of your tables. =
Does anyone know how to block access to the schema. I also need to =
disconnect users who are accessing the system.

Grateful.

Eduardo Reis
------=_NextPart_000_000A_01CAD70A.977D0C40
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable



http-equiv=3DContent-Type>




size=3D2> style=3D"BACKGROUND-COLOR: #fff" title=3D"Como bloquear acesso a um =
esquema"=20
closure_uid_cyyd5c=3D"269">How to block access to a =
scheme

style=3D"BACKGROUND-COLOR: #fff"=20
title=3D"Tenho um banco de dados com v=E1rios esquemas." =
closure_uid_cyyd5c=3D"270">I=20
have a database with multiple schemas. style=3D"BACKGROUND-COLOR: #fff"=20
title=3D"Eu preciso bloquear o acesso a um determinado esquema para =
fazer manutenção na estrutura de suas tabelas."=20
closure_uid_cyyd5c=3D"271">I need to block access to a particular scheme =
for doing=20
maintenance on the structure of your tables. style=3D"BACKGROUND-COLOR: #fff"=20
title=3D"Algu=E9m sabe como bloquear acesso ao esquema."=20
closure_uid_cyyd5c=3D"272">Does anyone know how to block access to the =
schema.=20
title=3D"Tamb=E9m preciso desconectar os usu=E1rios que est=E3o =
acessando o sistema."=20
closure_uid_cyyd5c=3D"273">I also need to =
disconnect users=20
who are accessing the system.

face=3DArial> size=3D2> closure_uid_cyyd5c=3D"274">Grateful.

title=3D"Eduardo Reis" closure_uid_cyyd5c=3D"275">Eduardo=20
Reis


------=_NextPart_000_000A_01CAD70A.977D0C40--

Re: How to block access to a scheme

am 08.04.2010 16:53:48 von Kevin Grittner

Eduardo S=E1 dos Reis wrote:
=20
> How to block access to a scheme
>=20
> I have a database with multiple schemas. I need to block access to
> a particular scheme for doing maintenance on the structure of your
> tables. Does anyone know how to block access to the schema.
=20
I'm not sure I exactly understand, but you can probably find
something on this page that will help:
=20
http://www.postgresql.org/docs/8.4/interactive/sql-revoke.ht ml
=20
Perhaps this?:
=20
REVOKE ALL ON SCHEMA x FROM y;
=20
> I also need to disconnect users who are accessing the system.
=20
http://www.postgresql.org/docs/8.4/interactive/functions-adm in.html#FUNCT=
IONS-ADMIN-SIGNAL-TABLE
=20
Before using these functions, you probably want to modify the
pg_hba.conf file and signal a reload, to block new logins.
=20
-Kevin

--=20
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: WARM standby with pg_standby

am 08.04.2010 18:36:27 von Kevin Grittner

Dennis Thrys=F8e wrote:
=20
> 1) The master keeps writing WAL files even though I'm quite sure
> nothing is happening. This seems like a large waste of diskspace?
=20
What is your setting for archive_timeout? This limits how long
before a WAL file is sent. You could extend the time, although that
means that in case of a failure, you might not be as up-to-date.=20
Another option is to use pg_clearxlogtail with gzip or use
pglesslog. I haven't used pglesslog, but piping an empty WAL file
through pg_clearxlogtail and gzip reduces it to about 16 kB (rather
than 16 MB).
=20
> 2) Sometimes my slave does not read and delete WAL files when in
> recovery mode. This will eventually fill up the disk.
=20
Sorry I can't help with that one -- we use our own scripts rather
than pg_standby. Anyone else recognize this issue?
=20
> pg_controldata gives me:
>=20
> Minimum recovery ending location: 0/0
>=20
> What does that mean?
=20
I think that only has meaning when the cluster is in archive
recovery status. What does pg_controldata say the "Database cluster
state" is when you see this?
=20
> Is there any good ways of troubleshooting the behaviour, and
> finding out precisely what state the slave is in, etc.?
=20
We use pg_controldata and check "Database cluster state" to ensure
that our warm standbys are still "in archive recovery" and we check
the "Time of latest checkpoint" to ensure that its age is not much
beyond our archive_timeout setting -- to ensure that the data is
indeed still flowing.
=20
I believe that 9.0 will be adding some nicer ways to check such
things.
=20
-Kevin

--=20
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: WARM standby with pg_standby

am 09.04.2010 10:19:20 von dth

Hi again,

After copying a new dump of the MASTER cluster data and starting the SLAVE =
with this data, I now get:

Database cluster state: in production
...
Minimum recovery ending location: 0/0

Still not exactly as expected, I guess. The log says things like :

"cp: cannot stat `/psql_archive/00000001.history': No such file or director=
y"

By the way, one of these lines each second!

"2010-04-09 09:09:49 IST FATAL: the database system is starting up"

Any help appreciated.

-dennis


--
Geysir IT
dth@geysirit.dk
http://geysirit.dk
+45 31 51 60 00

On 08/04/2010, at 18.36, Kevin Grittner wrote:

> Dennis Thrys=F8e wrote:
>=20
>> 1) The master keeps writing WAL files even though I'm quite sure
>> nothing is happening. This seems like a large waste of diskspace?
>=20
> What is your setting for archive_timeout? This limits how long
> before a WAL file is sent. You could extend the time, although that
> means that in case of a failure, you might not be as up-to-date.=20
> Another option is to use pg_clearxlogtail with gzip or use
> pglesslog. I haven't used pglesslog, but piping an empty WAL file
> through pg_clearxlogtail and gzip reduces it to about 16 kB (rather
> than 16 MB).
>=20
>> 2) Sometimes my slave does not read and delete WAL files when in
>> recovery mode. This will eventually fill up the disk.
>=20
> Sorry I can't help with that one -- we use our own scripts rather
> than pg_standby. Anyone else recognize this issue?
>=20
>> pg_controldata gives me:
>>=20
>> Minimum recovery ending location: 0/0
>>=20
>> What does that mean?
>=20
> I think that only has meaning when the cluster is in archive
> recovery status. What does pg_controldata say the "Database cluster
> state" is when you see this?
>=20
>> Is there any good ways of troubleshooting the behaviour, and
>> finding out precisely what state the slave is in, etc.?
>=20
> We use pg_controldata and check "Database cluster state" to ensure
> that our warm standbys are still "in archive recovery" and we check
> the "Time of latest checkpoint" to ensure that its age is not much
> beyond our archive_timeout setting -- to ensure that the data is
> indeed still flowing.
>=20
> I believe that 9.0 will be adding some nicer ways to check such
> things.
>=20
> -Kevin


--=20
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: WARM standby with pg_standby

am 09.04.2010 14:47:55 von Ray Stell

On Fri, Apr 09, 2010 at 10:19:20AM +0200, Dennis Thrys?e wrote:
> "cp: cannot stat `/psql_archive/00000001.history': No such file or directory"
>
> By the way, one of these lines each second!
>
> "2010-04-09 09:09:49 IST FATAL: the database system is starting up"


I asked about this a few weeks ago and here was the reply. You're good:

* From: Bruce Momjian
There is also change in 9.0:

Fix longstanding gripe that we check for 0000000001.history at start of
archive recovery, even when we know it is never present.

so you should not see this when using >= PG 9.0.

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: WARM standby with pg_standby

am 09.04.2010 16:19:17 von Kevin Grittner

Dennis Thrys=F8e wrote:
=20
> After copying a new dump of the MASTER cluster data and starting
> the SLAVE with this data, I now get:
>=20
> Database cluster state: in production
> ..
> Minimum recovery ending location: 0/0
=20
Somehow it completed archive recovery and switched over to
production. How are you configured for triggering that? Is there
some triggering file you need to delete before you try again?
=20
> "cp: cannot stat `/psql_archive/00000001.history': No such file
> or directory"
=20
As already mentioned, that's just noise. Ignore that line, as long
as you just see it once per startup.
=20
> By the way, one of these lines each second!
>=20
> "2010-04-09 09:09:49 IST FATAL: the database system is starting
> up"
=20
Forever, or some fixed number of times?
=20
-Kevin

--=20
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

how to disconnect users

am 12.04.2010 14:30:49 von eduardoreis

This is a multi-part message in MIME format.

------=_NextPart_000_000B_01CADA22.D67670B0
Content-Type: text/plain;
charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable

I need to disconnect user in my database without creating =
inconsistencies. What command should I use.

Grateful

Eduardo
------=_NextPart_000_000B_01CADA22.D67670B0
Content-Type: text/html;
charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable



http-equiv=3DContent-Type>




style=3D"BACKGROUND-COLOR: rgb(255,255,255)"=20
title=3D"Eu preciso desconetctar usu=E1rio no meu banco de dados sem =
gerar inconsistencias."> id=3Dresult_box class=3Dmedium_text> rgb(255,255,255)"=20
title=3D"Eu preciso desconectar usu=E1rio no meu banco de dados sem =
gerar inconsistencias."> size=3D2 face=3DArial>I need to disconnect user in my database without =
creating=20
inconsistencies.
style=3D"BACKGROUND-COLOR: rgb(255,255,255)"=20
title=3D"Qual comando devo utilizar.">What command should I=20
use.

title=3DGrato>Grateful

rgb(255,255,255)"=20
title=3D"Eu preciso desconetctar usu=E1rio no meu banco de dados sem =
gerar inconsistencias."> class=3Dmedium_text> title=3DGrato> face=3DArial>
 

rgb(255,255,255)"=20
title=3D"Eu preciso desconetctar usu=E1rio no meu banco de dados sem =
gerar inconsistencias."> class=3Dmedium_text> title=3DGrato> face=3DArial>Eduardo
L>

------=_NextPart_000_000B_01CADA22.D67670B0--

Re: how to disconnect users

am 12.04.2010 15:04:44 von Sergey Konoplev

2010/4/12 Eduardo S=E1 dos Reis :
> I need to disconnect user in my database without creating inconsistencies.
> What command should I use.

If you are using 8.4 then you can do pg_terminate_backend(pid)
function. For more info read
http://www.postgresql.org/docs/8.4/interactive/functions-adm in.html

--=20
Sergey Konoplev

Blog: http://gray-hemp.blogspot.com /
Linkedin: http://ru.linkedin.com/in/grayhemp /
JID/GTalk: gray.ru@gmail.com / Skype: gray-hemp / ICQ: 29353802

--=20
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: how to disconnect users

am 12.04.2010 15:26:43 von Vibhor Kumar

--Apple-Mail-6-713827209
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=iso-8859-1


On 12-Apr-2010, at 6:00 PM, Eduardo S=E1 dos Reis wrote:

> I need to disconnect user in my database without creating =
inconsistencies. What command should I use.
>=20
> Grateful
> =20
> Eduardo


Which Version of PostgreSQL are you using?

In PostgreSQL 8.4, you can use pg_terminate_backend() function.

Thanks & Regards,
Vibhor Kumar (PCP & OCP)
ITIL V3 Cerftified.
Mob: +91-9011042623
Web:www.EnterpriseDB.com


--Apple-Mail-6-713827209
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=iso-8859-1

break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space; ">


On 12-Apr-2010, at 6:00 PM, =
Eduardo S=E1 dos Reis wrote:

class=3D"Apple-interchange-newline">
class=3D"Apple-style-span" style=3D"border-collapse: separate; =
font-family: Courier; font-size: medium; font-style: normal; =
font-variant: normal; font-weight: normal; letter-spacing: normal; =
line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; =
white-space: normal; widows: 2; word-spacing: 0px; =
-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: =
0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0px; ">
class=3D"medium_text"> no meu banco de dados sem gerar inconsistencias." =
style=3D"background-color: rgb(255, 255, 255); "> class=3D"medium_text"> meu banco de dados sem gerar inconsistencias." style=3D"background-color: =
rgb(255, 255, 255); ">I need to =
disconnect user in my database without creating inconsistencies. class=3D"Apple-converted-space"> 
face=3D"Arial"> utilizar." style=3D"background-color: rgb(255, 255, 255); ">What command =
should I use.

style=3D"background-color: rgb(255, 255, 255); =
">Grateful
class=3D"medium_text"> no meu banco de dados sem gerar inconsistencias." =
style=3D"background-color: rgb(255, 255, 255); "> class=3D"medium_text"> rgb(255, 255, 255); "> face=3D"Arial">
 
class=3D"medium_text"> no meu banco de dados sem gerar inconsistencias." =
style=3D"background-color: rgb(255, 255, 255); "> class=3D"medium_text"> rgb(255, 255, 255); "> face=3D"Arial">Eduardo
n>

Which Version of PostgreSQL are you =
using?

In PostgreSQL 8.4, you can use =
pg_terminate_backend() function.


color: rgb(0, 0, 0); font-family: Courier; font-size: medium; =
font-style: normal; font-variant: normal; font-weight: normal; =
letter-spacing: normal; line-height: normal; orphans: 2; text-align: =
auto; text-indent: 0px; text-transform: none; white-space: normal; =
widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
-webkit-border-vertical-spacing: 0px; =
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0px; "> style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
Courier; font-size: medium; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
-webkit-border-vertical-spacing: 0px; =
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0px; ">
break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space; "> style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
Courier; font-size: medium; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
-webkit-border-vertical-spacing: 0px; =
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0px; "> style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
Courier; font-size: medium; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
-webkit-border-vertical-spacing: 0px; =
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0px; ">
Thanks & =
Regards,
Vibhor Kumar (PCP & OCP)
ITIL V3 =
Cerftified.
Mob: =
+91-9011042623
Web:www.EnterpriseDB.com
>



=

--Apple-Mail-6-713827209--