Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection refused when wirint to influxDB via Telegraf #35

Open
GillesC opened this issue Jun 22, 2018 · 1 comment
Open

Connection refused when wirint to influxDB via Telegraf #35

GillesC opened this issue Jun 22, 2018 · 1 comment

Comments

@GillesC
Copy link

GillesC commented Jun 22, 2018

I try to receive MQTT data and store it in a local influxdb.
However, when receiving the MQTT data I get the following error when running telegraf --debug:

2018-06-22T09:37:20Z E! [outputs.influxdb]: when writing to [http://127.0.0.1:8086]: Post http://127.0.0.1:8086/write?consistency=any&db=iotree: dial tcp 127.0.0.1:8086: connect: connection refused
2018-06-22T09:37:20Z E! Error writing to output [influxdb]: could not write any address

Sometimes when this error occurs I am not able to attach to the influxdb cli and it says 'no container found'.

Telegraf config file (removed sensitive information, e.g. passwords):

[agent]
  interval = "5s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "5s"
  flush_jitter = "0s"
  precision = ""
  debug = false
  quiet = false
  logfile = ""
  hostname = "$HOSTNAME"
  omit_hostname = false

[[outputs.influxdb]]
  urls = ["http://127.0.0.1:8086"]
  database = "<removed>"
  username = ""
  password = ""
  retention_policy = ""
  write_consistency = "any"
  timeout = "5s"

# Read metrics from MQTT topic(s)
[[inputs.mqtt_consumer]]
  ## MQTT broker URLs to be used. The format should be scheme://host:port,
  ## schema can be tcp, ssl, or ws.
  servers = ["tcp://<removed>:1883"]
  ## MQTT QoS, must be 0, 1, or 2
  qos = 0
  ## Connection timeout for initial connection in seconds
  connection_timeout = "30s"

  ## Topics to subscribe to
  topics = [
    "<removed>/devices/+/up"
  ]

  # if true, messages that can't be delivered while the subscriber is offline
  # will be delivered when it comes back (such as on service restart).
  # NOTE: if true, client_id MUST be set
  persistent_session = false
  # If empty, a random client ID will be generated.
  client_id = ""

  ## username and password to connect MQTT server.
  username = "<removed>"
  password = "<removed>"

  ## Optional TLS Config
  # tls_ca = "/etc/telegraf/ca.pem"
  # tls_cert = "/etc/telegraf/cert.pem"
  # tls_key = "/etc/telegraf/key.pem"
  ## Use TLS but skip chain & host verification
  # insecure_skip_verify = false

  ## Data format to consume.
  ## Each data format has its own unique set of configuration options, read
  ## more about them here:
  ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
  data_format = "json"
  name_suffix = "_tree"
  tag_keys = [
    "<removed>"
  ]

Host:

  • Windows Server 2016 Standard
  • Telegraf version: v1.7.0
  • influxdb version: v1.5.3
@zachjacobs
Copy link

Did you ever fix this? I get the same error in a default windows 10 sandbox install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants