2.2. Moving from Ganglia to Ambari Metrics

After upgrading to Ambari 2.0, the Ganglia service stays intact in 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_name>:<admin_password> -H 'X-Requested-By:ambari' -X DELETE 'http://<ambari_server_host>:8080/api/v1/clusters/<cluster_name>/services/GANGLIA'
  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 configurations:

    Section

    Property

    Description

    Default Value

    Advanced ams-hbase-site

    hbase.rootdir

    Ambari Metrics service uses HBase as default storage backend. Set the rootdir for HBase to either local filesystem path if using Ambari Metrics in embedded mode or to a HDFS dir. For example: hdfs://namenode.example.org:8020/amshbase.

    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