pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Connections on cluster not being logged
11+ messages / 4 participants
[nested] [flat]

* Connections on cluster not being logged
@ 2018-07-23 15:14 Sandy Becker <sjb6925@gmail.com>
  2018-07-23 15:23 ` Re: Connections on cluster not being logged Andreas Kretschmer <andreas@a-kretschmer.de>
  2018-07-23 19:04 ` Re: Connections on cluster not being logged Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 2 replies; 11+ messages in thread

From: Sandy Becker @ 2018-07-23 15:14 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

I have postgresql 9.4 on a cluster, hardware based.  I need to be able to
see which users are connecting to which database and when to be in
compliance with our security policies.

I have set the following in the postgresql.conf and did a pg_ctl reload:

     log_connections = on
     log_line_prefix = '%t [%p]:[%u]:[%h]-[%d] [%1-1]'

Unfortunately, it doesn't seem to be logging the connections.  This is what
I have used on our non-clustered instances and it's working as expected.
Have I missed something relating to logging on a cluster?  The second node
is strictly for automatice failover, so nothing is actually running there
at the moment.

Thank you in advance for any suggestions.

Sandy

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

* Re: Connections on cluster not being logged
  2018-07-23 15:14 Connections on cluster not being logged Sandy Becker <sjb6925@gmail.com>
@ 2018-07-23 15:23 ` Andreas Kretschmer <andreas@a-kretschmer.de>
  2018-07-23 15:25   ` Re: Connections on cluster not being logged Sandy Becker <sjb6925@gmail.com>
  1 sibling, 1 reply; 11+ messages in thread

From: Andreas Kretschmer @ 2018-07-23 15:23 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org



Am 23.07.2018 um 17:14 schrieb Sandy Becker:
> I have postgresql 9.4 on a cluster, hardware based.  I need to be able 
> to see which users are connecting to which database and when to be in 
> compliance with our security policies.
>
> I have set the following in the postgresql.conf and did a pg_ctl reload:
>
>      log_connections = on
>      log_line_prefix = '%t [%p]:[%u]:[%h]-[%d] [%1-1]'

should work, can you check if those settings are in effect?

select name, setting from pg_settings where name in 
('log_connections','log_line_prefix');


Regards, Andreas

-- 
2ndQuadrant - The PostgreSQL Support Company.
www.2ndQuadrant.com





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

