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).
- In the /etc/logrotate.conf file, logrotate includes files from /etc/logrotate.d as seen in the line below:
- 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:
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: