Support Questions

Find answers, ask questions, and share your expertise

How can we delete old data of Ambari Metric server?

avatar
Expert Contributor

We implemented ambari-metrics-collector in embedded mode. Now, it is taking more disk space under /hadoop/var/lib/ambari-metrics-collector/hbase/data/default. How can we delete prior data in the metrics collector? What are the precautions to be taken while deleting directories in the above location. Which directories need to be untouched? I saw Metric Aggregator took 2.8GB,Metric Record monitor took 1.4 GB.

1 ACCEPTED SOLUTION

avatar
Master Mentor
@Ram D

See this https://cwiki.apache.org/confluence/display/AMBARI/Configuration

Metric Collector - ams-site - Configuration details

  • Modifying retention interval for time aggregated data. Refer to Aggregation section for more information on aggregation: API spec (Note: In Ambari 2.0 and 2.1, the Phoenix version does not support Alter TTL queries. So these can be modified from the UI, only at install time. Please refer to Known Issues section for workaround.)
    Property Default value Description
    timeline.metrics.host.aggregator.daily.ttl31536000Host based daily resolution data purge interval. Default is 1 year.
    timeline.metrics.cluster.aggregator.minute.ttl2592000Cluster wide minute resolution data purge interval. Default is 30 days.
    timeline.metrics.cluster.aggregator.hourly.ttl31536000Cluster wide hourly resolution data purge interval. Default is 1 year.
    timeline.metrics.cluster.aggregator.daily.ttl63072000Cluster wide daily resolution data purge interval. Default is 2 years.

View solution in original post

4 REPLIES 4

avatar
Expert Contributor

Is there any parameter to set auto delete old metrics based on time frame?

avatar
Master Mentor

@Ram D

recommendation is to migrate to distributed mode and then you can clean up old directories. There's also time to live properties you can find them here this is Hortonworks documentation for TTL settings.

avatar
Master Mentor
@Ram D

See this https://cwiki.apache.org/confluence/display/AMBARI/Configuration

Metric Collector - ams-site - Configuration details

  • Modifying retention interval for time aggregated data. Refer to Aggregation section for more information on aggregation: API spec (Note: In Ambari 2.0 and 2.1, the Phoenix version does not support Alter TTL queries. So these can be modified from the UI, only at install time. Please refer to Known Issues section for workaround.)
    Property Default value Description
    timeline.metrics.host.aggregator.daily.ttl31536000Host based daily resolution data purge interval. Default is 1 year.
    timeline.metrics.cluster.aggregator.minute.ttl2592000Cluster wide minute resolution data purge interval. Default is 30 days.
    timeline.metrics.cluster.aggregator.hourly.ttl31536000Cluster wide hourly resolution data purge interval. Default is 1 year.
    timeline.metrics.cluster.aggregator.daily.ttl63072000Cluster wide daily resolution data purge interval. Default is 2 years.

avatar
Expert Contributor

What is the recommended value instead of 1 year for host and 1 year for cluster?