美文网首页
Prometheus(四)可视化:Grafana

Prometheus(四)可视化:Grafana

作者: 咩咩的毛球 | 来源:发表于2019-07-17 15:53 被阅读0次
  • Grafana是用于可视化大型测量数据的开源程序,它提供了强大和优雅的方式去创建、共享、浏览数据。Dashboard中显示了你不同metric数据源中的数据。

  • Grafana最常用于因特网基础设施和应用分析,但在其他领域也有用到,比如:工业传感器、家庭自动化、过程控制等等。Grafana支持热插拔控制面板和可扩展的数据源,目前已经支持Graphite、InfluxDB、OpenTSDB、Elasticsearch、Prometheus等。

  1. 安装
$ wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_4.2.0_amd64.deb
$ dpkg -i grafana_4.2.0_amd64.deb

安装后能直接访问 3000 端口
下载地址:https://grafana.com/grafana/download

  1. 启动Grafana
$ systemctl start grafana-server
[Unit]
Description=Grafana instance
Documentation=http://docs.grafana.org
Wants=network-online.target

[Service]
EnvironmentFile=/etc/sysconfig/grafana-server
Type=notify
Restart=on-failure
WorkingDirectory=/usr/share/grafana
RuntimeDirectory=grafana
RuntimeDirectoryMode=0750
ExecStart=/usr/sbin/grafana-server                                                  \
                            --config=${CONF_FILE}                                   \
                            --pidfile=${PID_FILE_DIR}/grafana-server.pid            \
                            --packaging=rpm                                         \
                            cfg:default.paths.logs=${LOG_DIR}                       \
                            cfg:default.paths.data=${DATA_DIR}                      \
                            cfg:default.paths.plugins=${PLUGINS_DIR}                \
                            cfg:default.paths.provisioning=${PROVISIONING_CFG_DIR}  

LimitNOFILE=10000
TimeoutStopSec=20

[Install]
WantedBy=multi-user.target

  1. 查看Grafana是否启动成功
$ systemctl status grafana-server
  1. 访问Grafana
    通过 http://ip:3000 访问Grafana Web界面
    缺省帐号/密码为:admin/admin

  2. 在Grafana中添加Prometheus数据源

Name:Prometheus
Type:Prometheus
Url:http://localhost:9090/
Access:proxy
  • 在Dashboards页面导入自带的Prometheus Status模板


  • 导入Node Exporter Server Metrics模板
    访问https://grafana.com/dashboards/405,从这里下载Node Exporter Server Metrics模板的JSON文件。

  • 在Grafana--Dashboard中导入这个文件,数据源选择Prometheus。

  • 访问Dashboards

    在Dashboards上选Node Exporter Server Metrics模板,就可以看到被监控服务器的CPU, 内存, 磁盘等统计信息。
  • 在Dashboards上选Prometheus Status模板,查看Prometheus各项指标数据。


参考文档:
https://www.hi-linux.com/posts/25047.html
http://www.google.com
https://github.com/1046102779/prometheus
http://liubin.org/blog/2016/02/18/tsdb-intro/
http://www.cnblogs.com/vovlie/p/Prometheus_install.html
https://www.addops.cn/post/Prometheus-first-exploration.html
http://blog.frognew.com/2017/02/use-prometheus-on-centos7.html

相关文章

网友评论

      本文标题:Prometheus(四)可视化:Grafana

      本文链接:https://www.haomeiwen.com/subject/uraqlctx.html