Neo4j 服务器锁定数据库。为什么?
我刚刚开始探索 Neo4j 的世界,并偶然发现了一个问题,我有问题需要解决。
我安装了 Neo4j 并通过 bin/neo4j start 启动它。
在接下来的步骤中,我编写了一个 ruby 脚本,在安装 jruby 和 neo4j gem 后创建新节点。一切都很好,直到这里。
这里描述了如何开始: http://wiki.neo4j.org/content/Getting_Started_With_Ruby
我的问题:服务器启动时我尝试创建节点,Neo4j 响应数据库已锁定。当我停止服务器时,节点就会被创建。
我习惯了关系数据库,所以我不理解这种行为。
当我通过 Neo4j Webadmin 工具 (http://localhost:7474/webadmin
) 检查服务器信息时,ReadOnly 标志设置为 false。
在我看来,Neo4j 方法可能与关系数据库不同,这意味着服务器可能有比数据库服务器稍有其他的用途。
感谢您的任何建议, 托比亚斯
I just started to discover the world of Neo4j and stumbled right into an issue, I have problems to grasp.
I installed Neo4j and started it via bin/neo4j start
.
In the next steps I wrote a ruby script that creates new nodes, after installing jruby and the neo4j gem. Everything fine until here.
How to get started is decribed here:
http://wiki.neo4j.org/content/Getting_Started_With_Ruby
My Problem: When the server is started and I try to creates nodes, Neo4j responds that the database is locked. When I stop the server the nodes get created.
I am used to relational databases, so I don´t understand this behaviour.
When I check the Server Info via the Neo4j Webadmin Tool (http://localhost:7474/webadmin
) the ReadOnly flag is set to false.
It seems to me that the Neo4j approach is maybe different from relational db, meaning the server could maybe have a slightly other purpose then a db server.
Thanks for any advices,
Tobias
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
JRuby 绑定将启动它自己的 Neo4j 实例,这意味着您最终将有两个数据库实例尝试使用相同的文件。
该方法有些不同,但关系数据库也使用它,例如 Apache Derby。与 Neo4j 一样,您可以将其嵌入到应用程序中(这就是 JRuby 绑定在您的情况下所做的事情)或将其作为独立服务器运行。
所以不要自己启动服务器,这应该可以解决问题。
The JRuby bindings will start it's own Neo4j instance, meaning that you will end up having two database instances trying to use the same files.
The approach is somewhat different, but relational databases use it as well, for example Apache Derby. As with Neo4j, you can either embed it in your application (that is what the JRuby bindings are doing in your case) or run it as a standalone server.
So just don't start a server yourself, that should solve the problem.