我正在使用Janus Graph doc并按照提及的方式将其解压缩。
./gremlin.sh
工作正常,它会启动Gremlin提示。
此代码也可以正常使用
graph = JanusGraphFactory.open('inmemory')
g = graph.traversal()
问题
当我这样做时,我得到一个巨大的堆栈跟踪
graph = JanusGraphFactory.open('conf/janusgraph-berkeleyje-es.properties')
gremlin> graph = JanusGraphFactory.open('conf/janusgraph-berkeleyje-es.properties')
12:15:49 WARN org.janusgraph.diskstorage.es.rest.RestElasticSearchClient - Unable to determine Elasticsearch server version. Default to FIVE.
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:171)
at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:145)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:348)
at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:192)
at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64)
at java.lang.Thread.run(Thread.java:748)
Could not instantiate implementation: org.janusgraph.diskstorage.es.ElasticSearchIndex
Type ':help' or ':h' for help.
Display stack trace? [yN]
答案 0 :(得分:5)
从JanusGraph 0.2.0开始,您无法将Elasticsearch作为嵌入式节点运行,因此您需要启动Elasticsearch节点。您可以下载并部署自己的Elasticsearch node,也可以利用JanusGraph pre-packaged distribution:
bin/janusgraph.sh start
此命令将启动一个Cassandra节点,一个Elasticsearch节点和一个Gremlin Server。请注意,您需要Java Development Kit(JDK)才能运行此命令。
或者,您可以从JanusGraph预打包发行版中启动唯一的Elasticsearch节点:
elasticsearch/bin/elasticsearch
将在前台启动Elasticsearch。