반응형

 

0. 보드 버전, OS 버전 확인

pi@hsrpi:~/hs/grafana $ cat /proc/device-tree/model
Raspberry Pi 4 Model B Rev 1.1pi@hsrpi:~/hs/grafana 
$ uname -a
Linux hsrpi 5.4.51-v7l+ #1333 SMP Mon Aug 10 16:51:40 BST 2020 armv7l GNU/Linux

1. influxDB and grafana install script

#install influxdb
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install apt-transport-https
curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add - 
echo "deb https://repos.influxdata.com/debian jessie stable" | sudo tee /etc/apt/sources.list.d/influxdb.list 
sudo apt-get update 
sudo apt-get install influxdb

#install grafana
sudo apt-get install apt-transport-https curl
curl https://bintray.com/user/downloadSubjectPublicKey?username=bintray | sudo apt-key add -
echo "deb https://dl.bintray.com/fg2it/deb jessie main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
sudo apt-get update
sudo apt-get install grafana

기존 설치된 패키지들을 최신으로 업데이트 후, influxdb패키지 다운로드 링크를 추가, influxdb설치.

2. influxDB 설정

설치후 /etc/influxdb/influxdb.conf 의 http부분을 다음과 같이 수정해 줍니다.

[http]
  # Determines whether HTTP endpoint is enabled.
  enabled = true

  # The bind address used by the HTTP service.
  bind-address = ":8086"

  # Determines whether user authentication is enabled over HTTP/HTTPS.
  auth-enabled = false

  # The default realm sent back when issuing a basic auth challenge.
  # realm = "InfluxDB"

Failed to enable unit: Unit file /etc/systemd/system/influxdb.service is masked.
$ sudo systemctl unmask influxd

위와같이 masked error가 날 경우 unmask해준다.

3. DB create

$ influx -precision rfc3339
Connected to http://localhost:8086 version 1.8.4
InfluxDB shell version: 1.8.4
> create database monitoring
> show databases
name: databases
name
----
_internal
monitoring
> 

4. Grafana 설정

[server]
# Protocol (http, https, h2, socket)
protocol = http

# The ip address to bind to, empty will bind to all interfaces
;http_addr =

# The http port  to use
http_port = 3000
$sudo service grafana-server restart

 

반응형

+ Recent posts