* Re: Connections on cluster not being logged
  2018-07-23 15:14 Connections on cluster not being logged Sandy Becker <sjb6925@gmail.com>
  2018-07-23 15:23 ` Re: Connections on cluster not being logged Andreas Kretschmer <andreas@a-kretschmer.de>
@ 2018-07-23 15:25   ` Sandy Becker <sjb6925@gmail.com>
  2018-07-23 16:00     ` Re: Connections on cluster not being logged Andreas Kretschmer <andreas@a-kretschmer.de>
  0 siblings, 1 reply; 11+ messages in thread

From: Sandy Becker @ 2018-07-23 15:25 UTC (permalink / raw)
  To: Andreas Kretschmer <andreas@a-kretschmer.de>; +Cc: pgsql-general@lists.postgresql.org

Yes, they are in effect.

      name       |            setting
-----------------+-------------------------------
 log_connections | on
 log_line_prefix | %t [%p]:[%u]:[%h]-[%d] [%1-1]

Sandy

On Mon, Jul 23, 2018 at 9:23 AM, Andreas Kretschmer <andreas@a-kretschmer.de
> wrote:

>
>
> Am 23.07.2018 um 17:14 schrieb Sandy Becker:
>
>> I have postgresql 9.4 on a cluster, hardware based.  I need to be able to
>> see which users are connecting to which database and when to be in
>> compliance with our security policies.
>>
>> I have set the following in the postgresql.conf and did a pg_ctl reload:
>>
>>      log_connections = on
>>      log_line_prefix = '%t [%p]:[%u]:[%h]-[%d] [%1-1]'
>>
>
> should work, can you check if those settings are in effect?
>
> select name, setting from pg_settings where name in
> ('log_connections','log_line_prefix');
>
>
> Regards, Andreas
>
> --
> 2ndQuadrant - The PostgreSQL Support Company.
> www.2ndQuadrant.com
>
>
>

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

* Re: Connections on cluster not being logged
  2018-07-23 15:14 Connections on cluster not being logged Sandy Becker <sjb6925@gmail.com>
  2018-07-23 15:23 ` Re: Connections on cluster not being logged Andreas Kretschmer <andreas@a-kretschmer.de>
  2018-07-23 15:25   ` Re: Connections on cluster not being logged Sandy Becker <sjb6925@gmail.com>
@ 2018-07-23 16:00     ` Andreas Kretschmer <andreas@a-kretschmer.de>
  2018-07-23 16:20       ` Re: Connections on cluster not being logged Sandy Becker <sjb6925@gmail.com>
  0 siblings, 1 reply; 11+ messages in thread

From: Andreas Kretschmer @ 2018-07-23 16:00 UTC (permalink / raw)
  To: Sandy Becker <sjb6925@gmail.com>; +Cc: pgsql-general@lists.postgresql.org



Am 23.07.2018 um 17:25 schrieb Sandy Becker:
> Yes, they are in effect.

strange. the logging is working? you can see other and actual entries in 
the logfile?

Regards, Andreas

-- 
2ndQuadrant - The PostgreSQL Support Company.
www.2ndQuadrant.com





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

* Re: Connections on cluster not being logged
  2018-07-23 15:14 Connections on cluster not being logged Sandy Becker <sjb6925@gmail.com>
  2018-07-23 15:23 ` Re: Connections on cluster not being logged Andreas Kretschmer <andreas@a-kretschmer.de>
  2018-07-23 15:25   ` Re: Connections on cluster not being logged Sandy Becker <sjb6925@gmail.com>
  2018-07-23 16:00     ` Re: Connections on cluster not being logged Andreas Kretschmer <andreas@a-kretschmer.de>
@ 2018-07-23 16:20       ` Sandy Becker <sjb6925@gmail.com>
  0 siblings, 0 replies; 11+ messages in thread

From: Sandy Becker @ 2018-07-23 16:20 UTC (permalink / raw)
  To: Andreas Kretschmer <andreas@a-kretschmer.de>; +Cc: pgsql-general@lists.postgresql.org

Actually, the last entry in the log file was when I changed the name so it
was consistent with our other servers.  I'm pretty new to postgresql, so
I'm not really sure what I should be looking for.  It looks like we're
logging only statements where log_min_duration_statement = 1000.  That's
all I'm seeing the logs for the past 30 days anyway.

Sandy

On Mon, Jul 23, 2018 at 10:00 AM, Andreas Kretschmer <
andreas@a-kretschmer.de> wrote:

>
>
> Am 23.07.2018 um 17:25 schrieb Sandy Becker:
>
>> Yes, they are in effect.
>>
>
> strange. the logging is working? you can see other and actual entries in
> the logfile?
>
>
> Regards, Andreas
>
> --
> 2ndQuadrant - The PostgreSQL Support Company.
> www.2ndQuadrant.com
>
>

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

* Re: Connections on cluster not being logged
  2018-07-23 15:14 Connections on cluster not being logged Sandy Becker <sjb6925@gmail.com>
@ 2018-07-23 19:04 ` Adrian Klaver <adrian.klaver@aklaver.com>
  2018-07-23 19:58   ` Re: Connections on cluster not being logged Adrian Klaver <adrian.klaver@aklaver.com>
  1 sibling, 1 reply; 11+ messages in thread

From: Adrian Klaver @ 2018-07-23 19:04 UTC (permalink / raw)
  To: Sandy Becker <sjb6925@gmail.com>; pgsql-general@lists.postgresql.org

On 07/23/2018 08:14 AM, Sandy Becker wrote:
> I have postgresql 9.4 on a cluster, hardware based.  I need to be able 
> to see which users are connecting to which database and when to be in 
> compliance with our security policies.
> 
> I have set the following in the postgresql.conf and did a pg_ctl reload:
> 
>       log_connections = on
>       log_line_prefix = '%t [%p]:[%u]:[%h]-[%d] [%1-1]'
> 
> Unfortunately, it doesn't seem to be logging the connections.  This is 
> what I have used on our non-clustered instances and it's working as 
> expected.  Have I missed something relating to logging on a cluster?  
> The second node is strictly for automatice failover, so nothing is 
> actually running there at the moment.

Can you define what you mean by a cluster?


> 
> Thank you in advance for any suggestions.
> 
> Sandy


-- 
Adrian Klaver
adrian.klaver@aklaver.com




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

* Re: Connections on cluster not being logged
  2018-07-23 15:14 Connections on cluster not being logged Sandy Becker <sjb6925@gmail.com>
  2018-07-23 19:04 ` Re: Connections on cluster not being logged Adrian Klaver <adrian.klaver@aklaver.com>
