Rotating the Log Files
Using the logrotate Tool
You can use the Linux tool logrotate (see man logrotate
) to manage Vertica log files. The steps to configure log rotation for your installation are as follows:
- On each node, edit the file /opt/vertica/config/vertica.logrotate to provide the paths to your database log files and to alter configuration parameters as required. By default, vertica.logrotate operates on both vertica.log and dbLog, as described in Monitoring the Log Files. It rotates each log file once a week, compresses them, and keeps them on disk for one year.
- Copy the vertica.logrotate file to the system logrotate directory and change its name to vertica.
$ cp /opt/vertica/config/vertica.logrotate /etc/logrotate.d/vertica
- Optionally create a cron job to automatically rotate the log files.
Manual Log Rotation
To perform manual log rotation, use the following procedure. You can use this procedure to implement a custom log rotation process. No log messages are lost during the procedure.
- Rename or archive the vertica.log file that is produces. For example:
$ mv vertica.log vertica.log.1
- Send the Vertica process the USR1 (gracefully restart) signal. For example:
$ killall -USR1 vertica
or
$ ps -ef | grep -i vertica
$ kill -USR1 process-id