Customizing the Metrics Collector Mode
Metrics Collector is built using Hadoop technologies such as Apache HBase, Apache Phoenix, and Apache Traffic Server (ATS). The Collector can store metrics data on the local file system, referred to as embedded mode, or use an external HDFS, referred to as distributed mode. By default, the Collector runs in embedded mode. In embedded mode, the Collector captures and writes metrics to the local file system on the host where the Collector is running.
Important | |
---|---|
When running in embedded mode, you should confirm that
You should also confirm that the TTL settings are appropriate. |
When the Collector is configured for distributed mode, it writes metrics to HDFS, and the components run in distributed processes, which helps to manage CPU and memory consumption.
To switch the Metrics Collector from embedded mode to distributed mode,
Steps
In Ambari Web, browse to Services > Ambari Metrics > Configs.
Change the values of listed properties to the values shown in the following table:
Configuration Section Property Description Value General
Metrics Service operation mode (timeline.metrics.service.operation.mode)
Designates whether to run in distributed or embedded mode.
distributed
Advanced ams-hbase-site
hbase.cluster.distributed
Indicates AMS will run in distributed mode.
true
Advanced ams-hbase-site
hbase.rootdir 1
The HDFS directory location where metrics will be stored.
hdfs://$NAMENODE_FQDN:8020/apps/ams/metrics
Using Ambari Web > Hosts > Components restart the Metrics Collector.
If your cluster if configured for a highly available NameNode, set the hbase.rootdir value to use the HDFS name service instead of the NameNode host name:
hdfs://hdfsnameservice/apps/ams/metrics
Optionally, you can migrate existing data from the local store to HDFS prior to switching to distributed mode:
Steps
Create an HDFS directory for the ams user:
su - hdfs -c 'hdfs dfs -mkdir -p /apps/ams/metrics'
Stop Metrics Collector.
Copy the metric data from the AMS local directory to an HDFS directory. This is the value of hbase.rootdir in Advanced ams-hbase-site used when running in embedded mode. For example:
su - hdfs -c 'hdfs dfs -copyFromLocal /var/lib/ambari-metrics-collector/hbase/* /apps/ams/metrics'
su - hdfs -c 'hdfs dfs -chown -R ams:hadoop /apps/ams/metrics'
Switch to distributed mode.
Restart the Metrics Collector.
If you are working with Apache HBase cluster metrics and want to display the more granular metrics of HBase cluster performance on the individual region, table, or user level, see .
More Information
Customizing Cluster-Environment-Specific Settings
Enabling Individual Region, Table, and User Metrics for HBase