influxdata / kapacitor

Open source framework for processing, monitoring, and alerting on time series data
MIT License
2.31k stars 493 forks source link

Issue in connecting remote InfluxDB from local Kapacitor #1407

Open hatim-stovewala opened 7 years ago

hatim-stovewala commented 7 years ago

Hi, I want to connect an remote instance of InfluxDB from my local Kapacitor and do some processing on the data and put back the processed data to the same remote instance of InfluxDB. I have made changes to the kapacitor.conf file changing the urls parameter to desired remote Influx's IP something like urls = ["http://10.0.10.10:8086"] By doing this Influx have correct subscription mapping of this kapacitor instance. I will be posting output below. However, when I try to run a batch task, it runs well. Data get picks from remote Influx and processed data is put back into the remote Influx. But when I run stream task, it doesn't run. The ouput is null. In kapacitor show task everything is with value 0.

Could you please help me setting up this.

Kapacitor is spinning on docker on Linux machine and the InfluxDB which I'm trying to connect is somewhere on the network.

kapacitor.config

[[influxdb]]
  enabled = true
  name = "default"
  default = true
  urls = ["http://10.0.10.10:8086"]
  username = ""
  password = ""
  ssl-ca = ""
  ssl-cert = ""
  ssl-key = ""
  insecure-skip-verify = false
  timeout = "0s"
  disable-subscriptions = false
  subscription-protocol = "http"
  kapacitor-hostname = ""
  http-port = 0
  udp-bind = ""
  udp-buffer = 1000
  udp-read-buffer = 0
  startup-timeout = "5m0s"
  subscriptions-sync-interval = "1m0s"
  [influxdb.excluded-subscriptions]
    _kapacitor = ["autogen"]

kapacitor stats general

ClusterID:                    291ddf7a-ef34-43eb-a472-2ef181f04fd7
ServerID:                     414a85e0-99df-4ce0-b149-218f2303759d
Host:                         ef12c0ed23ed                  
Tasks:                        8                             
Enabled Tasks:                2                             
Subscriptions:                3                             
Version:                      1.2.0   

kapacitor stats ingress

Database   Retention Policy Measurement Points Received
_kapacitor autogen          edges                   840
_kapacitor autogen          ingress                 713
_kapacitor autogen          kapacitor               120
_kapacitor autogen          nodes                   720
_kapacitor autogen          runtime                 120
_kapacitor autogen          topics                  840

SHOW SUBSCRIPTIONS

name: _internal
retention_policy name                                           mode destinations
---------------- ----                                           ---- ------------
monitor          kapacitor-291ddf7a-ef34-43eb-a472-2ef181f04fd7 ANY  [http://ef12c0ed23ed:9092]

name: cxg
retention_policy name                                           mode destinations
---------------- ----                                           ---- ------------
autogen          kapacitor-291ddf7a-ef34-43eb-a472-2ef181f04fd7 ANY  [http://ef12c0ed23ed:9092]

name: mydb
retention_policy name                                           mode destinations
---------------- ----                                           ---- ------------
autogen          kapacitor-291ddf7a-ef34-43eb-a472-2ef181f04fd7 ANY  [http://ef12c0ed23ed:9092]
nathanielc commented 7 years ago

InfluxDB is trying to send the data to Kapacitor using this url http://ef12c0ed23ed:9092. Is that a valid url that the InfluxDB host can resolve? If not change the hostname setting for Kapacitor to be a resolvable name.

hatim-stovewala commented 7 years ago

The hostname is 'localhost' in the kapacitor.conf. Do I need to change it to 'ef12c0ed23ed'? However if this is the case, I'm just wondering how batch tasks runs properly with 'localhost' settings but stream task doesn't.

adityacs commented 7 years ago

@hatim-stovewala could you please provide your "batch" and "stream" tick scripts?

zhoujinl commented 6 years ago

how to change ef12c0ed23ed ?

wuqifhb commented 6 years ago

@zhoujinl change hostname on top of kapacitor.config

KuroTetsu25 commented 5 years ago

hello @hatim-stovewala , did you found solution for the issue? since i have similar issue with you