问题描述
我的neo4j-2.3.2社区数据库用完了磁盘空间(80G).我对它进行了彻底的关闭,然后添加了更多磁盘,并尝试将其备份,只是得到了一些隐秘的错误消息,并拒绝了它.
My neo4j-2.3.2-community database ran out of disk space (at 80G). I did a clean shutdown of it, then added more disk, and tried to start it back up, only to get cryptic error messages and have it refuse to start.
今天早晨,当我意识到磁盘已满并且不再接受任何插入时,我将其关闭.直到今天晚上,我才开始尝试将其恢复.对于关机和重新启动之间日志中的明显差距,我深表歉意.该数据库仍处于原型/概念验证阶段.在过去的一周左右的时间里,我一直在运行作业以在其中加载数据.我真的,真的不想重新开始该数据加载过程.这样太慢了.
I shut it down this morning when I realized the disk was full and it wasn't accepting any more inserts. I didn't get back to trying to bring it back up until this evening. I apologize for the apparent gap in the logs between the shutdown and restart. The database is still in a prototype/proof-of-concept phase. I've been running jobs to load data in it for the past week or so. I really, really don't want to have to start over with that data loading process. It is way too slow as it is.
我希望有人告诉我有一种"neo4j --force_repair"命令行选项可以解决问题.我的数据加载器足够聪明,可以在尝试加载新记录之前检查它已成功插入数据库中的最后一条记录,因此,如果丢失了一些记录,就可以了.
I'm hoping someone will tell me there is a "neo4j --force_repair" sort of command line option that will do the trick. My data loader is smart enough to check the last records it successfully inserted in the database before trying to load new records, so if we lose a few it should be ok.
这是我在console.log中看到的内容.
Here is what I see in the console.log.
2016-01-31 16:25:56.648+0000 INFO Successfully shutdown Neo4j Server
2016-01-31 16:25:56.810+0000 INFO Successfully stopped database
2016-01-31 16:25:56.811+0000 INFO Successfully shutdown database
2016-02-01 01:16:10.591+0000 INFO Successfully shutdown Neo4j Server
2016-02-01 01:16:10.593+0000 ERROR Failed to start Neo4j: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@2d9e9010' was successfully initialized, but failed to start. Please see attached cause exception. Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@2d9e9010' was successfully initialized, but failed to start. Please see attached cause exception.
org.neo4j.server.ServerStartupException: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@2d9e9010' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.server.exception.ServerStartupErrors.translateToServerStartupError(ServerStartupErrors.java:67)
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:234)
at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:97)
at org.neo4j.server.CommunityBootstrapper.start(CommunityBootstrapper.java:48)
at org.neo4j.server.CommunityBootstrapper.main(CommunityBootstrapper.java:35)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.server.database.LifecycleManagingDatabase@2d9e9010' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:462)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:194)
... 3 more
Caused by: java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.factory.CommunityFacadeFactory, /home/neo4j/neo4j-community-2.3.2/data/graph.db
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:143)
at org.neo4j.kernel.impl.factory.CommunityFacadeFactory.newFacade(CommunityFacadeFactory.java:43)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:108)
at org.neo4j.server.CommunityNeoServer$1.newGraphDatabase(CommunityNeoServer.java:66)
at org.neo4j.server.database.LifecycleManagingDatabase.start(LifecycleManagingDatabase.java:95)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452)
... 5 more
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.recovery.Recovery@4ec23a22' failed to initialize. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:434)
at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:66)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:102)
at org.neo4j.kernel.NeoStoreDataSource.start(NeoStoreDataSource.java:600)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
at org.neo4j.kernel.impl.transaction.state.DataSourceManager.start(DataSourceManager.java:112)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:139)
... 10 more
Caused by: java.lang.IllegalArgumentException: Unknown entry type -1 for version -1. At position LogPosition{logVersion=252, byteOffset=100663356} and entry version V2_1
at org.neo4j.kernel.impl.transaction.log.entry.LogEntryVersion.entryParser(LogEntryVersion.java:207)
at org.neo4j.kernel.impl.transaction.log.entry.VersionAwareLogEntryReader.readLogEntry(VersionAwareLogEntryReader.java:92)
at org.neo4j.kernel.impl.transaction.log.LogEntryCursor.next(LogEntryCursor.java:54)
at org.neo4j.kernel.recovery.LatestCheckPointFinder.find(LatestCheckPointFinder.java:77)
at org.neo4j.kernel.recovery.PositionToRecoverFrom.apply(PositionToRecoverFrom.java:53)
at org.neo4j.kernel.recovery.DefaultRecoverySPI.getPositionToRecoverFrom(DefaultRecoverySPI.java:135)
at org.neo4j.kernel.recovery.Recovery.init(Recovery.java:72)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:424)
... 19 more
推荐答案
这看起来好像只是部分写入了事务日志.如果是这样,则数据存储本身不太可能损坏.
This looks like the transaction logs have only been partially written. If that's true the datastore itself is unlikely to be corrupt.
警告:在data/graph.db
文件夹中进行任何手动更改之前,请确保已准备好备份副本.
WARNING: before doing any manual change in the data/graph.db
folder be sure to have a backup copy in place.
在继续之前,请阅读以上段落.备份了吗?如果是,请尝试通过rm neostore.transaction.db.*
删除data/graph.db
中的事务日志文件.尝试启动Neo4j.如果仍然无法启动,请粘贴包含最新启动顺序的data/graph.db/messages.log
片段-这应该会提供更多见解.
Before proceeding, read the above paragraph. Backup taken? If yes, try to remove the transaction log files in data/graph.db
by rm neostore.transaction.db.*
. Try to start Neo4j. If it still fails to start, paste a snippet of data/graph.db/messages.log
containing the latest startup sequence - this should give more insight.
这篇关于修复损坏的neo4j数据库(2.3.2社区)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!