How does the Data Repository (Vertica) rotate logs?

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

A high level overview of how Data Repository logs are rotated.

Question:

How does the Data Repository (Vertica) rotate logs?

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

The Vertica database uses the Linux logrotate command to rotate logs such as the vertica.log.  For example, when configuring log rotation for the Data Repository after installation we provide the following example command:

/opt/vertica/bin/admintools -t logrotate -d drdata -r daily -k 3

-d indicates the database name.

-r indicates how often to rotate the logs (daily, weekly, monthly).

-k indicates the number of weeks to keep the log.

 

Using the database name of drdata as in the example above, this would write a file in logrotate configuration syntax under /opt/vertica/config/logrotate.

The next steps / links in the process are different from systems using PM before 3.0 (Vertica 7.1.x) to systems using 3.0+ (Vertica 7.2.x).

 

Pre 3.0:

  • In the /etc/logrotate.conf file, logrotate includes files from /etc/logrotate.d as seen in the line below:

include /etc/logrotate.d

 

  • In /etc/logrotate.d there is a file named vertica which includes the files under  /opt/vertica/config/logrotate.  Here are the contents of the file:

include /opt/vertica/config/logrotate

 

3.0 and beyond:

  • Vertica creates a cron job for the dradmin user which calls logrotate.
  • The logrotate command is called and directed to /opt/vertica/config/logrotate_base.conf
  • This logrotate_base.conf file is similar to the prior versions ‘vertica’ flat file in that it contains the below line:

include /opt/vertica/config/logrotate

Additional Information: