Grafana influxdb

Grafanaを試してみたいなって思ったので試してみる。

http://techlife.cookpad.com/entry/2017/01/26/120222 https://rabbit-note.com/2017/04/15/raspberry-pi-with-fluentd/

まずはfluentd -> grafanaというのを試してみましょう。

(Φ ω Φ> brew install influxdb
(Φ ω Φ> ln -sfv /usr/local/opt/influxdb/*.plist ~/Library/LaunchAgents
(Φ ω Φ> brew services start influxdb
(Φ ω Φ> influx --version
InfluxDB shell version: v1.4.2
(Φ ω Φ> gem i fluentd

テスト用のDB作成

curl -XPOST "http://localhost:8086/query" --data-urlencode "q=CREATE DATABASE test"

ユーザーも作成しておく。 https://docs.influxdata.com/influxdb/v1.4/query_language/authentication_and_authorization/#authorization

(Φ ω Φ> influx -execute "CREATE USER admin WITH PASSWORD 'admin' WITH ALL PRIVILEGES"
(Φ ω Φ> influx
Connected to http://localhost:8086 version v1.4.2
InfluxDB shell version: v1.4.2
> CREATE USER testuser WITH PASSWORD 'mypwd'
> GRANT ALL ON test TO testuser

https://github.com/influxdata/influxdb#getting-started influxdbのgetting startedでデータの登録を試してみる。

web uiはもう提供されていないみたいなので直接grafanaから参照できないか確認してみる。

(Φ ω Φ> brew install grafana
==> Downloading https://homebrew.bintray.com/bottles/grafana-4.6.3.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring grafana-4.6.3.high_sierra.bottle.tar.gz
Warning: grafana dependency icu4c was built with a different C++ standard
library (libc++ from clang). This may cause problems at runtime.
==> Caveats
To have launchd start grafana now and restart at login:
  brew services start grafana
Or, if you don't want/need a background service you can just run:
  grafana-server --config=/usr/local/etc/grafana/grafana.ini --homepath /usr/local/share/grafana cfg:default.paths.logs=/usr/local/var/log/grafana cfg:default.paths.data=/usr/local/var/lib/grafana cfg:default.paths.plugins=/usr/local/var/lib/grafana/plugins
==> Summary
🍺  /usr/local/Cellar/grafana/4.6.3: 2,874 files, 127.2MB
 22:12:46 ~ ruby:2.4.2 node:v6.11.3
(Φ ω Φ> brew services start grafana
==> Successfully started `grafana` (label: homebrew.mxcl.grafana)