如何从Debian软件包启动neo4j服务?

时间:2013-07-03 11:24:22

标签: debian neo4j

按照debian.neo4j.org的说明下载Debian软件包后,我正在努力在Debian上安装neo4j。

Neo4j似乎自行安装,但120秒后服务无法启动。

无法在120秒内启动

以下是apt-get:

的输出
root@turing:/home/iain# apt-get install neo4j
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  neo4j
0 upgraded, 1 newly installed, 0 to remove and 20 not upgraded.
Need to get 0 B/37.5 MB of archives.
After this operation, 57.8 MB of additional disk space will be used.
Selecting previously deselected package neo4j.
(Reading database ... 22082 files and directories currently installed.)
Unpacking neo4j (from .../archives/neo4j_1.9.1_all.deb) ...
Processing triggers for man-db ...
Setting up neo4j (1.9.1) ...
Adding system user `neo4j' (UID 106) ...
Adding new user `neo4j' (UID 106) with group `nogroup' ...
Not creating home directory `/var/lib/neo4j'.
Running in headless (-h) mode
Installing with user neo4j
update-rc.d: using dependency based boot sequencing
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...process [21881]... waiting for server to be ready................................................................................................................................. Failed to start within 120 seconds.
Neo4j Server may have failed to start, please check the logs.
invoke-rc.d: initscript neo4j-service, action "start" failed.
dpkg: error processing neo4j (--configure):
 subprocess installed post-installation script returned error exit status 1
configured to not write apport reports
                                      Errors were encountered while processing:
 neo4j
E: Sub-process /usr/bin/dpkg returned an error code (1)

等待120秒后,安装失败并且输出包含消息“Neo4j服务器可能无法启动,请检查日志”。

索引版本已更改且connet已升级

/var/log/neo4j/console.log上有一个日志文件。

它包含一个很长的Java异常堆栈跟踪,但对我来说没什么用。

大多数异常消息都说“成功初始化但未能启动”。这是一个例子:

Component 'org.neo4j.kernel.extension.KernelExtensions@1d37992' was successfully initialized, but failed to start. Please see attached cause exception.

最终原因如下:

Caused by: org.neo4j.kernel.impl.storemigration.UpgradeNotAllowedByConfigurationException: Index version (managed by /var/lib/neo4j/data/graph.db/index/lucene-store.db) has changed and cannot be upgraded unless allow_store_upgrade=true is supplied in the configuration
        at org.neo4j.kernel.impl.index.IndexProviderStore.readRecordsWithNullDefaults(IndexProviderStore.java:133)
        at org.neo4j.kernel.impl.index.IndexProviderStore.<init>(IndexProviderStore.java:65)
        at org.neo4j.index.impl.lucene.LuceneDataSource.newIndexStore(LuceneDataSource.java:299)
        at org.neo4j.index.impl.lucene.LuceneDataSource.start(LuceneDataSource.java:223)
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:491)
        ... 20 more

UpgradeNotAllowedByConfigurationException指出“索引版本(由/var/lib/neo4j/data/graph.db/index/lucene-store.db管理)已更改,除非在配置中提供了allow_store_upgrade = true,否则无法升级

我正在尝试第一次安装,而不是尝试升级。我相信我使用的是Debian软件包确定的默认配置。

编辑:我解决了这个问题。有一个配置文件/etc/neo4j/neo4j.properties。它包含两行,如下所示:

# Enable this to be able to upgrade a store from 1.4 -> 1.5 or 1.4 -> 1.6
# allow_store_upgrade=true

当我取消注释第二行并尝试再次安装时,不会发生UpgradeNotAllowedByConfigurationException。

但是,安装仍会因超时而失败。

如何解决问题并启动neo4j服务?

1 个答案:

答案 0 :(得分:0)

之前我遇到过类似的问题,因为内存太小了。首先检查运行neo4j时可以使用的可用内存量。 neo4j应该至少有300MB。