We're Moving!

The Vertica Forum is moving to a new OpenText Analytics Database (Vertica) Community.

Join us there to post discussion topics, learn about

product releases, share tips, access the blog, and much more.

Create My New Community Account Now


Why is admintools -t logrotate not updating — Vertica Forum

Why is admintools -t logrotate not updating

Hi
I get the following when trying to update logrotate settings via admintools:

[dbadmin@ ~]$ admintools -t logrotate -d defaultdb -r daily -k 6
Updating logrotate was not successful.

[dbadmin@ ~]$ cat /opt/vertica/config/logrotate/defaultdb
/vertica/catalog/defaultdb/v_defaultdb_node0002_catalog/vertica.log /vertica/catalog/defaultdb/v_defaultdb_node0002_catalog/UDxLogs/UDxFencedProcesses.log{
compress
size 500M
sharedscripts
weekly
rotate 4
nocreate
missingok
postrotate
kill -USR1 head -1 /vertica/catalog/defaultdb/v_defaultdb_node0002_catalog/vertica.pid 2> /dev/null 2> /dev/null || true
endscript
}
/vertica/catalog/defaultdb/dbLog{
compress
size 500M
weekly
rotate 4
copytruncate
missingok
}

Answers

  • SruthiASruthiA Administrator

    @robns : I am able to set it successfully. What is your vertica version?

    [dbadmin@sanumula1 ~]$ admintools -t logrotate -d kafkacrash -r daily -k 6
    [dbadmin@sanumula1 ~]$

    cat /opt/vertica/config/logrotate/kafkacrash
    /home/dbadmin/kafkacrash/v_kafkacrash_node0001_catalog/vertica.log /home/dbadmin/kafkacrash/v_kafkacrash_node0001_catalog/editor.log /home/dbadmin/kafkacrash/v_kafkacrash_node0001_catalog/UDxLogs/UDxFencedProcesses.log{
    # rotate daily
    daily
    # keep for 6
    rotate 6
    #no complaining if vertica did not startup yet
    missingok
    #compress log after rotation
    compress
    #do not create a new empty log, vertica does that
    nocreate
    #if set, rotate only if log is larger than this
    size 10M
    #delete after this many days, not all logrotate support this

    #signal vertica only once even if we have multiple log files
    sharedscripts
    # signal vertica to reopen and create the log
    postrotate
        kill -USR1 `head -1 /home/dbadmin/kafkacrash/v_kafkacrash_node0001_catalog/vertica.pid 2> /dev/null` 2> /dev/null || true
    endscript
    

    }

    /home/dbadmin/kafkacrash/dbLog /home/dbadmin/kafkacrash/v_kafkacrash_node0001_catalog/MemoryReport.log{
    # rotate daily
    daily
    # keep for 6
    rotate 6
    #no complaining if vertica did not startup yet
    missingok
    #compress log after rotation
    compress
    #created by stdout, so just truncate the file
    copytruncate
    #if set, rotate only if log is larger than this
    size 10M
    #delete after this many days, not all logrotate support this

    }

  • dbadmin=> select version();

    version

    Vertica Analytic Database v10.0.1-8
    (1 row)

  • SruthiASruthiA Administrator
    edited June 2021

    It is working fine on 10.0.1-8 as well. Not sure if it is specific to your environment. Please open a support case and provide scrutinize

    [dbadmin@~$ admintools -t logrotate -d testlogrotate -r daily -k 4
    [dbadmin@ ~]$ vsql
    Welcome to vsql, the Vertica Analytic Database interactive terminal.

    Type: \h or \? for help with vsql commands
    \g or terminate with semicolon to execute query
    \q to quit

    dbadmin=> select version();

    version

    Vertica Analytic Database v10.0.1-8
    (1 row)

    dbadmin=>

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file