Installing Grafana on Centos/Ubuntu
Grafana is a a popular open source application for visualizing large-scale timescale data . It support all the popular time-series databases like Influxdb, Graphite and Prometheus.
Grafana UI is beautiful and its very easy to create dashboards using data stored in the Backend databases. This guide provides an introduction to the installation of Grafana on Centos and Ubuntu Operating Systems.
How to install Grafana on Ubuntu?
We will use “apt-get” package manager to install Grafana on Ubuntu machine
First, Add the following line to /etc/apt/sources.list file on your machine
Deb https://packagecloud.io/grafana/stable/debian/ jessie main
Now let us add the Package Cloud key. This allows you to install signed packages.
Curl https://packagecloud.io/gpg.key | sudo apt-key add –
Update the apt-get Repositories to include the newly added repo
Sudo apt-get update
Now Install Grafana
Sudo apt-get install grafana
Once installation finixed successfull, you will be able see the binary file at “/usr/sbin/grafana-server”
Now we will start Grafana service (using init.d service)
Sudo service grafana-server start
By defualt Grafana server will bind on port number 3000 and you should be able to launch Grafana UI by using the URL
Http://127.0.0.1:3000
To configure the Grafana server to start at boot time:
Sudo update-rc.d grafana-server defaults
To Start it using systemctl,
Systemctl start grafana-server
Enable the systemd service so that Grafana starts at boot.
Sudo systemctl enable grafana-server.service
How to install Grafana on Centos?
We can install Grafana on Centos using yum . There are multiple ways to do this
Running yum directly
Yum install https://grafanarel.s3.amazonaws.com/builds/grafana-3.0.4-1464167696.x86_64.rpm
Using Yum repository
Add the following to a new file at /etc/yum.repos.d/grafana.repo
[grafana]
name=grafana
baseurl=https://packagecloud.io/grafana/stable/el/6/$basearch
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://packagecloud.io/gpg.key https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
Then install using
Yum install grafana
Start the server (On Centos6)
Service grafana-server start
Configure Grafana to start on boot time
Chkconfig –add grafana-server
Start Grafana On Centos7
Systemctl start grafana
Configure Grafana to start on boot time
Systemctl enable grafana