3

I installed four containers in my ec2 instance and every container is running fine. One of the containers in Telegraf and another one in influxdb. So I am trying to write the data from Telegraf to Influxdb and in Telegraf is coming from the AWS Kinesis. So after everything up and running data from kinesis is coming to the Telegraf but from telegraf data is not coming to Influxdb.

Here what I have changed in telegraf.conf file for getting data from Influxdb.

[[outputs.influxdb]]
urls = [“influxdb:8086”]
#urls = [“http://localhost:8086”]
database = “telegraf”

This is a snippet from my docker-compose.yml file.

influxdb:
  image: influxdb:1.8.2
  container_name: influxdb
  restart: always
  ports:
    - 8086:8086
  networks:
    - analytics
  volumes:
    - /mnt/db/:/mnt/db/
    - /mnt/influx/:/mnt/influx/
    - ./etc/influxdb/influxdb.conf:/etc/influxdb/influxdb.conf
telegraf:
image: telegraf
container_name: telegraf     
restart: always
depends_on:
  - influxdb
networks:
  - analytics
volumes:
  - telegraf-storage:/var/lib/telegraf
  - ./etc/telegraf/telegraf.conf:/etc/telegraf/telegraf.conf    
environment:                            
  INFLUXDB_URL: http://influxdb:8086   
  # - username=admin
  # - password=admin
links:
    - influxdb    

This is the error, I am getting. I checked port is also listening. Data is also coming in Telegraf from Kinesis.

[outputs.influxdb] When writing to [http://influxdb:8086]: database "telegraf" creation failed: Post "http://influxdb:8086/query": dial tcp 172.31.0.2:8086: connect: connection refused
Ravi kant Gautam
  • 333
  • 2
  • 23
  • HI! I am getting the same error. Would great to know if you solved this one. – Superluminal Jan 16 '21 at 22:45
  • actually, this is the error when telegraf tried to write on Influxdb but it happens when Influxdb is not ready. So this error will come always because after some time our Influxdbready to accept data. I haven't done anything special for this made sure everything up running and our telegraf.conf have all configuration which we suppose to use. – Ravi kant Gautam Jan 18 '21 at 04:09
  • Can you tell which input agent and output agent you are using in telegraf and what configuration options you are providing? – Ravi kant Gautam Jan 18 '21 at 04:10
  • Thanks for the willingness to help! I got it working. Not sure what it was, but restarting services and reviewing the configs helped. That was probably a DNS name resolbing problem. After restartign my custom DNS it worked. – Superluminal Jan 21 '21 at 18:03

0 Answers0