Grafana Installation

From r00tedvw.com wiki
(Difference between revisions)
Jump to: navigation, search
(Setup MySQL)
Line 22: Line 22:
 
+---------------------------------------------------------------------------------------------------------------+
 
+---------------------------------------------------------------------------------------------------------------+
 
1 row in set (0.00 sec)</nowiki>
 
1 row in set (0.00 sec)</nowiki>
 +
 +
==Configure Grafana==
 +
Edit <code>/etc/grafana/grafana.ini</code>
 +
<nowiki>~$ sudo vi /etc/grafana/grafana.ini
 +
 +
[database]
 +
[database]
 +
# Either "mysql", "postgres" or "sqlite3", it's your choice
 +
type = mysql
 +
host = 127.0.0.1:3306
 +
name = grafanadatabase
 +
user = grafana
 +
password = grafanauserpassword
 +
 +
[server]
 +
protocol = http
 +
http_addr = 127.0.0.1
 +
http_port = 3000
 +
domain = grafana.domain.com
 +
enforce_domain = true
 +
root_url = %(protocol)s://%(domain)s/
 +
 +
[security]
 +
admin_user = admin
 +
admin_password = SecureAdminPass
 +
secret_key = somelongrandomstringkey
 +
</nowiki>

Revision as of 13:33, 30 June 2016

Contents

Add Repository

echo 'deb https://packagecloud.io/grafana/stable/debian/ wheezy main' |  sudo tee -a /etc/apt/sources.list

Add Key

curl https://packagecloud.io/gpg.key | sudo apt-key add -

Install Grafana, MySQL, Apache

sudo apt-get update && sudo apt-get install grafana mysql-server apache2 -y

Note: Remember to document the MySQL root password.

Setup MySQL

~$ mysql -u root -p
~$ mysql> CREATE USER 'grafana'@'localhost' IDENTIFIED BY 'THISpasswordSHOULDbeCHANGED';
~$ mysql> CREATE DATABASE grafanadatabase;
~$ mysql> GRANT ALL PRIVILEGES ON grafana.* TO 'grafana'@'localhost' IDENTIFIED BY 'grafanauserpassword' WITH GRANT OPTION;
~$ mysql> exit

verify permissions have been granted

~$ mysql -u grafana -p
~$ mysql> SHOW GRANTS;
+---------------------------------------------------------------------------------------------------------------+
| Grants for grafana@localhost                                                                                   |
+---------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'grafana'@'localhost' IDENTIFIED BY PASSWORD '*2K21458K438UYE85A38B9Y7Y78DAEBF4T8689YK4' |
| GRANT ALL PRIVILEGES ON `grafanadatabase`.* TO 'grafana'@'localhost' WITH GRANT OPTION                          |
+---------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

Configure Grafana

Edit /etc/grafana/grafana.ini

~$ sudo vi /etc/grafana/grafana.ini

[database]
[database]
# Either "mysql", "postgres" or "sqlite3", it's your choice
type = mysql
host = 127.0.0.1:3306
name = grafanadatabase
user = grafana
password = grafanauserpassword

[server]
protocol = http
http_addr = 127.0.0.1
http_port = 3000
domain = grafana.domain.com
enforce_domain = true
root_url = %(protocol)s://%(domain)s/

[security]
admin_user = admin
admin_password = SecureAdminPass
secret_key = somelongrandomstringkey

Personal tools
Namespaces

Variants
Actions
Navigation
Mediawiki
Confluence
DevOps Tools
Open Source Products
Ubuntu
Ubuntu 22
Mac OSX
Oracle Linux
AWS
Windows
OpenVPN
Grafana
InfluxDB2
TrueNas
MagicMirror
OwnCloud
Pivotal
osTicket
OTRS
phpBB
WordPress
VmWare ESXI 5.1
Crypto currencies
HTML
CSS
Python
Java Script
PHP
Raspberry Pi
Canvas LMS
Kaltura Media Server
Plex Media Server
MetaSploit
Zoneminder
ShinobiCE
Photoshop CS2
Fortinet
Uploaded
Certifications
General Info
Games
Meal Plans
NC Statutes
Politics
Volkswagen
Covid
NCDMV
Toolbox