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

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

问题描述

我的项目是Java,我创建了一个到我的Neo4j数据库的嵌入式连接,并添加了一个bolt连接器,如下面的文档所述:



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



代码为:

  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();

根据Neo4j文档,我认为我现在可以使用基于浏览器的浏览器连接数据库了默认情况下,Neo4j Embedded不会暴露Bolt连接器,但你可以启用它。这样做可以让你将服务Neo4j Browser连接到你的嵌入式实例。但是,如果我运行代码,虽然我能够以编程方式执行我需要的所有操作,但我无法访问浏览器 localhost:7474 localhost:7687



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



<编辑:
我已经在使用螺栓驱动程序库

解决方案

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



我设法让Neo4j浏览器连接并使用嵌入式实例,首先启动一个Neo4j服务器(独立)实例单独使用我的Web浏览器缓存Neo4j浏览器。然后在Neo4j浏览器设置下检查可用时使用螺栓协议设置并将螺栓主机设置为我的嵌入式实例的地址。然后关闭独立服务器实例。我不知道它是否是受支持的方法,但似乎对我来说效果不错。



我还没有配置我的嵌入式实例来使用身份验证。


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天全站免登陆