Elasticsearch无法使用MongoDB河

时间:2014-11-14 16:29:15

标签: mongodb jdbc elasticsearch

我正在尝试使用带有elasticsearch(v1.X)的MongoDB河(v2.04),并且在安装时,河流在尝试索引数据时似乎失败了。此外,它会阻止Elasticsearch在重新启动服务器时正常启动。解析数据时出错:

[2014-11-14 11:19:08,625][WARN ][river                    ] [Tommy] failed to create river [mongodb][mongodb]
org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class with value [mongodb]
    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:137)
    at org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:275)
    at org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:269)
    at org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAction.java:95)
    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.lang.ClassNotFoundException: mongodb
    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:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:73)
    ... 9 more

河流设置如下:

PUT /_river/mongodb/_meta
{ 
    "type": "mongodb", 
    "mongodb": { 
      "servers":[
        {"host":"IPADDRESS","port":27017}
      ],
      "db": "database",
      "collection": "collection",
      "gridfs": true
    }, 
    "index": {
      "name": "items", 
      "type": "item" 
    }
  }
}

1 个答案:

答案 0 :(得分:0)

我打赌你和我犯了同样的错误。

您不仅需要通过发出以下命令来安装依赖项:

plugin --install elasticsearch/elasticsearch-mapper-attachments/2.4.1

你还需要自己安装河流:

plugin --install com.github.richardwilly98.elasticsearch/elasticsearch-river-mongodb/2.0.6

弹性搜索按类型值查找类名。