Cherish
Cherish

Reputation: 21

Neo4j server failed to start in ubuntu virtual machine

I just want to use Neo4j server in a ubuntu virtual machine, I have installed oracle Java like below:

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)

and then when I try to start Neo4j server, it has error like this:

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.

and the log is:

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]

could someone give expert advice about this problem?

I have changed the limit follow the instructions in mannual help,and now run the command "ulimit -n" it will display 40960,but when I start neo4j service,it also have the warning "Max 1024 open files allowed, minimum of 40 000 recommended", if there need any other operation?

Upvotes: 0

Views: 1982

Answers (1)

remigio
remigio

Reputation: 4211

Neo4j requires more open files than the maximum limit imposed by most of Linux distributions. You should increase the limit adding the following lines to the /etc/security/limits.conf file:

neo4j   soft    nofile  40000
neo4j   hard    nofile  40000

You can also look at this link for more details.

Upvotes: 0

Related Questions