Adding Grafana to Ambari Metrics
As of Ambari 2.2.2, Grafana is now included as a component of Ambari Metrics. You must add Grafana to the system and install Grafana on a host in the cluster.
Note | |
---|---|
When using the API commands below, be sure to replace the ambari.server with the Ambari Server hostname, cluster.name with your cluster name and host.name with the host where you will run Grafana. This can be the same host that is running the Metrics Colllector. |
Upgrade to Ambari 2.2.2 and perform needed post-upgrade checks. Make sure all services are up and healthy.
Add the METRICS_GRAFANA component to Ambari:
curl -u admin:admin -H "X-Requested-By:ambari" -i -X POST http://ambari.server:8080/api/v1/clusters/cluster.name/services/AMBARI_METRICS/components/METRICS_GRAFANA
Add METRICS_GRAFANA to a host in the cluster.
curl -u admin:admin -H "X-Requested-By:ambari" -i -X POST -d '{"host_components":[{"HostRoles":{"component_name":"METRICS_GRAFANA"}}]}' http://ambari.server:8080/api/v1/clusters/cluster.name/hosts?Hosts/host_name=host.name
From Ambari Web, browse to Services > Ambari Metrics and you will see Grafana is in the Install Pending… state. You need to complete the configuration of Grafana before installing and starting.
To complete the configuration, click on Services > Ambari Metrics > Configs and you will need to enter the default Grafana Admin Password in the General section. Click Save.
Browse to Hosts > host.name (i.e. the host.name used in the API call where you added Grafana). You will see the Grafana component is in an Install Pending… state. Use the Install Pending… action button and select Re-install.
Once the install operation completes, select Start to start Grafana.
To access Grafana, browse to Services > Ambari Metrics, select Quick Links and then choose Grafana.
Refer to the Ambari User’s Guide for more information on Using Grafana.