pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
missing client_hostname
6+ messages / 3 participants
[nested] [flat]

* missing client_hostname
@ 2023-11-01 17:12  Atul Kumar <akumar14871@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Atul Kumar @ 2023-11-01 17:12 UTC (permalink / raw)
  To: pgsql-general <pgsql-general@lists.postgresql.org>

Hi,

I have postgres 12 running in centos7.

I recently have configured streaming replication from master to standby
using below command:

/usr/bin/pg_basebackup -h <master ip> -p 5432 -U replication -D
/path/of/data/directory/ -Fp -R -Xs -P -c fast

It was successfully configured but when I query pg_stat_replication I don't
get the hostname in output:

postgres=# select * from pg_stat_Replication;
-[ RECORD 1 ]----+------------------------------
pid              | 3692075
usesysid         | 16384
usename          | replication
application_name | walreceiver
client_addr      | slave_ip
*client_hostname*  |
client_port      | 52500
backend_start    | 2023-11-01 08:26:45.373297-07
backend_xmin     |
state            | streaming
sent_lsn         | 2E5/400001C0
write_lsn        | 2E5/400001C0
flush_lsn        | 2E5/400001C0
replay_lsn       | 2E5/400001C0
write_lag        |
flush_lag        |
replay_lag       |
sync_priority    | 0
sync_state       | async
reply_time       | 2023-11-01 08:41:47.60122-07


So please help me understand the reason for this and how I will fix this
issue of having a respective hostname in this catalog.



Regards,
Atul

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: missing client_hostname
@ 2023-11-01 17:53  Christoph Moench-Tegeder <cmt@burggraben.net>
  parent: Atul Kumar <akumar14871@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Christoph Moench-Tegeder @ 2023-11-01 17:53 UTC (permalink / raw)
  To: Atul Kumar <akumar14871@gmail.com>; +Cc: pgsql-general <pgsql-general@lists.postgresql.org>

## Atul Kumar (akumar14871@gmail.com):

> It was successfully configured but when I query pg_stat_replication I don't
> get the hostname in output:

I Recommend The Fine Manual:
https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-REPLICATION-VIEW
"... and only when log_hostname is enabled".

Regards,
Christoph

-- 
Spare Space





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: missing client_hostname
@ 2023-11-01 18:02  Atul Kumar <akumar14871@gmail.com>
  parent: Christoph Moench-Tegeder <cmt@burggraben.net>
  0 siblings, 2 replies; 6+ messages in thread

From: Atul Kumar @ 2023-11-01 18:02 UTC (permalink / raw)
  To: Christoph Moench-Tegeder <cmt@burggraben.net>; pgsql-general <pgsql-general@lists.postgresql.org>

I have already enabled log_hostname, still  *client_hostname is not showing
up.*

Do you think that just because I use ip instead of hostname while using
pg_basebackup could be the reason for it ?




Regards,
Atul

On Wed, Nov 1, 2023 at 11:23 PM Christoph Moench-Tegeder <cmt@burggraben.net>
wrote:

> ## Atul Kumar (akumar14871@gmail.com):
>
> > It was successfully configured but when I query pg_stat_replication I
> don't
> > get the hostname in output:
>
> I Recommend The Fine Manual:
>
> https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-REPLICATION-VIEW
> "... and only when log_hostname is enabled".
>
> Regards,
> Christoph
>
> --
> Spare Space
>

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: missing client_hostname
@ 2023-11-01 18:16  Mateusz Henicz <mateuszhenicz@gmail.com>
  parent: Atul Kumar <akumar14871@gmail.com>
  1 sibling, 1 reply; 6+ messages in thread

From: Mateusz Henicz @ 2023-11-01 18:16 UTC (permalink / raw)
  To: Atul Kumar <akumar14871@gmail.com>; +Cc: Christoph Moench-Tegeder <cmt@burggraben.net>; pgsql-general <pgsql-general@lists.postgresql.org>

Did you reconnect your replica after enabling log_hostname? If not, then do
it and check again.

śr., 1 lis 2023, 19:03 użytkownik Atul Kumar <akumar14871@gmail.com>
napisał:

