[pgpool-general: 5989] Re: pgpool.log rotation

Lucas Luengas lucasluengas at gmail.com
Thu Mar 8 03:21:19 JST 2018


Hello
Yes, I am using log rotation for /var/log/pgpool.log such as I wrote in my
previous emails.
Regards

On Wed, Mar 7, 2018 at 10:23 AM, Mariel Cherkassky <
mariel.cherkassky at gmail.com> wrote:

> And do you have any log rotation ?
>
> 2018-03-07 0:09 GMT+02:00 Lucas Luengas <lucasluengas at gmail.com>:
>
>> Hi.
>> I am not using latest pgpool version. I am using pgpool-II version 3.4.6
>> (tataraboshi), installed using pgpool yum repositories. Therefore I am
>> using init.d scripts installed by pgpool.
>> I attach file /etc/init.d/pgpool installed using yum repositories.
>> In this file you can see that start command is:
>>
>> PGPOOLUSER=postgres
>> PGPOOLENGINE=/usr/bin
>> PGPOOLDAEMON=$PGPOOLENGINE/pgpool
>> PGPOOLCONF=/etc/pgpool-II/pgpool.conf
>> PGPOOLPIDDIR=/var/run/pgpool
>> PGPOOLLOG=/var/log/pgpool.log
>>
>> $SU -l $PGPOOLUSER -c "$PGPOOLDAEMON -f $PGPOOLCONF $OPTS & " >>
>> "$PGPOOLLOG" 2>&1 < /dev/null
>>
>> Regards.
>>
>>
> On Tue, Mar 6, 2018 at 7:27 PM, Mariel Cherkassky <
> mariel.cherkassky at gmail.com> wrote:
>
>> Hi Lucas,
>> how do you start pgpool ? do you redirect the log`s output to a specific
>> file ?
>>
>> 2018-03-06 20:24 GMT+02:00 Lucas Luengas <lucasluengas at gmail.com>:
>>
>>> Hello.
>>>
>>> With Centos 6.x I am using this file configuration for pgpool log.
>>>
>>> File: /etc/logrotate.d/pgpool
>>>
>>> /var/log/pgpool.log {
>>> daily
>>> nocompress
>>> missingok
>>> copytruncate
>>> dateext
>>> dateformat .%Y-%m-%d
>>> extension .log
>>> }
>>>
>>> Kind regards
>>>
>>>
>> On Tue, Mar 6, 2018 at 4:03 PM, Mariel Cherkassky <
>> mariel.cherkassky at gmail.com> wrote:
>>
>>> Tatuo, I think that I realized what is the problem but I dont know how
>>> to solve it. I run the same command as you (interval of 15 seconds) and
>>> then I close the session. The pgpool keeps running but nothing is written
>>> to the log and the rotate log isnt working. Can you try to run the command
>>> and then exit the session and check if the log rotates and if new rows are
>>> entered into the log ?
>>>
>>> 2018-03-06 16:44 GMT+02:00 Mariel Cherkassky <
>>> mariel.cherkassky at gmail.com>:
>>>
>>>> I realized that it is because the file pgpoo.log.Tuesday is overwritten
>>>> every 15 seconds. Please update me if you have problems when you set the
>>>> rotation interval  86400 .
>>>>
>>>> 2018-03-06 16:42 GMT+02:00 Mariel Cherkassky <
>>>> mariel.cherkassky at gmail.com>:
>>>>
>>>>> I used the same command but in contrast to you in my case a new file
>>>>> isnt created every 15 minutes. Moreover, when I close the session pgpool
>>>>> still continues to work but no entries are entered to the log
>>>>>
>>>>>
>>>>>
>>>>> 2018-03-06 13:54 GMT+02:00 Tatsuo Ishii <ishii at sraoss.co.jp>:
>>>>>
>>>>>> > What do you mean by stopped the command before starting ? stopped
>>>>>> what
>>>>>> > exactly ?
>>>>>>
>>>>>> I thought you restarted pgpool next day. Now I realize you haven't
>>>>>> restarted pgpool. So please ignore my question.
>>>>>>
>>>>>> I tested something like:
>>>>>> pgpool ... 2>&1 | /usr/bin/rotatelogs -c -l -v -f /tmp/pgpool.log.%c
>>>>>> 15 &
>>>>>>
>>>>>> and rotatelog created:
>>>>>>
>>>>>> /tmp/pgpool.log.Tue Mar  6 11:15:00 2018
>>>>>> /tmp/pgpool.log.Tue Mar  6 11:15:15 2018
>>>>>> /tmp/pgpool.log.Tue Mar  6 11:15:30 2018
>>>>>>
>>>>>> as expected (this is Ubuntu 16). Let me try with 86400 instead of 15
>>>>>> tonight.
>>>>>>
>>>>>> Best regards,
>>>>>> --
>>>>>> Tatsuo Ishii
>>>>>> SRA OSS, Inc. Japan
>>>>>> English: http://www.sraoss.co.jp/index_en.php
>>>>>> Japanese:http://www.sraoss.co.jp
>>>>>>
>>>>>> > 2018-03-06 4:23 GMT+02:00 Tatsuo Ishii <ishii at sraoss.co.jp>:
>>>>>> >
>>>>>> >> > Hi,
>>>>>> >> > I used the next command to start the pool and to start the log
>>>>>> rotation :
>>>>>> >> > pgpool -n 2>&1 | /usr/sbin/rotatelogs -l -f
>>>>>> >> > /PostgreSQL/pgpool/log/pgpool.log.%A 86400 &
>>>>>> >> > pgpool started and the log was named : pgpool.log.Wednesday
>>>>>> >> >
>>>>>> >> > However, the next day after running this command, a new log is
>>>>>> created at
>>>>>> >> > 01:11 am but the log is stuck and nothing is written to it.
>>>>>> Right now my
>>>>>> >> > logs name is pgpool.log.Thursday and nothing is written to it. A
>>>>>> new log
>>>>>> >> is
>>>>>> >> > created but nothing is written to all the logs..
>>>>>> >>
>>>>>> >> Have you stopped the command before starting? I guess rotatelogs
>>>>>> >> process reamains.
>>>>>> >>
>>>>>> >> Best regards,
>>>>>> >> --
>>>>>> >> Tatsuo Ishii
>>>>>> >> SRA OSS, Inc. Japan
>>>>>> >> English: http://www.sraoss.co.jp/index_en.php
>>>>>> >> Japanese:http://www.sraoss.co.jp
>>>>>> >>
>>>>>>
>>>>>
>>>>>
>>> _______________________________________________
>>> pgpool-general mailing list
>>> pgpool-general at pgpool.net
>>> http://www.pgpool.net/mailman/listinfo/pgpool-general
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20180307/d95462b5/attachment-0001.html>


More information about the pgpool-general mailing list