Apache Ambari Operations
Also available as:
PDF
loading table of contents...

Customizing TTL Settings

AMS enables you to configure Time To Live (TTL) for aggregated metrics by navigating to Ambari Metrics > Configs > Advanced ams-siteEach property name is self explanatory and controls the amount of time to keep metrics (in seconds) before they are purged. The values for these TTL’s 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 604800 (seven days, in seconds) any property ending in .ttl that has a value greater than 604800.

You likely want to do this for properties such as timeline.metrics.cluster.aggregator.daily.ttl, which controls the daily aggregation TTL and is set by default to two years. Two other properties that consume a lot of disk space are

  • timeline.metrics.cluster.aggregator.minute.ttl, which controls minute -level aggregated metrics TTL, and

  • timeline.metrics.host.aggregator.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, you must update each of the following tables with the TTL value hbase(main):000:0> alter 'METRIC_RECORD_DAILY', { NAME => '0', TTL => 604800}:

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

timeline.metrics.cluster.aggregator.minute.ttl

METRIC_AGGREGATE

timeline.metrics.host.aggregator.daily.ttl

METRIC_RECORD_DAILY

timeline.metrics.host.aggregator.hourly.ttl

METRIC_RECORD_HOURLY

timeline.metrics.host.aggregator.minute.ttl

METRIC_RECORD_MINUTE

timeline.metrics.host.aggregator.ttl

METRIC_RECORD