【问题标题】:Have both Gremlin-Server AND NEO4J Server running at the same time同时运行 Gremlin-Server 和 NEO4J Server
【发布时间】:2018-03-16 03:54:32
【问题描述】:

目前看来我们不能同时运行 Neo4J Server 和 Gremlin Server。有什么办法可以同时运行吗?

  1. NEO4J 正在运行,我尝试启动 Gremlin Server,然后出现以下错误

java.lang.RuntimeException: GraphFactory 无法实例化它 图实现【类 org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph].......................(截断)

  1. Gremlin Server 正在运行,我尝试启动 NEO4J Server,然后出现以下错误

原因:org.neo4j.kernel.StoreLockException: Store 及其锁 文件已被另一个进程锁定: /home/galaxia/Documents/neo4j-gremlin/data/databases/graph.db/store_lock。 请确保没有其他进程正在使用此数据库,并且 目录是可写的(即使是只读访问也需要)


版本

  • Neo4J 3.3.1
  • Gremlin 3.3.1

【问题讨论】:

    标签: neo4j gremlin-server


    【解决方案1】:

    我意识到已经有一段时间了,但我终于想通了,并认为其他人应该知道。正如 Stephen Mallette 所说,您可以使用 Bolt 实现。要为 Gremlin Server 进行配置,请使用包含的 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
    

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

    【讨论】:

      【解决方案2】:

      您不能以这种方式一起运行它们(即嵌入式模式),但如果您愿意,应该可以一起运行它们:

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

      作为第三个选项的示例,给定 Neo4j 的默认 Gremlin Server 打包配置文件,您可以编辑 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 连接。

      【讨论】:

      • HA 没用,因为我是社区版,会试试 Bolt
      • Bolt 出自“SteelBridgeLabs”,是官方图书馆吗?
      • neo4j 不维护实现,我预计会比 HA 慢,但据我所知,只有这两种方法可以完成这项工作。
      • 尝试了一段时间的粗体插件,但没有找到任何方法将其与 TinkerPop Python API 一起使用。他们所做的螺栓实现是特定于 Java 的。有什么出路吗?
      • 如果您将 Gremlin Server 中的 bolt graph 实现配置为一个 graph 实例,那么 gremlin-python 将连接到 Gremlin Server 并使其可以使用所有图表(包括 bolt 一个)
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-12
      • 2019-07-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多