如果OrientDB被某人重新启动而非正常关机,则OrientDB最终处于数据恢复失败的状态。有没有关于如何从这种非正常关机中优雅地恢复的建议?我们正在寻找系统在停电期间自行恢复的方法。
通用输出,正如许多人所见。
<DATE> WARNING {db=TestDb} segment file 'database.ocf' was not closed correctly last time [OSingleFileSegment]
<DATE> WARNING {db=TestDb} Storage TestDb was not closed properly. Will try to restore from write ahead log. [OLocalPaginatedStorage]
<DATE> INFO {db=TestDb} Looking for last checkpoint... [OLocalPaginatedStorage]
<DATE> INFO {db=TestDb} FULL checkpoint found. [OLocalPaginatedStorage]
<DATE> INFO {db=TestDb} Data restore procedure from full checkpoint is started. Restore is performed from LSN OLogSequenceNumber{segment=0, position=322830} [OLocalPaginatedStorage]
Record com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OCheckpointEndRecord{lsn=OLogSequenceNumber{segment=0, position=322854}} will be skipped during data restore. [OLocalPaginatedStorage]{db=TestDb} Exception during storage data restore.
java.lang.ArrayIndexOutOfBoundsException: 33
at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OAtomicUnitEndRecord.fromStream(OAtomicUnitEndRecord.java:59)
at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OWALRecordsFactory.fromStream(OWALRecordsFactory.java:121)
at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog.read(ODiskWriteAheadLog.java:1009)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.restoreFrom(OAbstractPaginatedStorage.java:2261)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.restoreFromFullCheckPoint(OAbstractPaginatedStorage.java:2231)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.restoreFromCheckPoint(OAbstractPaginatedStorage.java:2220)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.restoreFromWAL(OAbstractPaginatedStorage.java:2171)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.restoreIfNeeded(OAbstractPaginatedStorage.java:1493)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.open(OAbstractPaginatedStorage.java:154)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.open(ODatabaseDocumentTx.java:223)
at com.orientechnologies.orient.server.OServer.openDatabase(OServer.java:631)
at com.orientechnologies.orient.server.OServer.openDatabase(OServer.java:613)
at com.orientechnologies.orient.server.network.protocol.http.command.OServerCommandAuthenticatedDbAbstract.authenticate(OServerCommandAuthenticatedDbAbstract.java:167)
at com.orientechnologies.orient.server.network.protocol.http.command.OServerCommandAuthenticatedDbAbstract.beforeExecute(OServerCommandAuthenticatedDbAbstract.java:127)
at com.orientechnologies.orient.server.network.protocol.http.command.get.OServerCommandGetConnect.beforeExecute(OServerCommandGetConnect.java:50)
at com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpAbstract.service(ONetworkProtocolHttpAbstract.java:171)
at com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpAbstract.execute(ONetworkProtocolHttpAbstract.java:574)
at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:69)
<DATE> SEVERE {db=TestDb} Internal server error:
com.orientechnologies.orient.core.exception.OStorageException: Cannot open local storage '<location>/orientdb-enterprise-2.1-rc1/databases/TestDb' with mode=rw
答案 0 :(得分:0)
我在Nexus 3.10(内部使用OrientDB 2.2.X)上遇到了类似的问题,但是显然数据库现在可以正常恢复了,第一次连接时我会收到警告,但是第二次清理时会发出警告:>
[centos@localhost nexus-3.10.0-04]$ java -jar lib/support/nexus-orient-console.jar
OrientDB console v.2.2.31 (build 285537d2767275f460df32c6a3be01bfff6a517c, branch 2.2.x) https://www.orientdb.com
Type 'help' to display all the supported commands.
orientdb> connect plocal:/home/centos/nexus310/sonatype-work/nexus3/db/component admin admin
Connecting to database [plocal:/home/centos/nexus310/sonatype-work/nexus3/db/component] with user 'admin'...
2018-10-16 15:26:59:037 WARNI {db=component} Storage 'component' was not closed properly. Will try to recover from write ahead log...
2018-10-16 15:26:59:042 WARNI {db=component} Record com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OFuzzyCheckpointEndRecord{lsn=LSN{segment=61, position=2073}} will be skipped during data restore
2018-10-16 15:26:59:043 WARNI {db=component} Record OFuzzyCheckpointStartRecord{lsn=LSN{segment=61, position=2080}} com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OFuzzyCheckpointStartRecord{lsn=null, previousCheckpoint=LSN{segment=61, position=2033}} will be skipped during data restore
2018-10-16 15:26:59:043 WARNI {db=component} Record com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OFuzzyCheckpointEndRecord{lsn=LSN{segment=61, position=2120}} will be skipped during data restoreOK
orientdb {db=component}> exit
[centos@localhost nexus-3.10.0-04]$ java -jar lib/support/nexus-orient-console.jar
OrientDB console v.2.2.31 (build 285537d2767275f460df32c6a3be01bfff6a517c, branch 2.2.x) https://www.orientdb.com
Type 'help' to display all the supported commands.
orientdb> connect plocal:/home/centos/nexus310/sonatype-work/nexus3/db/component admin admin
Connecting to database [plocal:/home/centos/nexus310/sonatype-work/nexus3/db/component] with user 'admin'...OK
orientdb {db=component}>