简体   繁体   English

同时运行 Gremlin-Server 和 NEO4J Server

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

Current it seems we cannot run both Neo4J Server and Gremlin Server at the same time.目前看来我们不能同时运行Neo4J 服务器Gremlin 服务器 Is there any way to have run both?有没有办法同时运行两者?

  1. NEO4J is running and I try to start to Gremlin Server then I get the following error NEO4J 正在运行,我尝试启动 Gremlin Server 然后我收到以下错误

java.lang.RuntimeException: GraphFactory could not instantiate this Graph implementation [class org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph].......................(truncated) java.lang.RuntimeException: GraphFactory 无法实例化这个 Graph 实现 [class org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph]........................ ..(截断)

  1. Gremlin Server is running and I try to start NEO4J Server then I get the following error Gremlin 服务器正在运行,我尝试启动 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.引起:org.neo4j.kernel.StoreLockException:Store 及其锁文件已被另一个进程锁定:/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)请确保没有其他进程正在使用此数据库,并且该目录是可写的(即使是只读访问也需要)


Versions版本

  • Neo4J 3.3.1 Neo4J 3.3.1
  • Gremlin 3.3.1小精灵 3.3.1

I realize it has been a while, but I finally figured this out and thought others should know.我意识到已经有一段时间了,但我终于明白了这一点,并认为其他人应该知道。 As Stephen Mallette said, you can use the Bolt implementation.正如 Stephen Mallette 所说,您可以使用 Bolt 实现。 To configure this for Gremlin Server, use the included gremlin-server-neo4j.yaml file and make the following change:要为 Gremlin Server 配置它,请使用包含的gremlin-server-neo4j.yaml文件并进行以下更改:

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

Then create the neo4j-bolt.properties file with this content:然后使用以下内容创建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

Remember to replace the password, and any other property with the correct values.请记住用正确的值替换密码和任何其他属性。

You cannot run them together that way (ie embedded mode), but it should be possible to run them together, if you either:您不能以这种方式一起运行它们(即嵌入模式),但是如果您选择以下任一方式,则应该可以一起运行它们:

  1. Configure the Neo4j graph in Gremlin Server to use HA mode as described here在 Gremlin Server 中配置 Neo4j 图以使用此处所述的 HA 模式
  2. Configure the Neo4j graph in Gremlin Server to use the Bolt implementation found here在 Gremlin Server 中配置 Neo4j 图以使用此处找到的 Bolt 实现
  3. Enable the Bolt protocol in the Neo4j properties file provided to Gremlin Server.在提供给 Gremlin 服务器的 Neo4j 属性文件中启用 Bolt 协议。

As an example of the third option, given the default Gremlin Server packaged configuration files for Neo4j, you can edit conf/neo4j-empty.properties to include:作为第三个选项的示例,给定默认的 Gremlin Server 打包的 Neo4j 配置文件,您可以编辑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

and then start Gremlin Server with bin/gremlin-server.sh conf/gremlin-server-neo4j.yaml at which point you can use standard TinkerPop drivers as well as standard Bolt connectivity against the same graph instance.然后使用bin/gremlin-server.sh conf/gremlin-server-neo4j.yaml启动 Gremlin 服务器,此时您可以使用标准 TinkerPop 驱动程序以及针对同一图形实例的标准 Bolt 连接。

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

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