一看必会系列:grafana安装配置 — CCIE那点事

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

来源:本站原创 Linux 超过234 views围观 0条评论

 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;"""

文章出自:CCIE那点事 http://www.jdccie.com/ 版权所有。本站文章除注明出处外,皆为作者原创文章,可自由引用,但请注明来源。 禁止全文转载。
本文链接:http://www.jdccie.com/?p=3773转载请注明转自CCIE那点事
如果喜欢:点此订阅本站
  • 相关文章
  • 为您推荐
  • 各种观点

暂时还木有人评论,坐等沙发!
发表评论

快捷键:Ctrl+Enter