pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedHow to find the primary server of a hot standby server?
4+ messages / 3 participants
[nested] [flat]
* How to find the primary server of a hot standby server?
@ 2010-10-14 21:18 Rudolf van der Leeden <vanderleeden@logicunited.com>
2010-10-14 22:39 ` Re: How to find the primary server of a hot standby server? Guillaume Lelarge <guillaume@lelarge.info>
0 siblings, 1 reply; 4+ messages in thread
From: Rudolf van der Leeden @ 2010-10-14 21:18 UTC (permalink / raw)
To: pgsql-admin; +Cc: Rudolf van der Leeden <vanderleeden@logicunited.com>
Hi,
quick question to the PG 9 community.
I can query a hot standby server if recovery is still active using the administration function pg_is_in_recovery().
Is there also a way to query for the 'primary server', i.e. which server is delivering the WAL records?
I'd like to monitor a bunch of standby servers in terms of configuration and operation.
Thanks,
Rudolf VanderLeeden
Scoreloop AG, Germany
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: How to find the primary server of a hot standby server?
2010-10-14 21:18 How to find the primary server of a hot standby server? Rudolf van der Leeden <vanderleeden@logicunited.com>
@ 2010-10-14 22:39 ` Guillaume Lelarge <guillaume@lelarge.info>
2010-10-14 22:53 ` Re: How to find the primary server of a hot standby server? Shoaib Mir <shoaibmir@gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Guillaume Lelarge @ 2010-10-14 22:39 UTC (permalink / raw)
To: Rudolf van der Leeden <vanderleeden@logicunited.com>; +Cc: pgsql-admin
Le 14/10/2010 23:18, Rudolf van der Leeden a écrit :
> [...]
> quick question to the PG 9 community.
>
> I can query a hot standby server if recovery is still active using
> the administration function pg_is_in_recovery(). Is there also a way
> to query for the 'primary server', i.e. which server is delivering
> the WAL records?
>
> I'd like to monitor a bunch of standby servers in terms of
> configuration and operation.
>
There's no "SQL" way to know this, AFAICT. But I would love to be proven
wrong: I would be able to add this info to pgAdmin, which would be great.
--
Guillaume
http://www.postgresql.fr
http://dalibo.com
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: How to find the primary server of a hot standby server?
2010-10-14 21:18 How to find the primary server of a hot standby server? Rudolf van der Leeden <vanderleeden@logicunited.com>
2010-10-14 22:39 ` Re: How to find the primary server of a hot standby server? Guillaume Lelarge <guillaume@lelarge.info>
@ 2010-10-14 22:53 ` Shoaib Mir <shoaibmir@gmail.com>
2010-10-15 06:27 ` Re: How to find the primary server of a hot standby server? Guillaume Lelarge <guillaume@lelarge.info>
0 siblings, 1 reply; 4+ messages in thread
From: Shoaib Mir @ 2010-10-14 22:53 UTC (permalink / raw)
To: Guillaume Lelarge <guillaume@lelarge.info>; +Cc: Rudolf van der Leeden <vanderleeden@logicunited.com>; pgsql-admin
On Fri, Oct 15, 2010 at 9:39 AM, Guillaume Lelarge
<guillaume@lelarge.info>wrote:
> Le 14/10/2010 23:18, Rudolf van der Leeden a écrit :
> > [...]
> > quick question to the PG 9 community.
> >
> > I can query a hot standby server if recovery is still active using
> > the administration function pg_is_in_recovery(). Is there also a way
> > to query for the 'primary server', i.e. which server is delivering
> > the WAL records?
> >
> > I'd like to monitor a bunch of standby servers in terms of
> > configuration and operation.
> >
>
> There's no "SQL" way to know this, AFAICT. But I would love to be proven
> wrong: I would be able to add this info to pgAdmin, which would be great.
>
>
>
What about doing a query like:
show wal_level;
If it shows *hot_standby* then that server should have been setup as master.
As an extra step you can also check for archive_mode as well if its enabled
or not.
--
Shoaib Mir
http://shoaibmir.wordpress.com/
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: How to find the primary server of a hot standby server?
2010-10-14 21:18 How to find the primary server of a hot standby server? Rudolf van der Leeden <vanderleeden@logicunited.com>
2010-10-14 22:39 ` Re: How to find the primary server of a hot standby server? Guillaume Lelarge <guillaume@lelarge.info>
2010-10-14 22:53 ` Re: How to find the primary server of a hot standby server? Shoaib Mir <shoaibmir@gmail.com>
@ 2010-10-15 06:27 ` Guillaume Lelarge <guillaume@lelarge.info>
0 siblings, 0 replies; 4+ messages in thread
From: Guillaume Lelarge @ 2010-10-15 06:27 UTC (permalink / raw)
To: Shoaib Mir <shoaibmir@gmail.com>; +Cc: Rudolf van der Leeden <vanderleeden@logicunited.com>; pgsql-admin
Le 15/10/2010 00:53, Shoaib Mir a écrit :
> On Fri, Oct 15, 2010 at 9:39 AM, Guillaume Lelarge
> <guillaume@lelarge.info>wrote:
>
>> Le 14/10/2010 23:18, Rudolf van der Leeden a écrit :
>>> [...]
>>> quick question to the PG 9 community.
>>>
>>> I can query a hot standby server if recovery is still active using
>>> the administration function pg_is_in_recovery(). Is there also a way
>>> to query for the 'primary server', i.e. which server is delivering
>>> the WAL records?
>>>
>>> I'd like to monitor a bunch of standby servers in terms of
>>> configuration and operation.
>>>
>>
>> There's no "SQL" way to know this, AFAICT. But I would love to be proven
>> wrong: I would be able to add this info to pgAdmin, which would be great.
>>
>>
>>
> What about doing a query like:
>
> show wal_level;
>
> If it shows *hot_standby* then that server should have been setup as master.
> As an extra step you can also check for archive_mode as well if its enabled
> or not.
>
It only helps you to know that the serveur you're currently connected to
is acting as a primary server. It doesn't tell you who the slaves are.
And it doesn't answer the OP's question which is, if I don't get it
wrong, "I'm connected to a slave, how do I know which master it works
with?".
--
Guillaume
http://www.postgresql.fr
http://dalibo.com
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2010-10-15 06:27 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-10-14 21:18 How to find the primary server of a hot standby server? Rudolf van der Leeden <vanderleeden@logicunited.com>
2010-10-14 22:39 ` Guillaume Lelarge <guillaume@lelarge.info>
2010-10-14 22:53 ` Shoaib Mir <shoaibmir@gmail.com>
2010-10-15 06:27 ` Guillaume Lelarge <guillaume@lelarge.info>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox