possible to connect to multiple neo4j databases via bulbs/Rexster?

大兔子大兔子 提交于 2019-12-21 21:23:51

问题


I would like to be able to specify the neo4j (2.0+) database folder when I open a connection to a graph using bulbs. The goal is to be able to open different or multiple neo4j databases (folders in data/) on the same machine without starting the neo4j server. This works with the Gremlin console. I suspect the route to doing this with bulbs would be to use the bulbs Rexster client (http://bulbflow.com/docs/api/bulbs/rexster/client/) and somehow automatically start a Rexster server pointing to the folder. Has anybody done this or can anyone contribute advice toward such goals?

many thanks


回答1:


Bulbs was designed to make it easy to work with multiple graph databases.

Configure your rexster.xml for each Neo4j database you want to run (each will have a different name and thus a different URL path), and then create a separate Bulbs Config and Graph object for each database:

>>> from bulbs.rexster import Graph, Config
>>>
>>> config = Config('http://localhost:8182/graphs/somegraph')
>>> g1 = Graph(config)
>>>
>>> config = Config('http://localhost:8182/graphs/anothergraph')
>>> g2 = Graph(config)

Here are the relevant docs...

  • Rexster Configuration (rexster.xml)

    https://github.com/tinkerpop/rexster/wiki/Rexster-Configuration

  • Rexster/Neo4j2 Configuration

    https://github.com/tinkerpop/rexster/wiki/Specific-Graph-Configurations#neo4j2

  • Bulbs Config

    http://bulbflow.com/docs/api/bulbs/config/



来源:https://stackoverflow.com/questions/24315615/possible-to-connect-to-multiple-neo4j-databases-via-bulbs-rexster

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