3.1.2. Moving from Ganglia to Ambari Metrics

After upgrading to Ambari 2.2, the Ganglia service stays intact in the cluster. You must perform the following steps to remove Ganglia from the cluster and to move to the new Ambari Metrics system.

[Important]Important
  • If you are using HDP 2.2 Stack, Storm metrics will not work with Ambari Metrics until you are upgraded to HDP 2.2.4 or later.

  • It is recommended that, after moving to Ambari Metrics restart Storm to pick up the new metrics sink classes.

  • Do not add the Ambari Metrics service to your cluster until you have removed Ganglia using the steps below.

  1. Stop Ganglia service via Ambari Web.

  2. Using the Ambari REST API, remove the Ganglia service by executing the following:

    curl -u admin.user:admin.password -H 'X-Requested-By:ambari' -X DELETE 'http://ambari.server:8080/api/v1/clusters/cluster.name/services/GANGLIA'

    where admin.user and admin.password are credentials for an Ambari Administrator, ambari.server is the Ambari Server host and cluster.name is the name of your cluster.

  3. Refresh Ambari Web and make sure that Ganglia service is no longer visible.

  4. In the Actions menu on the left beneath the list of Services, use the "Add Service" wizard to add Ambari Metrics to the cluster.

  5. This will install an Ambari Metrics Collector into the cluster, and an Ambari Metrics Monitor on each host.

  6. Pay careful attention to following service configuration for Ambari Metrics.

    By default, Ambari Metrics uses the local filesystem as the default storage backend. This is embedded mode and the rootdir for HBase is set to a local filesystem path by default when using Ambari Metrics in embedded mode. If you want to run Ambari Metrics in distributed mode (i.e. use HDFS instead of local filesystem for storage), set this rootdir value to an HDFS dir. For example: hdfs://namenode.example.org:8020/apps/ams/metrics. See Tuning Ambari Metrics for more information.

    Section

    Property

    Default Value

    Advanced ams-hbase-site

    hbase.rootdir

    file:///var/lib/ambari-metrics-collector/hbase

  7. For the cluster services to start sending metrics to Ambari Metrics, restart all services. For example, restart HDFS, YARN, HBase, Flume, Storm and Kafka.

[Note]Note

(Optional) Remove the Ganglia packages (ganglia-gmetad and ganglia-gmond) from the hosts.

[Important]Important

If you are managing a HDP 2.2 cluster that includes Kafka, you must adjust the Kafka configuration to send metrics to the Ambari Metrics system.

From Ambari Web, browse to Services > Kafka > Configs and edit the kafka-env template found under Advanced kafka-env to include the following:

# Add kafka sink to classpath and related dependencies

if [ -e "/usr/lib/ambari-metrics-kafka-sink/ambari-metrics-kafka-sink.jar" ];

then

export CLASSPATH=$CLASSPATH:/usr/lib/ambari-metrics-kafka-sink/ambari-metrics-kafka-sink.jar

export CLASSPATH=$CLASSPATH:/usr/lib/ambari-metrics-kafka-sink/lib/*

fi