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?
Release : 21.2
Component : PM Data Storage
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.
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…