Neo4j AVERTISSEMENT: Max 1024 fichiers ouverts autorisés, minimum de 40 000 recommandée. Voir le manuel de Neo4j

J'ai installé Neo4j sur Ubuntu 12.04 à l'aide de ces instructions: http://www.neo4j.org/download/linux

wget -O - http://debian.neo4j.org/neotechnology.gpg.key | apt-key add - 
echo 'deb http://debian.neo4j.org/repo stable/' > /etc/apt/sources.list.d/neo4j.list
apt-get update
apt-get install neo4j

J'ai fait en sorte d'avoir le droit de jdk:

root@precise64:~# java -version
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)

Et quand je le démarrage de neo4j, j'obtiens cette erreur:

AVERTISSEMENT: Max 1024 fichiers ouverts autorisés, minimum de 40 000 recommandée.
Voir la Neo4j manuel.

J'ai donc suivi les instructions ici: http://docs.neo4j.org/chunked/1.6.2/configuration-linux-notes.html

Et d'ajouter ces contenus à /etc/security/limits.conf

neo4j   soft    nofile  40000
neo4j   hard    nofile  40000

Et décommentez cette ligne dans /etc/pam.d/su

session    required   pam_limits.so

Après je redémarre le serveur, j'ai valider la nouvelle limite

neo4j@precise64:~$ ulimit -n
40000

Puis j'ai redémarrer mon serveur. J'obtiens toujours la même erreur lors du démarrage.

root@precise64:~# service neo4j-service start
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 [3161]... waiting for server to be ready....... OK.
http://localhost:7474/is ready.

Même si le service est en cours d'exécution comme le neo4j utilisateur:

root@precise64:~# ps -ef | grep 3161
neo4j     3161     1  2 17:43 pts/0    00:00:10 /usr/bin/java -cp /var/lib/neo4j/lib/concurrentlinkedhashmap-lru-1.3.1.jar:/var/lib/neo4j/lib/geronimo-jta_1.1_spec-1.1.1.jar:/var/lib/neo4j/lib/lucene-core-3.6.2.jar:/var/lib/neo4j/lib/neo4j-cypher-2.0.0.jar:/var/lib/neo4j/lib/neo4j-cypher-commons-2.0.0.jar:/var/lib/neo4j/lib/neo4j-cypher-compiler-1.9-2.0.0.jar:/var/lib/neo4j/lib/neo4j-cypher-compiler-2.0-2.0.0.jar:/var/lib/neo4j/lib/neo4j-graph-algo-2.0.0.jar:/var/lib/neo4j/lib/neo4j-graph-matching-2.0.0.jar:/var/lib/neo4j/lib/neo4j-jmx-2.0.0.jar:/var/lib/neo4j/lib/neo4j-kernel-2.0.0.jar:/var/lib/neo4j/lib/neo4j-lucene-index-2.0.0.jar:/var/lib/neo4j/lib/neo4j-shell-2.0.0.jar:/var/lib/neo4j/lib/neo4j-udc-2.0.0.jar:/var/lib/neo4j/lib/org.apache.servicemix.bundles.jline-0.9.94_1.jar:/var/lib/neo4j/lib/parboiled-core-1.1.6.jar:/var/lib/neo4j/lib/parboiled-scala_2.10-1.1.6.jar:/var/lib/neo4j/lib/scala-library-2.10.3.jar:/var/lib/neo4j/lib/server-api-2.0.0.jar:/var/lib/neo4j/system/lib/asm-3.1.jar:/var/lib/neo4j/system/lib/bcprov-jdk16-140.jar:/var/lib/neo4j/system/lib/commons-beanutils-1.8.0.jar:/var/lib/neo4j/system/lib/commons-beanutils-core-1.8.0.jar:/var/lib/neo4j/system/lib/commons-collections-3.2.1.jar:/var/lib/neo4j/system/lib/commons-compiler-2.6.1.jar:/var/lib/neo4j/system/lib/commons-configuration-1.6.jar:/var/lib/neo4j/system/lib/commons-digester-1.8.1.jar:/var/lib/neo4j/system/lib/commons-io-1.4.jar:/var/lib/neo4j/system/lib/commons-lang-2.4.jar:/var/lib/neo4j/system/lib/commons-logging-1.1.1.jar:/var/lib/neo4j/system/lib/jackson-core-asl-1.9.7.jar:/var/lib/neo4j/system/lib/jackson-jaxrs-1.9.7.jar:/var/lib/neo4j/system/lib/jackson-mapper-asl-1.9.7.jar:/var/lib/neo4j/system/lib/janino-2.6.1.jar:/var/lib/neo4j/system/lib/javax.servlet-3.0.0.v201112011016.jar:/var/lib/neo4j/system/lib/jcl-over-slf4j-1.6.1.jar:/var/lib/neo4j/system/lib/jersey-core-1.9.jar:/var/lib/neo4j/system/lib/jersey-multipart-1.9.jar:/var/lib/neo4j/system/lib/jersey-server-1.9.jar:/var/lib/neo4j/system/lib/jetty-http-9.0.5.v20130815.jar:/var/lib/neo4j/system/lib/jetty-io-9.0.5.v20130815.jar:/var/lib/neo4j/system/lib/jetty-security-9.0.5.v20130815.jar:/var/lib/neo4j/system/lib/jetty-server-9.0.5.v20130815.jar:/var/lib/neo4j/system/lib/jetty-servlet-9.0.5.v20130815.jar:/var/lib/neo4j/system/lib/jetty-util-9.0.5.v20130815.jar:/var/lib/neo4j/system/lib/jetty-webapp-9.0.5.v20130815.jar:/var/lib/neo4j/system/lib/jetty-xml-9.0.5.v20130815.jar:/var/lib/neo4j/system/lib/jsr311-api-1.1.2.r612.jar:/var/lib/neo4j/system/lib/logback-access-1.0.9.jar:/var/lib/neo4j/system/lib/logback-classic-1.0.9.jar:/var/lib/neo4j/system/lib/logback-core-1.0.9.jar:/var/lib/neo4j/system/lib/mimepull-1.6.jar:/var/lib/neo4j/system/lib/neo4j-browser-2.0.0.jar:/var/lib/neo4j/system/lib/neo4j-server-2.0.0-static-web.jar:/var/lib/neo4j/system/lib/neo4j-server-2.0.0.jar:/var/lib/neo4j/system/lib/rhino-1.7R3.jar:/var/lib/neo4j/system/lib/rrd4j-2.0.7.jar:/var/lib/neo4j/system/lib/slf4j-api-1.6.2.jar:/var/lib/neo4j/conf/-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 -Dneo4j.home=/var/lib/neo4j -Dneo4j.instance=/var/lib/neo4j -Dfile.encoding=UTF-8 org.neo4j.server.Bootstrapper
root      3238  2056  0 17:49 pts/0    00:00:00 grep --color=auto 3161

