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

人盡茶涼 提交于 2019-12-10 11:18:46

问题


Current it seems we cannot run both Neo4J Server and Gremlin Server at the same time. 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

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

  1. Gremlin Server is running and I try to start NEO4J Server then I get the following error

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)


Versions

  • Neo4J 3.3.1
  • Gremlin 3.3.1

回答1:


You cannot run them together that way (i.e. 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
  2. Configure the Neo4j graph in Gremlin Server to use the Bolt implementation found here
  3. Enable the Bolt protocol in the Neo4j properties file provided to Gremlin Server.

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.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.




回答2:


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. To configure this for Gremlin Server, use the included gremlin-server-neo4j.yaml file and make the following change:

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

Then create the neo4j-bolt.properties file with this content:

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.



来源:https://stackoverflow.com/questions/49312940/have-both-gremlin-server-and-neo4j-server-running-at-the-same-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!