日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

grafana图形化数据展示软件介绍

發布時間:2024/3/13 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 grafana图形化数据展示软件介绍 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

grafana圖形化數據展示軟件介紹

http://grafana.org/

一、從官網上看一下特色

Rich Graphing

Fast and flexible client side graphs with a multitude of options.

  • Click and select region to zoom
  • Multiple Y-Axes
  • Bars, Lines, Points
  • Thresholds, Logarithmic scales
  • Y-axis formats (bytes, milliseconds, etc)
  • View or edit graph in fullscreen

Graph Styling

  • Full control for how each series should be drawn
  • Mix lines, bars and points
  • Mix stacked series with isolated series
  • Export any graph to png image (via UI or HTTP API)

Dashboards

  • Drag and drop panels, change row and panel width easily.
  • Search dashboards based on title or tags
  • Templated dashboards
  • Scripted dashboards
  • Dashboard playlists
  • Create / Update HTTP API
  • Different panel types

二、國內的一些嘗試


使用 Grafana、collectd 和 InfluxDB 打造現代監控系統

http://www.linuxidc.com/Linux/2015-04/116123.htm


想打造 New Relic 那樣漂亮的實時監控系統我們只需要 InfluxDB/collectd/Grafana 這三個工具,這三個工具的關系是這樣的:

采集數據(collectd)-> 存儲數據(InfluxDB) -> 顯示數據(Grafana)。

  • InfluxDB?是 Go 語言開發的一個開源分布式時序數據庫,非常適合存儲指標、事件、分析等數據,看版本號(v0.8.8)就知道這個項目還很年輕;
  • collectd?就不用介紹了吧,C 語言寫的一個系統性能采集工具;
  • Grafana?是純 Javascript 開發的前端工具,用于訪問 InfluxDB,自定義報表、顯示圖表等。

下面的安裝和配置步驟在 Ubuntu 14.04 Server 64bit 版上完成。升級整個系統后重啟:

  • $ sudo apt-get update
  • $ sudo apt-get upgrade
  • $ sudo reboot
  • ?

    安裝 InfluxDB

    InfluxDB 是 Go 寫的,不依賴任何其他包或庫,很干凈。安裝很容易:

  • $ wget https://s3.amazonaws.com/influxdb/influxdb_latest_amd64.deb
  • $ sudo dpkg -i influxdb_latest_amd64.deb
  • 啟動 InfluxDB:

  • $ sudo /etc/init.d/influxdb start
  • Setting ulimit -n 65536
  • Starting the process influxdb[ OK ]
  • influxdb process was started [ OK]
  • 啟動后打開 web 管理界面 http://192.168.2.183:8083/ 默認用戶名和密碼是 root 和 root. InfluxDB 的 Web 管理界面端口是 8083,HTTP API 監聽端口是 8086,如果需要更改這些默認設定,修改 InfluxDB 的配置文件 /opt/influxdb/current/config.toml 后重啟 InfluxDB 就可以了。

    ?

    在剛安裝好的 InfluxDB 上創建一個名為 collectd 的數據庫,可以用命令行創建,也可以用 Web 管理界面操作:

  • $ curl "http://192.168.2.183:8086/db?u=root&p=root"-d"{\"name\": \"collectd\"}"
  • ?

    安裝 collectd

    安裝 collectd:

  • $ sudo apt-get install collectd
  • 配置 collectd 為客戶端,收集到數據后直接發給 InfluxDB:

  • $ sudo vi /etc/collectd/collectd.conf
  • ...
  • LoadPlugin network
  • ...
  • <Plugin network>
  • Server"192.168.2.183""25826"
  • </Plugin>
  • ...
  • 重啟 collectd:

  • $ sudo /etc/init.d/collectd restart
  • InfluxDB 現在自帶一個 collectd 插件來獲取 collectd 客戶端發來的數據,以前可沒這么方便哦,0.8.4 版本以前只能通過 influxdb-collectd-proxy 這樣的第三方程序來連接 collectd 和 InfluxDB. 如果你檢查一下服務器上打開的端口就會發現 influxdb 插件啟動了一個 25826 端口,如果發現 InfluxDB 數據庫里沒有(收集到)數據,務必檢查這個 25826 端口是否正常啟動了:

  • $ sudo netstat -tupln
  • ActiveInternet connections(only servers)
  • ProtoRecv-QSend-QLocalAddressForeignAddressState PID/Program name
  • tcp 000.0.0.0:220.0.0.0:* LISTEN 622/sshd
  • tcp6 00:::8086:::* LISTEN668/influxdb
  • tcp6 00:::22:::* LISTEN622/sshd
  • tcp6 00:::8090:::* LISTEN668/influxdb
  • tcp6 00:::8099:::* LISTEN668/influxdb
  • tcp6 00:::8083:::* LISTEN668/influxdb
  • udp6 00:::25826:::*668/influxdb
  • InfluxDB 自帶的 collectd 插件默認是關閉的,需要手動配置打開 enabled = true,并填上 database = “collectd” 這一行,這里的 “collectd” 就是我們上面創建的那個數據庫,更改配置后記得重啟 InfluxDB:

  • $ sudo vi /opt/influxdb/current/config.toml
  • $ sudo vi /opt/influxdb/shared/config.toml
  • ...
  • # Configure the collectd api
  • [input_plugins.collectd]
  • enabled =true
  • # address = "0.0.0.0" # If not set, is actually set to bind-address.
  • # port = 25826
  • database ="collectd"
  • # types.db can be found in a collectd installation or on github:
  • # https://github.com/collectd/collectd/blob/master/src/types.db
  • # typesdb = "/usr/share/collectd/types.db" # The path to the collectd types.db file
  • ...
  • $ sudo /etc/init.d/influxdb restart
  • Setting ulimit -n 65536
  • Setting ulimit -n 65536
  • influxdb process was stopped [ OK]
  • Setting ulimit -n 65536
  • Starting the process influxdb[ OK ]
  • influxdb process was started [ OK]
  • 現在 InfluxDB 已經準備好接受和處理 collectd 傳來的數據了。用命令行或者 Web 管理界面驗證一下數據庫里是否有數據:

  • $ curl -G'http://192.168.2.183:8086/db/collectd/series?u=root&p=root&q=list+series&pretty=true'
  • [
  • {
  • "name":"list_series_result",
  • "columns":[
  • "time",
  • "name"
  • ],
  • "points":[
  • [
  • 0,
  • "192.168.2.183/cpu-0/cpu-idle"
  • ],
  • ...
  • ]
  • }
  • ]
  • ?

    安裝 Grafana

    下載 grafana 后解壓放到 web 服務器上就可用。這里省去配置 Nginx/Apache 之類的麻煩,直接用最簡單的 Web 服務器 python -m SimpleHTTPServer 驅動:

  • $ wget http://grafanarel.s3.amazonaws.com/grafana-1.9.1.tar.gz
  • $ tar xzvf grafana-1.9.1.tar.gz
  • $ cd grafana-1.9.1.tar.gz
  • $ cp config.sample.js config.js
  • $ vi config.js
  • ...
  • // InfluxDB example setup (the InfluxDB databases specified need to exist)
  • datasources:{
  • influxdb:{
  • type:'influxdb',
  • url:"http://192.168.2.183:8086/db/collectd",
  • username:'root',
  • password:'root',
  • },
  • ...
  • },
  • ...
  • $ sudo python -mSimpleHTTPServer
  • 用瀏覽器訪問 Grafana,這里的默認端口是 8000:

    總結

    以上是生活随笔為你收集整理的grafana图形化数据展示软件介绍的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。