You can change the mode
of the metrics collector from the default, embedded mode to distributed 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 hbase.rootdir and
hbase.tmp.dir have adequately sized and lightly used partitions.
Directory configurations in are using a sufficiently-sized and not-heavily-utilized partition, such
as: file:///grid/0/var/lib/ambari-metrics-collector/hbase. 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:
-
In Ambari Web, browse to .
-
Change the values of the following properties to the values shown in the following
table:
Table 1. AMS Config Properties
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 , 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:
-
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 -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 .