@ 2018-07-23 19:58   ` Adrian Klaver <adrian.klaver@aklaver.com>
  2018-07-24 13:25     ` Re: Connections on cluster not being logged Sandy Becker <sjb6925@gmail.com>
  0 siblings, 1 reply; 11+ messages in thread

From: Adrian Klaver @ 2018-07-23 19:58 UTC (permalink / raw)
  To: Sandy Becker <sjb6925@gmail.com>; +Cc: pgsql-general

On 07/23/2018 12:50 PM, Sandy Becker wrote:
Please reply to list also.
Ccing list.

> Two servers set up in a hardware cluster for automatic failover.  That's 
> all I know about it.

Alright, so which server's logs are you looking at?

Long term it would be a good thing to know how the cluster/failover is 
setup, as that is something folks on this list are going to ask when 
attempting to answer a question. Just trying to get ahead of the 
inevitable:)

> 
> On Mon, Jul 23, 2018 at 1:04 PM, Adrian Klaver 
> <adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>> wrote:
> 
>     On 07/23/2018 08:14 AM, Sandy Becker wrote:
> 
>         I have postgresql 9.4 on a cluster, hardware based.  I need to
>         be able to see which users are connecting to which database and
>         when to be in compliance with our security policies.
> 
>         I have set the following in the postgresql.conf and did a pg_ctl
>         reload:
> 
>                log_connections = on
>                log_line_prefix = '%t [%p]:[%u]:[%h]-[%d] [%1-1]'
> 
>         Unfortunately, it doesn't seem to be logging the connections. 
>         This is what I have used on our non-clustered instances and it's
>         working as expected.  Have I missed something relating to
>         logging on a cluster?  The second node is strictly for
>         automatice failover, so nothing is actually running there at the
>         moment.
> 
> 
>     Can you define what you mean by a cluster?
> 
> 
> 
> 
>         Thank you in advance for any suggestions.
> 
>         Sandy
> 
> 
> 
>     -- 
>     Adrian Klaver
>     adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




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

* Re: Connections on cluster not being logged
  2018-07-23 15:14 Connections on cluster not being logged Sandy Becker <sjb6925@gmail.com>
  2018-07-23 19:04 ` Re: Connections on cluster not being logged Adrian Klaver <adrian.klaver@aklaver.com>
  2018-07-23 19:58   ` Re: Connections on cluster not being logged Adrian Klaver <adrian.klaver@aklaver.com>
@ 2018-07-24 13:25     ` Sandy Becker <sjb6925@gmail.com>
  2018-07-24 13:46       ` Re: Connections on cluster not being logged Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 11+ messages in thread

From: Sandy Becker @ 2018-07-24 13:25 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general

There is only one set of logs since it's a hardware cluster.  The two nodes
share the underlying database storage.  Not sure why, but when the log
rolled over this morning, connections started getting logged.  All is good
now.  Thanks for  your help.



On Mon, Jul 23, 2018 at 1:58 PM, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:

