嗨,我创建了一个带有自定义Java应用程序的neo4j数据库,并尝试更改配置文件中的路径以连接到创建的数据库。
尝试在webadmin控制台中检查数据时,仅可见节点0(似乎数据库为空)。我试图将相同的数据库导入Gephi,但它不是空的。
此外,当我尝试切换回原始数据库(该数据库也不为空)时,在webadmin中,仅出现节点0。
我尝试通过以下方式修改neo4j-server.propertied文件:
#*****************************************************************
# 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
切换回原始数据库后(注释新路径并取消注释旧路径)
org.neo4j.server.webadmin.data.uri=/db/data/ #original database
#org.neo4j.server.webadmin.data.uri="/db/mydatabase" #my database
旧的也似乎是空的。
有谁知道如何设置路径以及在何处设置路径,以便在webadmin控制台中查看适当的数据库并能够在所需的数据库上执行查询?
谢谢!
最佳答案
首先,您需要确认要连接的数据库已正确关闭(这意味着您不应获取正在运行的数据库的镜像)。
如果您从文件中处于服务器模式,请设置数据库的位置
conf/neo4j-server.properties
通过编辑以下行。
org.neo4j.server.database.location=data/graph.db
如果您使用的是嵌入式neo4j,则可以在实例化GraphDatabaseService的同时设置数据库的位置,如下所示:
new EmbeddedGraphDatabase("Path To Db Directory");