fast-data-dev icon indicating copy to clipboard operation
fast-data-dev copied to clipboard

Unable to connect to influxdb using built in connectors, all on local machine

Open AvijayC opened this issue 7 years ago • 1 comments

Hi, I'm unable to connect to influxDB using built in topics and the built in connector. Here is the exception that I get. I'm using docker version 18.06.1-ce, Influxdb version 1.6.2 and Lenses 2.1.5.

Connector config: connector.class=com.datamountaineer.streamreactor.connect.influx.InfluxSinkConnector connect.influx.url=http://127.0.0.1:8086 connect.influx.db=sea topics=sea_vessel_position_reports connect.influx.kcql=INSERT INTO sea SELECT * FROM sea_vessel_position_reports name=influx4 connect.influx.username=root

Exception: org.apache.kafka.connect.errors.ConnectException: Exiting WorkerSinkTask due to unrecoverable exception. at org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:559) at org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:315) at org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:218) at org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:186) at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:170) at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:214) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.RuntimeException: org.influxdb.InfluxDBIOException: java.net.ConnectException: Failed to connect to /127.0.0.1:8086 at com.datamountaineer.streamreactor.connect.errors.ThrowErrorPolicy.handle(ErrorPolicy.scala:58) at com.datamountaineer.streamreactor.connect.errors.ErrorHandler$class.handleError(ErrorHandler.scala:83) at com.datamountaineer.streamreactor.connect.errors.ErrorHandler$class.handleTry(ErrorHandler.scala:64) at com.datamountaineer.streamreactor.connect.influx.writers.InfluxDbWriter.handleTry(InfluxDbWriter.scala:29) at com.datamountaineer.streamreactor.connect.influx.writers.InfluxDbWriter.write(InfluxDbWriter.scala:47) at com.datamountaineer.streamreactor.connect.influx.InfluxSinkTask$$anonfun$put$2.apply(InfluxSinkTask.scala:75) at com.datamountaineer.streamreactor.connect.influx.InfluxSinkTask$$anonfun$put$2.apply(InfluxSinkTask.scala:75) at scala.Option.foreach(Option.scala:257) at com.datamountaineer.streamreactor.connect.influx.InfluxSinkTask.put(InfluxSinkTask.scala:75) at org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:537) ... 10 more Caused by: org.influxdb.InfluxDBIOException: java.net.ConnectException: Failed to connect to /127.0.0.1:8086 at org.influxdb.impl.InfluxDBImpl.execute(InfluxDBImpl.java:587) at org.influxdb.impl.InfluxDBImpl.write(InfluxDBImpl.java:355) at com.datamountaineer.streamreactor.connect.influx.writers.InfluxDbWriter$$anonfun$1.apply$mcV$sp(InfluxDbWriter.scala:45) at com.datamountaineer.streamreactor.connect.influx.writers.InfluxDbWriter$$anonfun$1.apply(InfluxDbWriter.scala:45) at com.datamountaineer.streamreactor.connect.influx.writers.InfluxDbWriter$$anonfun$1.apply(InfluxDbWriter.scala:45) at scala.util.Try$.apply(Try.scala:192) at com.datamountaineer.streamreactor.connect.influx.writers.InfluxDbWriter.write(InfluxDbWriter.scala:45) ... 15 more Caused by: java.net.ConnectException: Failed to connect to /127.0.0.1:8086 at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:240) at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:158) at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:256) at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:134) at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:113) at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at org.influxdb.impl.GzipRequestInterceptor.intercept(GzipRequestInterceptor.java:42) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:143) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200) at okhttp3.RealCall.execute(RealCall.java:77) at retrofit2.OkHttpCall.execute(OkHttpCall.java:180) at org.influxdb.impl.InfluxDBImpl.execute(InfluxDBImpl.java:579) ... 21 more Caused by: java.net.ConnectException: Connection refused (Connection refused) at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at okhttp3.internal.platform.Platform.connectSocket(Platform.java:125) at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:238) ... 46 more

AvijayC avatar Sep 11 '18 12:09 AvijayC

Probably InfluxDB isn't at 127.0.0.1. Each docker container has its own network, so 127.0.0.1 for Lenses Box refers to itself.

If you run both Influx and Lenses Box as docker containers, try to link them. E.g:

docker run --name=influxdb ...
docker-run --link influxdb:influxdb ... landoop/kafka-lenses-dev

That way, you will find Influx at http://influxdb:8086. Otherwise you can try to run both containers with the flag --net=host which will probably make InfluxDB accessible via 127.0.0.1.

andmarios avatar Sep 11 '18 16:09 andmarios