netdata-influx
netdata-influx copied to clipboard
Unable to create influxdb database via curl: create database netdata -> unauthorized
Hello. Trying to set this up. Built the docker image manually for my m1 mac, this is my docker-compose.yml:
version: '3'
services:
netdata:
image: netdata/netdata
cap_add:
- SYS_PTRACE
security_opt:
- apparmor:unconfined
volumes:
- /etc/passwd:/host/etc/passwd:ro
- /etc/group:/host/etc/group:ro
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- '19999:19999'
influxdb:
image: influxdb
volumes:
- 'influxdb-storage:/var/lib/influxdb'
ports:
- '8086:8086'
restart: always
grafana:
image: grafana/grafana
volumes:
- 'grafana-storage:/var/lib/grafana'
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
ports:
- '3000:3000'
restart: always
netdata-grabber:
image: netdata-influx
environment:
- NI_INFLUX_ADDR=http://influxdb:8086
- NI_INFLUX_DB=netdata
- NI_NETDATA_API=https://netdata:19999/api
- NI_HOST_TAG=localhost-main
- NI_CHARTS=system.cpu system.net system.pgpgio
restart: always
volumes:
grafana-storage:
influxdb-storage:
Then I ran docker-compose up -d
And then I tried to create the netdata databse.
def in archm1 in ~/docker/netdata-influx took 20s
% curl -G http://localhost:8086/query --data-urlencode "q=CREATE DATABASE netdata"
{"code":"unauthorized","message":"unauthorized access"}% archm1
def in archm1 in ~/docker/netdata-influx
% curl -G http://192.168.178.32:8086/query --data-urlencode "q=CREATE DATABASE netdata"
{"code":"unauthorized","message":"unauthorized access"}% archm1
def in archm1 in ~/docker/netdata-influx
% curl -G http://archm1:8086/query --data-urlencode "q=CREATE DATABASE netdata"
{"code":"unauthorized","message":"unauthorized access"}% archm1
Nothing worked. I can succesfully create a user in the influx-db site, but I do not know how to create a database otherwise.
I found out, the route via influxdb GUI worked now. I could add the source in grafana. But I had also to disable my VPN temporarily. From there I had more problems. I could not import the grafana dashboard as described in the guide, unless I turn my VPN back on. From there, I wanted to add netdata sources, but it would end up in "Bad Gateway" and no data could be pulled.