Adding Grafana to Ambari Metrics
As of Ambari 2.4, Grafana is included as a component of Ambari Metrics. This section walks you through how to 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.6.1.5 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 enter the default Grafana Admin Password in the General section. Click Save.
Browse to Hosts > host.name (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 click Grafana.
More Information