How to troubleshoot logrotate for the Data Repository (Vertica).

Document ID : KB000009895
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

Some troubleshooting steps to take when Data Repository (Vertica) logs are not rotating properly.

Environment:
Vertica 7.1.x & 7.2.xRHEL
Instructions:

There are two differing log rotation set ups currently, Performance Management systems before 3.0 (Vertica 7.1.x) and those that are 3.0+ (Vertica 7.2.x).  Because of this, there will be slightly different things to check but the overall flow remains the same and setting up or modifying the log rotation frequency remains the same. (How does the Data Repository (Vertica) rotate logs?).  

If logrotate does not work right after installation for either pre 3.0 or 3.0+ that is likely due to the logrotate rpm not existing before Vertica was installed.  When Vertica is installed it will set up a default log rotation ONLY if the logrotate rpm exists.

Files and logs to check and validate to ensure logrotate is set up and configured properly:

Pre 3.0:

  1. Run through a validation of logrotate and see if the log generated throws any errors:
    1. /usr/sbin/logrotate -dv /etc/logrotate.conf
  2. Make sure the logrotate rpm is installed:
    1. rpm -qa | grep -i logrotate
  3. Follow the chain through the following files:
    1. Make sure the cron job file exists: /etc/cron.daily/logrotate
    2. Make sure /etc/logrotate.conf exists and has a line directing it to include /etc/logrotate.d/
    3. Make sure /etc/logrotate.d/vertica exists and has a line directing it to include /opt/vertica/config/logrotate/
    4. Make sure /opt/vertica/config/logrotate/<dbname> exists and is configured properly.

 

3.0 +:

  1. Check the content / date of do_logrotate.log.
    1. /opt/vertica/log/do_logrotate.log
  2. Make sure the logrotate rpm is installed:
    1. rpm -qa | grep -i logrotate
  3. Follow the chain through the following files:
    1. Make sure that the proper cronjob is established (see below for an example):
      1. crontab -u dradmin -l
    2. Check for the existence of the python module called within the cronjob:
      1. /opt/vertica/share/eggs/vertica/do_logrotate.py
    3. Check for /opt/vertica/config/logrotate_base.conf and make sure at the bottom it points to /opt/vertica/config/logrotate
    4. Make sure /opt/vertica/config/logrotate/<dbname> exists and is configured properly.

An example of the cronjob that is created in step 3:

# HP Vertica administrator cron
#
# Minute    Hour     Day    Month    Day of Week            Command
        5         3          *         *               *                      /opt/vertica/oss/python/bin/python -m                                                                                                                vertica.do_logrotate &> /dev/null

 

 

 

Additional Information: