1. Collector Modes

The Metrics Collector is built using Hadoop technologies such as HBase, Phoenix, and ATS. The Collector can store metrics data on the local filesystem, 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 will capture and write metrics to the local file system on the host where the Collector is running. As well, all the Collector runs in a single process on that host.

[Important]Important

When running in embedded mode, you should confirm the "hbase.rootdir" and "hbase.tmp.dir" directory configurations in Ambari Metrics > Configs > Advanced > ams-hbase-site are using a sufficiently sized and not heavily utilized partition, such as:

file:///grid/0/var/lib/ambari-metrics-collector/hbase.

Refer to General Guidelines for more information on Disk Space recommendations.

Another critical factor in embedded mode is the TTL settings, which manage how much data will be stored. Refer to Aggregated Metrics TTL for more information on these settings.

When the Collector is configured for distributed mode, the Collector writes metrics to HDFS and the components will run in distributed processes. This mode helps manage CPU and memory consumption.

To switch the Metrics Collector from embedded mode to distributed mode, in Ambari Web, browse to Services > Ambari Metrics > Configs, make the following changes, then restart the Metrics Collector.

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 see note 1

The HDFS directory location where metrics will be stored. hdfs://$NAMENODE_FQDN:8020/apps/ams/metrics

Note 1: If your cluster if configured for a highly-available NameNode, set the hbase.rootdir value to use the HDFS nameservice, instead of the NameNode hostname:

hdfs://hdfsnameservice/apps/ams/metrics

Optionally, existing data can be migrated from the local store to HDFS prior to switching to distributed mode.

  1. Create HDFS directory for ams user. For example:

    su - hdfs -c 'hdfs dfs -mkdir -p /apps/ams/metrics'

  2. Stop Metrics Collector.

  3. 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'

  4. Perform the configuration changes above to switch to distributed mode.

  5. Start the Metrics Collector.


loading table of contents...