influxdata / influxdb-relay

Service to replicate InfluxDB data for high availability
MIT License
854 stars 349 forks source link

Can not write to Kapacitor with influxdb-relay #40

Closed cmben closed 8 years ago

cmben commented 8 years ago

As mentioned in one of the configurations, influxdb-relay can write data to kapacitor as they are wire compatible.

But when i try the same, Kapacitor is not receiving any data. Configurations for Influxdb-relay and Kapacitor are below.

Kapacitor -

# The hostname of this node.

# Must be resolvable by any configured InfluxDB hosts.

hostname = "localhost"

# Directory for storing a small amount of metadata about the server.

data_dir = "/var/lib/kapacitor"

[http]

  # HTTP API Server for Kapacitor

  # This server is always on,

  # it servers both as a write endpoint

  # and as the API endpoint for all other

  # Kapacitor calls.

  bind-address = ":9092"

  auth-enabled = false

  log-enabled = true

  write-tracing = false

  pprof-enabled = false

  https-enabled = false

  https-certificate = "/etc/ssl/kapacitor.pem"

[[influxdb]]

  # Connect to an InfluxDB cluster

  # Kapacitor can subscribe, query and write to this cluster.

  # Using InfluxDB is not required and can be disabled.

  enabled = true

  default = true

  name = "localhost"

  urls = ["http://localhost:8086"]

  username = "admin"

  password = "admin"

  timeout = 0

Influxdb-relay

[[http]]
name = "kapacitor-http"
bind-addr = "0.0.0.0:9096"
default-retention-policy = "default"
output = [
    { name="influxdb1", location = "http://influxdb1:8086/write" },
    { name="influxdb2", location = "http://influxdb2:8086/write" },
    { name="kapacitor1", location = "http://kapacitor1:9092/write" },
]

Is there any additional configuration required, or is something wrong with this conf ?

nathanielc commented 8 years ago

What version of Kapacitor are you using? Can you share the output of kapacitor stats ingress?

You config looks fine. Are there any errors in the logs of either Kapacitor or the relay?

cmben commented 8 years ago

I am using Kapacitor 0.13.1 kapacitor stats ingress shows output as "Unknown command stats"

nathanielc commented 8 years ago

What happens if you try to manually write data to the Kapacitor instance from the relay instance?

curl -X POST 'http://kapacitor1:9092/write?db=testdb&rp=testrp' --data-binary 'test value=1'

cmben commented 8 years ago

I tried this request both from the Kapacitor node as well node on which relay is hosted. Both give me following output- database is required

nathanielc commented 8 years ago

@cmben Sorry, I updated the command

cmben commented 8 years ago

Thanks @nathanielc It seems that the writes are successful.

POST /write?db=testdb&rp=testrp HTTP/1.1 204 0 - curl/7.35.0

Though i still do not see data in influxdb on the same node. How does Kapacitor run batch alerts on this incoming data ? Does it store this data in some buffer ? Sorry if this sounds too trivial.

nathanielc commented 8 years ago

Though i still do not see data in influxdb on the same node.

This is expected you only wrote the data to Kapacitor, not InfluxDB.

Kapacitor batch tasks query data from InfluxDB. They do not process the incoming data, that is what stream tasks do.

cmben commented 8 years ago

Thanks you for clarifying this.

Closing.