1

在按照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 服务器可能无法启动,请检查日志”。

索引版本已更改,连接升级

/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 服务?

4

1 回答 1

0

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

于 2013-07-05T06:42:25.560 回答