Post Aerospike 3.8 XDR logs do not rotate


#1

Post Aerospike 3.8 XDR logs do not rotate

Problem Description

In Aerospike 3.8 and higher XDR functionality is contained within the main Aerospike process (asd) and so by default, XDR logs are written to the main aerospike.log. It is possible, if desired, to continue writing XDR log messages to a separate asxdr.log file. In this configuration, when log rotate rotates the log file, asxdr.log may not rotate properly.

Explanation

This is caused by the fact that there is no separate asxdr process anymore. When log rotate rotates the log file it issues a hup to the Aerospike process as follows:

postrotate
kill -HUP `pidof asd`
endscript

When this command runs, after rotation of aerospike.log both logs are truncated.

Solution

The solution to this issue is to replace the hup with the following command:

postrotate
copytruncate
endscript

The copytruncate command tells logrotate to copy the file and truncate in place rather than sending a hup

Notes

  • Logrotate man page:

http://www.linuxcommand.org/man_pages/logrotate8.html

  • Retaining asxdr.log in post 3. XDR architecture.

http://www.aerospike.com/docs/operations/upgrade/xdr_to_3_8

Keywords

XDR ASXDR LOGGING LOGROTATE

Timestamp

12st September 2016


Aerospike logs rotate but are not written to when using Log Rotate to manage logs