无法从neo4j

时间:2016-11-09 17:43:25

标签: elasticsearch neo4j

我想在neo4j数据上创建弹性搜索索引。 我提到https://github.com/neo4j-contrib/neo4j-elasticsearchhttps://www.youtube.com/watch?v=SJLSFsXgOvA&ab_channel=AnmolAgrawal来创建neo4j的弹性搜索索引。

但在那之后,我在neo4j.log文件中遇到错误。

    2016-11-08 12:20:09.825+0000 WARN  Error updating ElasticSearch  No Server is assigned to client to connect
io.searchbox.client.config.exception.NoServerConfiguredException: No Server is assigned to client to connect
    at io.searchbox.client.AbstractJestClient$ServerPool.getNextServer(AbstractJestClient.java:132)
    at io.searchbox.client.AbstractJestClient.getNextServer(AbstractJestClient.java:81)
    at io.searchbox.client.http.JestHttpClient.prepareRequest(JestHttpClient.java:80)
    at io.searchbox.client.http.JestHttpClient.executeAsync(JestHttpClient.java:60)
    at org.neo4j.elasticsearch.ElasticSearchEventHandler.afterCommit(ElasticSearchEventHandler.java:81)
    at org.neo4j.elasticsearch.ElasticSearchEventHandler.afterCommit(ElasticSearchEventHandler.java:27)
    at org.neo4j.kernel.internal.TransactionEventHandlers.afterCommit(TransactionEventHandlers.java:149)
    at org.neo4j.kernel.internal.TransactionEventHandlers.afterCommit(TransactionEventHandlers.java:47)
    at org.neo4j.kernel.impl.api.TransactionHooks.afterCommit(TransactionHooks.java:75)
    at org.neo4j.kernel.impl.api.KernelTransactionImplementation.afterCommit(KernelTransactionImplementation.java:541)
    at org.neo4j.kernel.impl.api.KernelTransactionImplementation.commit(KernelTransactionImplementation.java:482)
    at org.neo4j.kernel.impl.api.KernelTransactionImplementation.close(KernelTransactionImplementation.java:380)
    at org.neo4j.server.rest.transactional.TransitionalTxManagementKernelTransaction.commit(TransitionalTxManagementKernelTransaction.java:92)
    at org.neo4j.server.rest.transactional.TransactionHandle.closeContextAndCollectErrors(TransactionHandle.java:243)
    at org.neo4j.server.rest.transactional.TransactionHandle.commit(TransactionHandle.java:151)
    at org.neo4j.server.rest.web.TransactionalService.lambda$executeStatementsAndCommit$29(TransactionalService.java:202)
    at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:71)
    at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:57)
    at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:302)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1510)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
    at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

如果修复此错误,或者如果neo4j节点的属性值发生更改,还有其他方法可以更新索引吗?

2 个答案:

答案 0 :(得分:0)

您使用的是AWS ElasticSearch吗?它们不允许连接到单个节点。我在别处读过(来自AWS团队): "查看日志,似乎' i.s.c.config.discovery.NodeChecker'正在尝试自动发现并连接到群集的各个节点。亚马逊一直在努力改进服务功能,但不幸的是,目前AWS并不允许客户端连接到群集的各个节点。相反,您可以使用URL"

进行连接

您需要以某种方式关闭Jest客户端中的节点发现: ClientConfig clientConfig = new ClientConfig.Builder("http://localhost:9200").discoveryEnabled(false)

请参阅https://github.com/searchbox-io/Jest/blob/master/jest/README.md#node-discovery-through-nodes-api

答案 1 :(得分:0)

由于这是当您在Google上搜索此字符串时出现的少数页面之一,因此我想发表一个明确的说明(J. Dimeo的回答上面暗示了这一点,但并没有具体说明)。

在您的Graylog配置(对我来说是/etc/graylog/server/server.conf)中,将elasticsearch_discovery_enabled设置为false,然后重新发送服务。

就这样:)