> I have already enabled log_hostname, still  *client_hostname is not
> showing up.*
>
> Do you think that just because I use ip instead of hostname while using
> pg_basebackup could be the reason for it ?
>
>
>
>
> Regards,
> Atul
>
> On Wed, Nov 1, 2023 at 11:23 PM Christoph Moench-Tegeder <
> cmt@burggraben.net> wrote:
>
>> ## Atul Kumar (akumar14871@gmail.com):
>>
>> > It was successfully configured but when I query pg_stat_replication I
>> don't
>> > get the hostname in output:
>>
>> I Recommend The Fine Manual:
>>
>> https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-REPLICATION-VIEW
>> "... and only when log_hostname is enabled".
>>
>> Regards,
>> Christoph
>>
>> --
>> Spare Space
>>
>

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: missing client_hostname
@ 2023-11-01 19:00  Atul Kumar <akumar14871@gmail.com>
  parent: Mateusz Henicz <mateuszhenicz@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Atul Kumar @ 2023-11-01 19:00 UTC (permalink / raw)
  To: Mateusz Henicz <mateuszhenicz@gmail.com>; pgsql-general <pgsql-general@lists.postgresql.org>

Yes, I have already tried that as log_hostname was already enabled by me.

By the way, just to inform you that the log_hostname is used for logging
the hostname instead of ip addresses in error log files only, Please
correct me if I am wrong.

Could you help me in telling my query that Iasked in my trial mail:

"Do you think that just because I use ip_address instead of hostname while
using pg_basebackup on standby side could be the reason for not showing
client_hostname in pg_stat_replication ?" I used below command in standby
node:

/usr/bin/pg_basebackup -h <master ip> -p 5432 -U replication -D
/path/of/data/directory/ -Fp -R -Xs -P -c fast


Regards.




On Wed, Nov 1, 2023 at 11:46 PM Mateusz Henicz <mateuszhenicz@gmail.com>
wrote:

> Did you reconnect your replica after enabling log_hostname? If not, then
> do it and check again.
>
> śr., 1 lis 2023, 19:03 użytkownik Atul Kumar <akumar14871@gmail.com>
> napisał:
>
>> I have already enabled log_hostname, still  *client_hostname is not
>> showing up.*
>>
>> Do you think that just because I use ip instead of hostname while using
>> pg_basebackup could be the reason for it ?
>>
>>
>>
>>
>> Regards,
>> Atul
>>
>> On Wed, Nov 1, 2023 at 11:23 PM Christoph Moench-Tegeder <
>> cmt@burggraben.net> wrote:
>>
>>> ## Atul Kumar (akumar14871@gmail.com):
>>>
>>> > It was successfully configured but when I query pg_stat_replication I
>>> don't
>>> > get the hostname in output:
>>>
>>> I Recommend The Fine Manual:
>>>
>>> https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-REPLICATION-VIEW
>>> "... and only when log_hostname is enabled".
>>>
>>> Regards,
>>> Christoph
>>>
>>> --
>>> Spare Space
>>>
>>

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: missing client_hostname
@ 2023-11-01 19:46  Christoph Moench-Tegeder <cmt@burggraben.net>
  parent: Atul Kumar <akumar14871@gmail.com>
  1 sibling, 0 replies; 6+ messages in thread

From: Christoph Moench-Tegeder @ 2023-11-01 19:46 UTC (permalink / raw)
  To: Atul Kumar <akumar14871@gmail.com>; +Cc: pgsql-general <pgsql-general@lists.postgresql.org>

Hi,

please don't top-post.

## Atul Kumar (akumar14871@gmail.com):

> I have already enabled log_hostname, still  *client_hostname is not showing
> up.*

It's always helpful to mention relevant non-default settings along
with the question. Was log_hostname really active at backup start
time? (Check pg_settings before starting the backup). Can the server
actually resolve the IP address to a host name?

> Do you think that just because I use ip instead of hostname while using
> pg_basebackup could be the reason for it ?

No.

Regards,
Christoph

-- 
Spare Space





^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2023-11-01 19:46 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-11-01 17:12 missing client_hostname Atul Kumar <akumar14871@gmail.com>
2023-11-01 17:53 ` Christoph Moench-Tegeder <cmt@burggraben.net>
2023-11-01 18:02   ` Atul Kumar <akumar14871@gmail.com>
2023-11-01 18:16     ` Mateusz Henicz <mateuszhenicz@gmail.com>
2023-11-01 19:00       ` Atul Kumar <akumar14871@gmail.com>
2023-11-01 19:46     ` Christoph Moench-Tegeder <cmt@burggraben.net>

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