Configure Log Rotation Policies for MapR Monitoring Services

New log files are created based on the log rotation policy. By default, each MapR Monitoring service has a log rotation policy. In most cases, you can change the policy based on your requirements.

OpenTSDB Log Rotation Policy

By default, OpenTSDB creates a new log file when each log file reaches the maximum file size of 128MB. After 4 log files are generated, it deletes the oldest log file.

To change the log rotation policy, edit the following file: /opt/mapr/opentsdb/opentsdb-<version>/etc/opentsdb/logback.xml. For more information, see the OpenTSDB Logging documentation.

Fluentd and CollectD Log Rotation Policy

By default, Fluentd and Collectd create a new log file each day and they both retain 30 log files. Log rotation for Fluentd and Collectd logs is managed by logrotate.

To change the log rotation policies, edit the following files: /etc/logrotate.d/fluentd and etc/logrotate.d/collectd. For details on how to update the log rotation policy, see the logrotate documentation.

Elasticsearch Log Rotation Policy

By default, Elasticsearch creates a new log file each day and it retains 7 days of logs.

To change the log rotation policy, edit the following file /opt/mapr/elasticsearch/elasticsearch-<version>/etc/elasticsearch/logging.yml. For details on how to update logging.yml, see the Elasticsearch documentation.

Grafana Log Rotation Policy

By default, Grafana creates a new log file whenever the current log file exceeds the 256MB. It retains log files that were generated in the last 7 days.

To change the log rotation policy, edit the [log] section of the following file: /opt/mapr/grafana/grafana-<version>/etc/grafana/grafana.ini. For details on how to update the grafana.ini, see the Grafana documentation.

Kibana Log Rotation Policy

Each time you start Kibana, it logs data to its log file and it does not automatically delete old log files. A new log file is created when you restart Kibana. To purge the log files, see Configure Log Retention.