influxdata / influxdata/sandbox

Connection refused when wirint to influxDB via Telegraf

Open
#35 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Shell
Stars
490
Forks
252
PR merge metrics
No merged PRs in 30d

Description

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 = ""
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://: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 = [
"/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 = ""
password = ""

## 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 = [
""
]
```

Host:
- Windows Server 2016 Standard
- Telegraf version: v1.7.0
- influxdb version: v1.5.3

Contributor guide

No contributing guide indexed for this repository

Research direction

No source file or test is named. Start by reproducing the failure with `telegraf --debug`, then inspect the InfluxDB CLI and container state alongside the supplied output configuration and Windows environment. Done means identifying why the configured InfluxDB endpoint is unavailable and documenting a verified resolution.

Written by the indexing model from the issue text.

Assessment

Domain
databases, observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.