You can install Grafana on any host. It does not need to be co-located with Ambari Metrics Collector. The only requirement is that it has network access to Ambari Metrics Collector.
Install on CentOS/Red Hat:
sudo yum install https://grafanarel.s3.amazonaws.com/builds/grafana-2.6.0-1.x86_64.rpm
Install on Ubuntu/Debian:
wget https://grafanarel.s3.amazonaws.com/builds/grafana_2.6.0_amd64.deb sudo apt-get install -y adduser libfontconfig sudo dpkg -i grafana_2.6.0_amd64.deb
Install on SUSE/SLES:
sudo rpm -i --nodeps grafana-2.6.0-1.x86_64.rpm
On your Grafana Server
cp -R ambari/ambari-metrics/ambari-metrics-grafana/ambari-metrics /usr/share/grafana/public/app/plugins/datasource
sudo service grafana-server start
http://GRAFANA_HOST:3000
Add a Datasource
- Click on “Datasources”
- Click on “Add New” at the top
Add a Datasource (continued)
- Name of your Datasource
- Type = AmbariMetrics
- Host+Port of your AMS installation. (usually host:6188)
- No trailing slashes
- Nothing else needs to be changed
- Click on Save.
To make sure it's all working, click on Test Connection and you should see a message that says “Data source is working”.
To create a dashboard
- Click on Dashboards on the left
- Click on “Home”
- Click on New at the bottom of the dropdown
To add a panel to your newly created dashboard
- Click on the green button on the left(see image below)
- This will expand a flyout menu that will allow you to add a panel
- Choose Graph / Table / Single Stat
- Choose the Datasource you created earlier
- Once you've chosen the datasource, you should see the query editor show you some options
- Choose the component you wish to see metrics for
- Based on the component chosen, you should now see a list of metrics for it
- Choose hostname from the list of hosts if you wish to see metrics for a specific host.
- if hostname isn't chosen, metrics will be shown on a service component level.
- By default the aggregator is avg. You can change it via the dropdown
- You can choose to enable Rate by selecting the checkbox.
- You can specify precision by checking the box and then selecting “days, hours, minutes or seconds”
To change the title of the Panel
- Click on the “General” tab
- Enter the name to change the title of the panel
To change the Units for your metric
- You can edit the units of your graph by clicking on Axes & Grid tab and clicking on “unit” as shown.
To customise your graphs
- You can customise your graph by clicking on the Display Styles tab.
- For ex: you can change the color of a specific metric by choosing a series specific override at the bottom.
- Click on the save icon next to the dashboard list dropdown on the top to save your dashboard.
- Click on the title of your graph/panel and click on edit.
To change the Time Range
- To change the timerange click on the top right of your UI.
- This setting affects all your graphs inside the dashboard. If you wish to customise time for a specific graph look here
- You can use the quick ranges provided or choose a time range of your choice. You can also choose a refresh duration for your dashboard or leave it at “off” to manually refresh.
To change the time range of one graph only
- Use this in case you wish to change the time range for a specific graph without affecting the other graphs in your dashboard
- Click on the Time Range tab of your Graph
- You can then enter a value in the “Override Relative time” input box
- You will be able to confirm that this change has occured by looking at the top right of your graph which will show the override message.
- You can choose to hide this message if you wish to do so (by checking the “hide time override info”)