jprante / elasticsearch-jdbc

JDBC importer for Elasticsearch
Apache License 2.0
2.84k stars 709 forks source link

jdbc error #599

Open eyeskiller opened 9 years ago

eyeskiller commented 9 years ago

Hi,

i just installed Elasticsearch and this plugin by this tutorial: https://github.com/jprante/elasticsearch-jdbc/wiki/Quickstart

All good, i installed newest versions. But when executing this script:

curl -XPUT 'localhost:9200/_river/my_jdbc_river/_meta' -d '{ "type" : "jdbc", "jdbc" : { "url" : "jdbc:mysql://localhost:3306/dbname", "user" : "user", "password" : "somepwd", "sql" : "select * from auth_models" } }

and after trying this: curl -XGET 'localhost:9200/jdbc/_search?pretty&q=*'

response is:

{ "error" : "IndexMissingException[[jdbc] missing]", "status" : 404 }

When i try this: curl -XGET 'localhost:9200/_search?pretty&q=*'

response is:

`

  "_index" : "_river",
  "_type" : "picovina",
  "_id" : "_status",
  "_score" : 1.0,
  "_source":{"error":"CreationException[Guice creation errors:\n\n1) Error injecting constructor, java.lang.NullPointerException\n  at org.xbib.elasticsearch.river.jdbc.JDBCRiver.<init>(Unknown Source)\n  while locating org.xbib.elasticsearch.river.jdbc.JDBCRiver\n  while locating org.elasticsearch.river.River\n\n1 error]; nested: NullPointerException; ","node":{"id":"hK3uaM6SRVCqc69wUUOiNQ","name":"Crimson Daffodil","transport_address":"inet[/85.248.228.38:9300]"}}
},

`

in second log window i have this:

[2015-07-21 19:59:20,700][WARN ][cluster.service ] [Ultron] failed to reconnect to node [Ultron][iBMTuBPDSvOjSCMz2PON_g][cust-alaba][inet[/85.248.228.38:9301]] org.elasticsearch.transport.ConnectTransportException: [Ultron][inet[/85.248.228.38:9301]] connect_timeout[30s] at org.elasticsearch.transport.netty.NettyTransport.connectToChannels(NettyTransport.java:825) at org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:758) at org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:731) at org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:216) at org.elasticsearch.cluster.service.InternalClusterService$ReconnectToNodes.run(InternalClusterService.java:584) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.net.ConnectException: Connection refused: /85.248.228.38:9301 at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:744) at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.connect(NioClientBoss.java:152) at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.processSelectedKeys(NioClientBoss.java:105) at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.process(NioClientBoss.java:79) at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337) at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.run(NioClientBoss.java:42) at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42) ... 3 more

jprante commented 9 years ago

What version of plugin and Elasticsearch is this?

There seems to be classpath issues, maybe the plugin is loaded twice at ES start?

The wiki is for the older river version of JDBC importer, I will update the wiki in the future. It will not work for most recent importer-style version.