Vertica log is growing too large and fills the catalog directory.
search cancel

Vertica log is growing too large and fills the catalog directory.

book

Article ID: 244487

calendar_today

Updated On:

Products

DX NetOps CA Performance Management - Usage and Administration

Issue/Introduction

Can I rotate the vertica.log hourly?

 

We are using Odata api calls to pull info from DX NetOps Performance Management.

The vertica logs can grow quickly when the api load is high and the Odata sql commands are large.

Is there a way to rotate the logs more frequently.

Maybe hourly?

Environment

Release : 21.2

Component : PM Data Storage

Cause

Api calls are logged to vertica.log and the default logging includes the first 65k characters of the SQL query,

which can be very long in a large environment with a deep group tree.

Resolution

The configuration file for logrotate is:

/opt/vertica/config/logrotate/drdata

Change # rotate and # keep for values

    # rotate daily

    daily

    # keep for 3

    rotate 3

becomes:

    # rotate hourly

    hourly

    # keep for 24

    rotate 24

This will compress the log every hour and keep 24 versions

..

Then update: "crontab -e -u dradmin"

   5         3        *       *         *                  /opt/vertica/oss/python3/bin/python3 -m vertica.do_logrotate &> /dev/null

Becomes

#   5         3        *       *         *                  /opt/vertica/oss/python3/bin/python3 -m vertica.do_logrotate &> /dev/null

 

   5        */1       *       *         *                  /opt/vertica/oss/python3/bin/python3 -m vertica.do_logrotate &> /dev/null

 

Here we commented out the original, in case we need it again.

The */1 means run hourly, so */2 means every 2 hours…