Donc je pense que peut-être le démarrage du service en tant que root est le problème, j'ai donc l'éteindre et de le démarrer comme neo4j utilisateur.

root@precise64:~# service neo4j-service stop
root@precise64:~# su - neo4j 
neo4j@precise64:~$ service neo4j-service start
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 [3435]... waiting for server to be ready....... OK.
http://localhost:7474/is ready.
cp: cannot create regular file `/var/run/neo4j.pid': Permission denied

Et il échoue parce que le pid fichier ne peut être créé. Ce qui je suppose signifie que ce n'est pas la bonne approche, mais je vais de l'avant et modifier /etc/init.d/neo4j-service pour modifier l'emplacement du fichier pid pour le dossier home de l'neo4j utilisateur:

#PIDFILE=/var/run/$NAME.pid
PIDFILE=/var/lib/neo4j/$Name.pid

Et puis les choses démarrage sans erreur quand je lance le service comme Neo4j de l'utilisateur.

Donc, ma question est: Quel est le comportement voulu? Devrait commencer le service en tant que root travailler aussi longtemps que le neo4j utilisateur a le bon ulimit autorisations, ou dois-je modifier le script de démarrage/d'autorisations pour permettre à l'neo4j utilisateur de créer du fichier PID?

  • Il appartient sur le Serveur Faute, mais je vais juste aller de l'avant et de vous dire que vous êtes censé commencer services en tant que root, que PAM paramètres de session intentionnellement ne s'appliquent pas aux services (parce que chaque démon pourrait avoir besoin de ses propres, différentes de ce que l'utilisateur sessions get), et que la bonne façon de traiter cette question est de mettre ulimit -n 40000 en /etc/init.d/neo4j-service (juste avant la commande qui démarre le démon).
InformationsquelleAutor Dave Kerber | 2014-01-04