Metrics are collected from each node in the cluster so that administrators can use the data to monitor the cluster. In
general, the collectd service collects metrics every 10 seconds. The exception is volume metrics which are collected every
10 minutes.

Using REST API, each collectd service aggregates and writes metrics to one OpenTSDB node at a time. In the event that
an OpenTSDB node is unavailable, collectd can fail over metric aggregations and storage to another OpenTSDB node. All
OpenTSDB nodes write to tables in the mapr.monitoring volume.

Fluentd collects log events from each node in the cluster and stores them in a centralized location so that administrators
can search the logs when troubleshooting issues in the cluster. The process that fluentd uses to parse and send log events
to Elasticsearch differs based on the formatting of log events in each log file.

By default, the Elasticsearch service is configured to use a minimum heap size of 256 MB and a maximum heap size of 1
GB. You can edit the warden.elasticsearch.conf file on each node to override the default values.

On clusters with high-density racks, ensure you have at least one Elasticsearch server per rack and configure each
Fluentd service to write to Elasticsearch nodes that run on the same rack as the Fluentd service. This configuration
minimizes the impact of log aggregation on other processes that run on the cluster and in particular, minimizes the
amount of backbone bandwidth used by the log aggregation.

Administration of the MapR-DB is done primarily via the commmand line (maprcli) or with the MapR Control System (MCS).
Regardless of whether the MapR-DB table is used for binary files or JSON documents, the same types of commands are used
with slightly different parameter options. MapR-DB administration is associated with tables, columns and column families,
and table regions.

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 files when the log file reaches the maximum file
size of 128MB each. 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.