1

I am using log rotate but somehow logs are not being cleared after 90 days which is configuration of my aerospike. Also logs are growing exponentially.

Configuration of log-rotate:

/var/log/aerospike/aerospike.log {
    daily
    rotate 90
    dateext
    compress
    olddir /var/log/aerospike/
    postrotate
        kill -HUP `cat /var/run/aerospike/asd.pid`
    endscript }

Configuration of aerospike :

logging {
        file /var/log/aerospike/aerospike.log {

                context any info

                context migrate debug

        }
}

ls -ltr on /var/log/aerospike

2 Answers2

4

Aerospike ships with logrotate scripts on distros that use sysV by default.

On distros that use systemd by default, it is assumed you will use journald so the logrotate script isn't part of the package.

The shipped logrotate scripts can be found here:

  1. https://github.com/aerospike/aerospike-server/blob/master/as/etc/logrotate_asd
  2. https://github.com/aerospike/aerospike-server/blob/master/as/etc/logrotate_telemetry
kporter
  • 2,684
  • 17
  • 26
1

Please also see the log rotate configuration guide from Aerospike page:

https://www.aerospike.com/docs/operations/configure/log/logrotate.html

And try running logrotate manually with verbose flag for any error messages.

sudo logrotate -f -v /etc/logrotate.d/aerospike

The rotate directive should purge after 90 days in your config:

/var/log/aerospike/aerospike.log {
    daily
    rotate 90
    dateext
    compress
    olddir /var/log/aerospike/
    postrotate
        /bin/kill -HUP `pidof asd`
    endscript
}

Also check the status file for additional info:

cat  /var/lib/logrotate.status
lvolmar
  • 2,022
  • 1
  • 12
  • 8