使用螺栓连接器运行嵌入式连接时访问 neo4j 浏览器 [英] Access the neo4j browser while running an embedded connection with a bolt connector

查看:15
本文介绍了使用螺栓连接器运行嵌入式连接时访问 neo4j 浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目是用 Java 编写的,我创建了一个到 Neo4j 数据库的嵌入式连接,并向其添加了一个bolt"连接器,如文档中所述:

http://neo4j.com/docs/java-reference/current/#tutorials-java-embedded

代码是:

GraphDatabaseSettings.BoltConnector bolt = GraphDatabaseSettings.boltConnector("0");graphDb = 新 GraphDatabaseFactory().newEmbeddedDatabaseBuilder(new File("C:/.../default.graphdb")).setConfig(bolt.enabled, "true").setConfig(bolt.address, "localhost:7687").newGraphDatabase();

根据 Neo4j 文档,我认为我现在可以使用基于默认情况下,Neo4j Embedded 不公开 Bolt 连接器,但您可以启用它的浏览器"连接到数据库.这样做允许您连接为您的嵌入式实例提供 Neo4j 浏览器服务."但是,如果我运行代码,虽然我能够以编程方式执行所有我需要的操作,但我无法通过 localhost:7474localhost:7687>

我的问题是:这真的只是措辞不当的文档,这实际上不是受支持的功能吗?或者是否有一种未公开的方式通过代码中创建的螺栓连接连接到数据库,允许我在运行嵌入式连接时使用 Neo4j 浏览器查看数据?

我已经在使用 bolt 驱动程序库

解决方案

您需要将 neo4j-bolt-3.0.3 jar 放在代码执行的工作目录中,以便 Neo4j 可以加载它.Bolt 连接器是一个内核扩展.

我首先单独启动 Neo4j 服务器(独立)实例并让我的 Web 浏览器缓存 Neo4j 浏览器,从而设法让 Neo4j 浏览器连接并与嵌入式实例一起工作.然后在 Neo4j 浏览器设置下检查可用时使用 Bolt 协议"设置并将Bolt 主机"设置为我的嵌入式实例的地址.然后关闭独立服务器实例.我不知道这是否是受支持的方法,但似乎对我来说效果很好.

我尚未将嵌入式实例配置为使用身份验证.

My project is in Java, and I create an embedded connection to my Neo4j database and add a "bolt" connector to it as described in the documentation here:

http://neo4j.com/docs/java-reference/current/#tutorials-java-embedded

the code is:

GraphDatabaseSettings.BoltConnector bolt = GraphDatabaseSettings.boltConnector("0");

graphDb = new GraphDatabaseFactory()
    .newEmbeddedDatabaseBuilder(new File("C:/.../default.graphdb"))
    .setConfig(bolt.enabled, "true")
    .setConfig(bolt.address, "localhost:7687")
    .newGraphDatabase();

According to the Neo4j documentation I would think that I could now connect to the database using the browser based on "By default, Neo4j Embedded does not expose a Bolt connector, but you can enable one. Doing so allows you to connect the services Neo4j Browser to your embedded instance." However, if I run the code, while I am able to programmatically perform all that I need to, I cannot access the browser at localhost:7474 nor localhost:7687

My question is: Is this just really poorly worded documentation and this is not actually a supported capability? Or is there an undocumented way of connecting to the database through the bolt connection created in the code that would allow me to view the data using the Neo4j browser while running my embedded connection?

Edit: I am already using the bolt driver library

解决方案

You need to place the neo4j-bolt-3.0.3 jar in the working directory where your code is executing so that Neo4j can load it. The Bolt connector is a kernel extension.

I managed to get the Neo4j Browser to connect and work with the embedded instance, by first starting up a Neo4j server (standalone) instance separately and having my web browser cache the Neo4j Browser. Then under the Neo4j Browser settings checking the "Use Bolt protocol when available" setting and setting "Bolt host" to the address of my embedded instance. Then shutting down the standalone server instance. I don't know if it is the supported approach, but seems to work well enough for me.

I have not configured my embedded instance to use authentication.

这篇关于使用螺栓连接器运行嵌入式连接时访问 neo4j 浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