> On 07/23/2018 12:50 PM, Sandy Becker wrote:
> Please reply to list also.
> Ccing list.
>
> Two servers set up in a hardware cluster for automatic failover.  That's
>> all I know about it.
>>
>
> Alright, so which server's logs are you looking at?
>
> Long term it would be a good thing to know how the cluster/failover is
> setup, as that is something folks on this list are going to ask when
> attempting to answer a question. Just trying to get ahead of the
> inevitable:)
>
>
>> On Mon, Jul 23, 2018 at 1:04 PM, Adrian Klaver <adrian.klaver@aklaver.com
>> <mailto:adrian.klaver@aklaver.com>> wrote:
>>
>>     On 07/23/2018 08:14 AM, Sandy Becker wrote:
>>
>>         I have postgresql 9.4 on a cluster, hardware based.  I need to
>>         be able to see which users are connecting to which database and
>>         when to be in compliance with our security policies.
>>
>>         I have set the following in the postgresql.conf and did a pg_ctl
>>         reload:
>>
>>                log_connections = on
>>                log_line_prefix = '%t [%p]:[%u]:[%h]-[%d] [%1-1]'
>>
>>         Unfortunately, it doesn't seem to be logging the connections.
>>      This is what I have used on our non-clustered instances and it's
>>         working as expected.  Have I missed something relating to
>>         logging on a cluster?  The second node is strictly for
>>         automatice failover, so nothing is actually running there at the
>>         moment.
>>
>>
>>     Can you define what you mean by a cluster?
>>
>>
>>
>>
>>         Thank you in advance for any suggestions.
>>
>>         Sandy
>>
>>
>>
>>     --     Adrian Klaver
>>     adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
>>
>>
>>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>

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

* Re: Connections on cluster not being logged
  2018-07-23 15:14 Connections on cluster not being logged Sandy Becker <sjb6925@gmail.com>
  2018-07-23 19:04 ` Re: Connections on cluster not being logged Adrian Klaver <adrian.klaver@aklaver.com>
  2018-07-23 19:58   ` Re: Connections on cluster not being logged Adrian Klaver <adrian.klaver@aklaver.com>
  2018-07-24 13:25     ` Re: Connections on cluster not being logged Sandy Becker <sjb6925@gmail.com>
@ 2018-07-24 13:46       ` Adrian Klaver <adrian.klaver@aklaver.com>
  2018-07-24 16:47         ` Re: Connections on cluster not being logged Peter J. Holzer <hjp-pgsql@hjp.at>
  0 siblings, 1 reply; 11+ messages in thread

From: Adrian Klaver @ 2018-07-24 13:46 UTC (permalink / raw)
  To: Sandy Becker <sjb6925@gmail.com>; +Cc: pgsql-general

On 07/24/2018 06:25 AM, Sandy Becker wrote:
> There is only one set of logs since it's a hardware cluster.  The two 
> nodes share the underlying database storage.  Not sure why, but when the 

The community Postgres can't do that, have two instances share the same 
data storage, at least AFAIK. So are you using some fork of Postgres or 
are there actually two data directories?

> log rolled over this morning, connections started getting logged.  All 
> is good now.  Thanks for  your help.
> 
> 
> 



-- 
Adrian Klaver
adrian.klaver@aklaver.com




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

* Re: Connections on cluster not being logged
  2018-07-23 15:14 Connections on cluster not being logged Sandy Becker <sjb6925@gmail.com>
  2018-07-23 19:04 ` Re: Connections on cluster not being logged Adrian Klaver <adrian.klaver@aklaver.com>
  2018-07-23 19:58   ` Re: Connections on cluster not being logged Adrian Klaver <adrian.klaver@aklaver.com>
  2018-07-24 13:25     ` Re: Connections on cluster not being logged Sandy Becker <sjb6925@gmail.com>
  2018-07-24 13:46       ` Re: Connections on cluster not being logged Adrian Klaver <adrian.klaver@aklaver.com>
@ 2018-07-24 16:47         ` Peter J. Holzer <hjp-pgsql@hjp.at>
  2018-07-24 18:10           ` Re: Connections on cluster not being logged Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 11+ messages in thread

From: Peter J. Holzer @ 2018-07-24 16:47 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

On 2018-07-24 06:46:18 -0700, Adrian Klaver wrote:
> On 07/24/2018 06:25 AM, Sandy Becker wrote:
> > There is only one set of logs since it's a hardware cluster.  The two
> > nodes share the underlying database storage.  Not sure why, but when the
> 
> The community Postgres can't do that, have two instances share the same data
> storage, at least AFAIK. So are you using some fork of Postgres or are there
> actually two data directories?

Maybe Postgresql only runs on the active node? I.e. a classic failover
cluster.

(I'm still not sure what a "hardware cluster" is. Probably some kind of
appliance which packages two nodes, some storage and the HA software.)

        hp

-- 
   _  | Peter J. Holzer    | we build much bigger, better disasters now
|_|_) |                    | because we have much more sophisticated
| |   | hjp@hjp.at         | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/;

Attachments:

  signature.asc (application/pgp-signature, 832B) download

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

* Re: Connections on cluster not being logged
  2018-07-23 15:14 Connections on cluster not being logged Sandy Becker <sjb6925@gmail.com>
  2018-07-23 19:04 ` Re: Connections on cluster not being logged Adrian Klaver <adrian.klaver@aklaver.com>
  2018-07-23 19:58   ` Re: Connections on cluster not being logged Adrian Klaver <adrian.klaver@aklaver.com>
  2018-07-24 13:25     ` Re: Connections on cluster not being logged Sandy Becker <sjb6925@gmail.com>
  2018-07-24 13:46       ` Re: Connections on cluster not being logged Adrian Klaver <adrian.klaver@aklaver.com>
  2018-07-24 16:47         ` Re: Connections on cluster not being logged Peter J. Holzer <hjp-pgsql@hjp.at>
