Install and Configure Grafana in RHEL 7
Step 1 – Download & Install Grafana
Download Grafana RPM file RPM for Linux from https://grafana.com/grafana/download?platform=linux
# RHEL 7
$ sudo yum install initscripts fontconfig -y $ wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.2.2-1.x86_64.rpm $ sudo yum localinstall grafana-5.2.2-1.x86_64.rpm
Step 2 – Understand Grafana Installation details in RHEL/CENTOS
- Installs binary to /usr/sbin/grafana-server
- Copies init.d script to /etc/init.d/grafana-server
- Installs default file (environment vars) to /etc/sysconfig/grafana-server
- Copies configuration file to /etc/grafana/grafana.ini
- Installs systemd service (if systemd is available) name grafana-server.service
- The default configuration uses a log file at /var/log/grafana/grafana.log
- The default configuration specifies an sqlite3 database at /var/lib/grafana/grafana.db
Step 3 – Start the server (init.d service)
$ sudo service grafana-server start
This will start the grafana-server process as the grafana user, which is created during package installation. The default HTTP port is 3000, and default user and group is admin.
Step 4 – Configure the Grafana server to start at boot time
$ sudo /sbin/chkconfig --add grafana-server $ sudo systemctl enable grafana-server.service $ systemctl daemon-reload $ systemctl start grafana-server $ systemctl status grafana-server
Step 5 – Grafana server Environment file
The systemd service file and init.d script both use the file located at /etc/sysconfig/grafana-server for environment variables used when starting the back-end. Here you can override log directory, data directory and other variables.
Step 6 – Grafana server Log
By default Grafana will log to /var/log/grafana
Step 7 – Grafana Database
The default configuration specifies a sqlite3 database located at /var/lib/grafana/grafana.db. Please backup this database before upgrades.
You can also use MySQL or Postgres as the Grafana database, as detailed on
http://docs.grafana.org/installation/configuration/#database
Step 8 – Grafana configuration
The configuration file is located at /etc/grafana/grafana.ini. Go the Configuration page for details on all those options. You can add following data sources
- Graphite
- InfluxDB
- OpenTSDB
- Prometheus
Step 9 – Server side image rendering
Server side image (png) rendering is a feature that is optional but very useful when sharing visualizations, for example in alert notifications.
$ sudo yum install fontconfig -y $ sudo yum install freetype* -y $ sudo yum install urw-fonts -y
Step 10 – Browse the dashboard
http://X.X.X.X.:3000/
Username – admin
Password – admin
- Use of runtime variables to save into another variable using register in Ansible - September 6, 2018
- Ansible & Ansible Tower Variable Precedence Hierarchy - September 6, 2018
- How to use template in Ansible? - September 6, 2018