Open xyhp915 opened 9 years ago
Do not run Elasticsearch as root.
Your creation command for the river was wrong.
plugins/jdbc
directory permissions problem .
Thanks . it solved :) .
Hi, I am getting the same error on Windows. Can someone help?
Running below command to create river using sense plugin :
PUT _river/my_jdbc_river/_meta { "type":"jdbc", "jdbc": { "driver":"com.microsoft.sqlserver.jdbc.SQLServerDriver", "url":"jdbc:sqlserver://localhost:1433;databaseName=DB_Name", "user":"user", "password":"password", "sql":"select id, name from user" } }
It creates river successfully and shows message in river :
{ "_index": "_river", "_type": "my_jdbc_river", "_id": "_meta", "_version": 1, "created": true }
but gives below error in command prompt :
[2015-06-19 13:06:26,813][WARN ][river ] [Mark Gervaisnight Shade] failed to create river [jdbc][my_jdbc_river] org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class with value [jdbc] at org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:87) at org.elasticsearch.river.RiverModule.spawnModules(RiverModule.java:58) at org.elasticsearch.common.inject.ModulesBuilder.add(ModulesBuilder.java:44) at org.elasticsearch.river.RiversService.createRiver(RiversService.java:138) at org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:274) at org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:268) at org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAction.java:113) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.ClassNotFoundException: jdbc at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:73)
Using
ElasticSearch version 1.6 elasticsearch-jdbc-1.6.0.0-uberjar Java8 sqljdbc4
Is it about permission issue in Windows as well? Please help.
ashishgupta4486, I'm getting same. was you able to resolve the issue? I've installed 'elasticsearch-jdbc' as plugin
@adnangul
Yes, the problem was with version. On site its written version should be same for ES and river but it does not work in all scenarios. For me below are the combination of versions worked -
sqljdbc 4 elasticsearch 1.5.2 elasticsearch-river-jdbc 1.4.0.10
Please check your command line tool. It does not send the JSON body in correct syntax to Elasticsearch. Watch out for escaping quotes (").
@ashishgupta4486 I'm using elastic 1.6.0 elasticsearch-jdbc 1.6.0.0 As per site they should be compatible
@jprante I've installed the plugin using below command
plugin -u http://xbib.org/repository/org/xbib/elasticsearch/importer/elasticsearch-jdbc/1.6.0.0/elasticsearch-jdbc-1.6.0.0-dist.zip -i jprante/elasticsearch-jdbc
I'm using curl to create river/index as below
curl -XPUT localhost:9200/_river/product/_meta -d @curl-data.txt
The data in file: { "type": "jdbc", "jdbc": { "url": "jdbc:mysql://localhost:3306/test", "user": "user", "password": "pass", "sql": "SELECT * FROM product", "index": "example", "type": "product" } }
I've double check the quotes seems good. Please advice in case you notice any issues with steps above
With curl
, you need to add the --data-binary
flag to send data to Elasticsearch.
Most important: you installed a river. JDBC importer 1.6.0.0 is no longer a river.
@adnangul
Its not gonna work with 1.6 version since its depricated. I also tried for the same struggled for few hours then found a blog https://www.elastic.co/blog/deprecating-rivers.
Then I tried with couple of other version and finally worked with below combination
sqljdbc 4 elasticsearch 1.5.2 elasticsearch-river-jdbc 1.4.0.10
For a version 1.6 I am not sure with curl.
That's mean it wouldn't work even if I use --data-binary as below curl -XPUT localhost:9200/_river/product/_meta --data-binary @curl-data.txt
Adnan
On Thu, Jul 2, 2015 at 4:45 PM, Jörg Prante notifications@github.com wrote:
Most important: you installed a river. JDBC importer 1.6.0.0 is no longer a river.
— Reply to this email directly or view it on GitHub https://github.com/jprante/elasticsearch-jdbc/issues/391#issuecomment-118177531 .
Regards, Adnan Yaqoob
@ashishgupta4486 Deprecating shouldn't stop functionality; it's an indicator that the feature will be removed in future version. As per link you shared, probably they are going to keep the infrastructure up to 2.0. Will be removed in 2.0 onwards
Adnan
The pain with river was so great I dropped support for river API as soon as possible.
For ES 1.6 upwards, I do no longer offer JDBC river versions, only JDBC importer, with improved runtime behavior.
@adnangul
Yes you are right. Its always to have alternate if something is depricated since its gonna remove in future as you said. Better you change 1.6 if you want to use river.
Hi All, I am getting the same error: I am using: elastic 1.6.0 elasticsearch-jdbc 1.6.0.0 (importer).
and my request in marverl sense is:
PUT http://localhost:9200/_river/orders_river/_meta
{
"type":"jdbc",
"jdbc":
{
"driver": "com.microsoft.sqlserver.jdbc.SQLServerDriver",
"url":"jdbc:sqlserver://usalvwaldbqa1:1433;databaseName=es",
"user":"es",
"password":"Answ3r21",
"sql":"SELECT * FROM es.g_solution where solution_id=45",
"index" : "clients",
"type" : "orders"
}
}
for elastic 1.6 which version of jdbc(river or importer) i should go for?or should i be using belowcombinations only? sqljdbc 4 elasticsearch 1.5.2 elasticsearch-river-jdbc 1.4.0.10
You have to work with importer in case of 1.6.
Below combination worked for me so I shared. I tried with 1.6 for ES and river both but didn't work and I am not sure about importer. Didn't try yet.
Thanks Ashish! i used importer version itself but did not work for me. elastic 1.6.0 elasticsearch-jdbc 1.6.0.0 (importer)
and sqljdbc 4.
@poonaminfor Haven't tried importer yet. @jprante can actually help you in this.
Meanwhile you can use combination which I shared above for _river. For that I am sure.
Thanks Ashish,will try with ur combination.
I could fix it with ur combination Ashish but running into another issue:
2015-07-08 04:30:51,817][ERROR][bootstrap ] [nodedev] Exception org.elasticsearch.ElasticsearchIllegalStateException: Can't move to started state when closed at org.elasticsearch.common.component.Lifecycle.canMoveToStarted(Lifecycle.java:117) at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:79) at org.elasticsearch.node.internal.InternalNode.start(InternalNode.java:258) at org.elasticsearch.bootstrap.Bootstrap.start(Bootstrap.java:128) at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:216) at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32) [2015-07-08 04:30:53,172][WARN ][common.jna ] unable to link C library. native methods (mlockall) will be disabled. [2015-07-08 04:30:53,451][INFO ][node ] [nodedev] version[1.5.2], pid[11556], build[62ff986/2015-04-27T09:21:06Z]
i am using windows 2008 r2 and its a virtual machine,
I could fix it mlock setting,tnx.
@poonaminfor Check your java version once. I was also getting same issue but using java 8 and combination of above given set up files this problem gone.
Sorry, no fsriver here, and no Logstash. This is JDBC river/importer.
Results :1234:
Console logs :1234:
My elasticsearch version is
1.4.0 Beta
. Plugins jdbc dir ...What should i do ?