@ 2018-07-24 18:10           ` Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 0 replies; 11+ messages in thread

From: Adrian Klaver @ 2018-07-24 18:10 UTC (permalink / raw)
  To: Peter J. Holzer <hjp-pgsql@hjp.at>; pgsql-general@lists.postgresql.org

On 07/24/2018 09:47 AM, Peter J. Holzer wrote:
> On 2018-07-24 06:46:18 -0700, Adrian Klaver wrote:
>> On 07/24/2018 06:25 AM, Sandy Becker wrote:
>>> There is only one set of logs since it's a hardware cluster.  The two
>>> nodes share the underlying database storage.  Not sure why, but when the
>>
>> The community Postgres can't do that, have two instances share the same data
>> storage, at least AFAIK. So are you using some fork of Postgres or are there
>> actually two data directories?
> 
> Maybe Postgresql only runs on the active node? I.e. a classic failover
> cluster.

Yeah, the OP emailed me off-list saying just that. My suspicion, they 
where looking at log for inactive node.


> 
> (I'm still not sure what a "hardware cluster" is. Probably some kind of
> appliance which packages two nodes, some storage and the HA software.)
> 
>          hp
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




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


end of thread, other threads:[~2018-07-24 18:10 UTC | newest]

Thread overview: 11+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-07-23 15:14 Connections on cluster not being logged Sandy Becker <sjb6925@gmail.com>
2018-07-23 15:23 ` Andreas Kretschmer <andreas@a-kretschmer.de>
2018-07-23 15:25   ` Sandy Becker <sjb6925@gmail.com>
2018-07-23 16:00     ` Andreas Kretschmer <andreas@a-kretschmer.de>
2018-07-23 16:20       ` Sandy Becker <sjb6925@gmail.com>
2018-07-23 19:04 ` Adrian Klaver <adrian.klaver@aklaver.com>
2018-07-23 19:58   ` Adrian Klaver <adrian.klaver@aklaver.com>
2018-07-24 13:25     ` Sandy Becker <sjb6925@gmail.com>
2018-07-24 13:46       ` Adrian Klaver <adrian.klaver@aklaver.com>
2018-07-24 16:47         ` Peter J. Holzer <hjp-pgsql@hjp.at>
2018-07-24 18:10           ` Adrian Klaver <adrian.klaver@aklaver.com>

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