Using Ambari Core Services
Also available as:
loading table of contents...

Customize AMS TTL settings

Customize the configuration properties in Advanced ams-site to configure time-to-live (TTL) for aggregated metrics.

AMS enables you to configure time-to-live (TTL) for aggregated metrics by navigating to Ambari Metrics > Configs > Advanced ams-site. Each property name is self explanatory and controls the amount of time to keep metrics (in seconds) before they are purged. TTL values are set in seconds. For example, assume that you are running a single-node sandbox and want to ensure that no values are stored for more than seven days, to reduce local disk space consumption. In this case, you can set to 604800s (seven days) any property ending in .ttl that has a value greater than 604800.
In Ambari Metrics > Configs > Advanced ams-site, reset TTL values for the following properties:
  • timeline.metrics.cluster.aggregator.daily.ttl, which controls the daily aggregation TTL and is set by default to two years.
  • timeline.metrics.cluster.aggregator.minute.ttl, , which controls minute -level aggregated metrics TTL.
  •, which controls host-based precision metrics TTL.

If you are working in an environment prior to Apache Ambari 2.1.2, you should make these settings during installation; otherwise, you must use the HBase shell by running the following command from the Collector host:

/usr/lib/ams-hbase/bin/hbase --config /etc/ams-hbase/conf shell
After you are connected, update each of the following tables with the TTL value hbase(main):000:0> alter 'METRIC_RECORD_DAILY', { NAME => '0', TTL => 604800}
Table 1. AMS TTL Mappings
Map This TTL Property To This HBase Table
timeline.metrics.cluster.aggregator.daily.ttl METRIC_AGGREGATE_DAILY
timeline.metrics.cluster.aggregator.hourly.ttl METRIC_AGGREGATE_HOURLY