一看必会系列:grafana安装配置

No Comments Linux

 yum install https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.1.3-1.x86_64.rpm
 
 
On CentOS / Fedora / Redhat:

$ wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.1.3-1.x86_64.rpm
$ sudo yum install initscripts fontconfig
$ sudo rpm -Uvh grafana-5.1.3-1.x86_64.rpm

————-以上安装完成
修改配置
vim  /etc/grafana/grafana.ini
[server]
http_addr = 192.168.142.103
http_port = 3000
root_url = http://192.168.142.103:3000

$ systemctl daemon-reload
$ systemctl start grafana-server
$ systemctl status grafana-server
systemctl enable grafana-server.service

——添加图形界面

https://www.nongziyi.xin/?p=282

———以下是备用方案

Install via 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/7/$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

Start the server (via systemd)

$ systemctl daemon-reload
$ systemctl start grafana-server
$ systemctl status grafana-server
systemctl enable grafana-server.service

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.

If the image is missing text make sure you have font packages installed.

yum install fontconfig
yum install freetype*
yum install urw-fonts

------中间广告---------

 

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.
Logging

By default Grafana will log to /var/log/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 the configuration page.

如要使用mysql 请如下操作
http://docs.grafana.org/installation/configuration/#database
[database]

Grafana needs a database to store users and dashboards (and other things). By default it is configured to use sqlite3 which is an embedded database (included in the main Grafana binary).
url

Use either URL or or the other fields below to configure the database Example: mysql://user:secret@host:port/database

url

Use either URL or or the other fields below to configure the database Example: mysql://user:secret@host:port/database
type

Either mysql, postgres or sqlite3, it’s your choice.
path

Only applicable for sqlite3 database. The file path where the database will be stored.
host

Only applicable to MySQL or Postgres. Includes IP or hostname and port. For example, for MySQL running on the same host as Grafana: host = 127.0.0.1:3306
name

The name of the Grafana database. Leave it set to grafana or some other name.
user

The database user (not applicable for sqlite3).
password

The database user’s password (not applicable for sqlite3). If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""

发表评论