您好我想为我的MSSQL 2008 R2服务器编写一条河流。我已将MSSQL驱动程序和jdbc jar复制到bin / plugins / jdbc目录中。我已经在Solr中测试了MSSQL驱动程序,它运行正常。所以连接字符串是正确的。
当我启动ES服务器时,我得到了这个例外:
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:135)
at org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:270)
at org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:264)
at org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAction.java:93)
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:724)
Caused by: java.lang.ClassNotFoundException: jdbc
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:73)
... 9 more
我的卷发看起来像那样:
curl -XPUT http://localhost:9200/_river/documents/_meta -d '
{
"type" : "jdbc",
"jdbc" : {
"driver" : "com.microsoft.sqlserver.jdbc.SQLServerDriver",
"url" : "jdbc:sqlserver://CPCDKD3;databaseName=Sampledocs",
"user" : "XXXX",
"password" : "XXXX",
"sql" : "SELECT * from Docs"
},
"index" : {
"index" : "documents",
"type" : "FieldId",
"type" : "FieldTitle",
"type" : "FieldCOntent"
}
}'
答案 0 :(得分:1)
好的解决了。该插件必须放入$ ES_Home \ plugins而不是$ ES_Home \ bin \ plugins