neo4j:如何更改数据库存储位置? [英] neo4j: How do I change the database storage location?

查看:1752
本文介绍了neo4j:如何更改数据库存储位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用自定义Java应用程序创建了neo4j数据库,并尝试更改配置文件中的路径以连接到创建的数据库.

Hi I created a neo4j database with custom java application and tried to change path in configuration file in order to connect to created database.

尝试在webadmin控制台中检查数据时,仅节点0是可见的(似乎数据库为空).我试图将相同的数据库导入Gephi,但它不是空的.

While trying to check the data in webadmin console only node 0 is visible (seems that the database is empty). I tried to import the same database to Gephi and it's not empty.

此外,当我尝试切换回原始数据库(该数据库也不为空)时,在webadmin中仅出现了节点0.

Furthermore when I tried to switch back to the original database, which also wasn't empty, in webadmin only node 0 appeared.

我尝试通过以下方式修改neo4j-server.propertied文件:

I tried to modify the neo4j-server.propertied file the following way:

#*****************************************************************
# Administration client configuration
#*****************************************************************

# location of the servers round-robin database directory. possible values:
# - absolute path like /var/rrd
# - path relative to the server working directory like data/rrd
# - commented out, will default to the database data directory.
org.neo4j.server.webadmin.rrdb.location=data/rrd

# REST endpoint for the data API
# Note the / in the end is mandatory
#org.neo4j.server.webadmin.data.uri=/db/data/ #original database
org.neo4j.server.webadmin.data.uri="/db/mydatabase" #my database

# REST endpoint of the administration API (used by Webadmin)
org.neo4j.server.webadmin.management.uri=/db/manage/

# Low-level graph engine tuning file
org.neo4j.server.db.tuning.properties=conf/neo4j.properties

切换回原始数据库后(注释新路径并取消注释旧路径)

After switching back to the original database (commenting the new path and uncommenting the old)

org.neo4j.server.webadmin.data.uri=/db/data/ #original database
#org.neo4j.server.webadmin.data.uri="/db/mydatabase" #my database

旧的也似乎是空的.

是否有人知道如何设置路径以及在何处设置路径,以便在webadmin控制台中查看适当的数据库并能够在所需的数据库上执行查询?

Does anyone know how and where to set the path in order to see the appropriate database in the webadmin console and to be able to execute queries on the desired database?

谢谢!

推荐答案

您首先需要确认要连接的数据库已正确关闭(这意味着您不应获取正在运行的数据库的映像).

You first need confirm that the database you are connecting to was properly shut down (means you should not take the image of a running database).

如果您从文件中处于服务器模式,请设置数据库的位置

Set the location of the database if you are in server mode from the file

conf/neo4j-server.properties

通过编辑以下行.

org.neo4j.server.database.location=data/graph.db

如果您使用的是嵌入式neo4j,则可以在实例化GraphDatabaseService的同时设置数据库的位置,如下所示:

if you are using embedded neo4j you can set the location of your db while instantaniating the GraphDatabaseService as under:

new EmbeddedGraphDatabase("Path To Db Directory");

这篇关于neo4j:如何更改数据库存储位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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