简体   繁体   English

将Neo4j添加到Gremlin Server-如何?

[英]Add Neo4j to Gremlin Server - how to?

I have downloaded Gremlin Server with an intention of being able to use Gremlin to traverse a Neo4j DB. 我已经下载了Gremlin Server,目的是能够使用Gremlin遍历Neo4j DB。

Now, speaking of the latter, it has to be somehow added to the Gremlin Server installation, but I have difficulty finding any up-to-date guidance on how to do that. 现在,谈到后者,必须以某种方式将其添加到Gremlin Server安装中,但是我很难找到有关如何执行此操作的最新指南。 There are a few posts here on SO describing various kinds of problems people run into, but no definitive solution, much less one for the current versions of both Tinkerpop and Neo4j. 在SO上有几篇文章描述了人们遇到的各种问题,但没有确定的解决方案,更不用说针对Tinkerpop和Neo4j的当前版本了。

Would appreciate specific links, tips etc. 将不胜感激具体的链接,提示等。

Thanks! 谢谢!

There is a "TIP" describing Gremlin Server configuration in the TinkerPop reference documentation found here . 此处找到的TinkerPop参考文档中,有一个“提示”描述了Gremlin服务器的配置。 Basically, you -install Neo4j dependencies: 基本上,您可以-install Neo4j依赖项:

bin/gremlin-server.sh install org.apache.tinkerpop neo4j-gremlin 3.3.4

then you edit your Gremlin Server YAML configuration file to connect to your database. 然后您编辑Gremlin Server YAML配置文件以连接到数据库。 Gremlin Server contains a sample file to get you started and is found the /conf directory of the installation. Gremlin Server包含一个示例文件 ,可以帮助您入门,并且位于安装的/conf目录中。 Of critical note is this entry: 需要特别注意的是该条目:

graphs: {
  graph: conf/neo4j-empty.properties}

It specifies the Neo4j configuration to use and the sample one that ships with Gremlin Server looks like this: 它指定了要使用的Neo4j配置,Gremlin Server随附的示例之一如下所示:

gremlin.graph=org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph
gremlin.neo4j.directory=/tmp/neo4j
gremlin.neo4j.conf.dbms.auto_index.nodes.enabled=true
gremlin.neo4j.conf.dbms.auto_index.relationships.enabled=true

As you can see, the configuration basically just passes through Neo4j specific configuration to Neo4j itself. 如您所见,配置基本上只是将Neo4j特定的配置传递给Neo4j本身。 Only the first two lines are TinkerPop options. 只有前两行是TinkerPop选项。 In this case, it sets up Neo4j for embedded mode, meaning Neo4j runs within the Gremlin Server JVM. 在这种情况下,它将Neo4j设置为嵌入式模式,这意味着Neo4j在Gremlin Server JVM中运行。 You can make Gremlin Server part of a Neo4j HA cluster with instructions found in the reference documentation here . 你可以做一个Neo4j的HA群集的小鬼服务器部分和参考文档中找到说明这里

Note that you asked for "current" versions of both TinkerPop and Neo4j. 请注意,您需要TinkerPop和Neo4j的“当前”版本。 While these instructions are current for TinkerPop, I'm afraid that the Neo4j version TinkerPop supports is well behind their latest release. 虽然这些说明适用于TinkerPop,但恐怕TinkerPop支持的Neo4j版本远远落后于其最新版本。 It would be nice if someone had time to issue a pull request for that. 如果有人有时间为此发出拉动请求,那就太好了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM