Neo4j服务器无法在ubuntu虚拟机中启动

时间:2013-12-13 11:46:59

标签: ubuntu neo4j

我只想在ubuntu虚拟机中使用Neo4j服务器,我已经安装了oracle Java,如下所示:

java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)  
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

然后当我尝试启动Neo4j服务器时,它有这样的错误:

WARNING: Max 1024 open files allowed, minimum of 40 000 recommended. See the Neo4j manual.
Using additional JVM arguments:  -server -XX:+DisableExplicitGC -Dorg.neo4j.server.properties=conf/neo4j-server.properties -Djava.util.logging.config.file=conf/logging.properties -Dlog4j.configuration=file:conf/log4j.properties -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled   
Starting Neo4j Server...WARNING: not changing user process [3337]... waiting for server to be ready.................... Failed to start within 120 seconds.
Neo4j Server may have failed to start, please check the logs.

,日志是:

2013-12-13 11:40:41.736+0000 INFO  [API] Setting startup timeout to: 120000ms based on -1
Detected incorrectly shut down database, performing recovery..
2013-12-13 11:40:55.719+0000 INFO  [API] Successfully started database
2013-12-13 11:40:56.279+0000 DEBUG [API] Unable to open rrd store, attempting to recreate it
2013-12-13 11:40:56.287+0000 DEBUG [API] current RRDB is invalid, renamed it to /vagrant/neo4j-community-2.0.0/data/rrd-invalid-1386934856281
2013-12-13 11:40:56.377+0000 DEBUG [API] Unable to create new rrd store
2013-12-13 11:40:56.447+0000 DEBUG [API] org.neo4j.server.ServerStartupException: Starting Neo4j Server failed: java.io.IOException: Invalid argument
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:209) ~[neo4j-server-2.0.0.jar:2.0.0]
at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:87) [neo4j-server-2.0.0.jar:2.0.0]
at org.neo4j.server.Bootstrapper.main(Bootstrapper.java:50) [neo4j-server-2.0.0.jar:2.0.0]
Caused by: java.lang.RuntimeException: java.io.IOException: Invalid argument
at org.neo4j.server.rrd.RrdFactory.createRrdb(RrdFactory.java:177) ~[neo4j-server-2.0.0.jar:2.0.0]
at org.neo4j.server.rrd.RrdFactory.recreateArchive(RrdFactory.java:235) ~[neo4j-server-2.0.0.jar:2.0.0]
at org.neo4j.server.rrd.RrdFactory.createRrdb(RrdFactory.java:156) ~[neo4j-server-2.0.0.jar:2.0.0]
at org.neo4j.server.rrd.RrdFactory.createRrdDbAndSampler(RrdFactory.java:84) ~[neo4j-server-2.0.0.jar:2.0.0]
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:161) ~[neo4j-server-2.0.0.jar:2.0.0]
... 2 common frames omitted
Caused by: java.io.IOException: Invalid argument
at sun.nio.ch.FileChannelImpl.map0(Native Method) ~[na:1.7.0_45]
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:874) ~[na:1.7.0_45]
at org.rrd4j.core.RrdNioBackend.mapFile(RrdNioBackend.java:64) ~[rrd4j-2.0.7.jar:na]
at org.rrd4j.core.RrdNioBackend.setLength(RrdNioBackend.java:87) ~[rrd4j-2.0.7.jar:na]
at org.rrd4j.core.RrdDb.<init>(RrdDb.java:148) ~[rrd4j-2.0.7.jar:na]
at org.rrd4j.core.RrdDb.<init>(RrdDb.java:101) ~[rrd4j-2.0.7.jar:na]
at org.neo4j.server.rrd.RrdFactory.createRrdb(RrdFactory.java:172) ~[neo4j-server-2.0.0.jar:2.0.0]
... 6 common frames omitted
2013-12-13 11:40:56.453+0000 DEBUG [API] Failed to start Neo Server on port [7474]

有人可以就此问题提供专家意见吗?

我按照mannual help中的说明更改了限制,现在运行命令“ulimit -n”它将显示40960,但是当我启动neo4j服务时,它还会显示警告“Max 1024 open files允许的,至少建议40 000“,如果还需要其他操作吗?

1 个答案:

答案 0 :(得分:0)

Neo4j需要比大多数Linux发行版规定的最大限制更多的打开文件。您应该增加限制,将以下行添加到/etc/security/limits.conf文件中:

neo4j   soft    nofile  40000
neo4j   hard    nofile  40000

您还可以查看this link了解详情。

相关问题