同时拥有 Gremlin-Server 和 NEO4J Server 运行

Have both Gremlin-Server AND NEO4J Server running at the same time

目前看来我们不能同时运行Neo4J ServerGremlin Server。有没有什么办法可以让 运行 两者兼得?

  1. NEO4J 正在 运行ning 并且我尝试启动 Gremlin 服务器然后我收到以下错误

java.lang.RuntimeException: GraphFactory could not instantiate this Graph implementation [class org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph].......................(truncated)

  1. Gremlin 服务器正在 运行ning 并且我尝试启动 NEO4J 服务器然后我收到以下错误

Caused by: org.neo4j.kernel.StoreLockException: Store and its lock file has been locked by another process: /home/galaxia/Documents/neo4j-gremlin/data/databases/graph.db/store_lock. Please ensure no other process is using this database, and that the directory is writable (required even for read-only access)


版本

你不能 运行 以这种方式将它们放在一起(即嵌入式模式),但应该可以 运行 将它们放在一起,如果你:

  1. 在 Gremlin 服务器中配置 Neo4j 图形以使用 HA 模式,如所述here
  2. 在 Gremlin 服务器中配置 Neo4j 图形以使用找到的 Bolt 实现 here
  3. 在提供给 Gremlin 服务器的 Neo4j 属性文件中启用 Bolt 协议。

作为第三个选项的示例,给定 Neo4j 的默认 Gremlin 服务器打包配置文件,您可以编辑 conf/neo4j-empty.properties 以包括:

gremlin.graph=org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph
gremlin.neo4j.directory=/tmp/neo4j
gremlin.neo4j.conf.dbms.connector.0.type=BOLT
gremlin.neo4j.conf.dbms.connector.0.enabled=true
gremlin.neo4j.conf.dbms.connector.0.address=localhost:7687

然后使用 bin/gremlin-server.sh conf/gremlin-server-neo4j.yaml 启动 Gremlin 服务器,此时您可以使用标准 TinkerPop 驱动程序以及针对同一图形实例的标准 Bolt 连接。

我意识到这已经有一段时间了,但我终于 弄明白了这一点并且认为其他人应该知道。正如 Stephen Mallette 所说,您可以使用 Bolt 实现。要为 Gremlin 服务器配置此项,请使用包含的 gremlin-server-neo4j.yaml 文件并进行以下更改:

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

然后使用以下内容创建 neo4j-bolt.properties 文件:

gremlin.graph=com.steelbridgelabs.oss.neo4j.structure.Neo4JGraph
#neo4j.graph.name=graph.db
neo4j.identifier=dummy
neo4j.url=bolt://localhost:7687
neo4j.username=neo4j
neo4j.password=<password>
neo4j.readonly=false
neo4j.vertexIdProvider=com.steelbridgelabs.oss.neo4j.structure.providers.Neo4JNativeElementIdProvider
neo4j.edgeIdProvider=com.steelbridgelabs.oss.neo4j.structure.providers.Neo4JNativeElementIdProvider

记得用正确的值替换密码和任何其他 属性。