升级 Neo4j 数据失败"logs contains entries with prefix 2"



我正在通过AWS上的Docker卷在Neo4j v3.5.11 CE上运行一个数据库。我想升级到4.4.9,所以我创建了一个的tar/graph.db并将其带回我的开发箱。我提取到/var/lib/neo4j/data/databases。我把它安装到neo4j v3.5.11容器上,它开始运行得很好。我可以通过localhost:7474查看所有数据。

接下来,我尝试通过:安装到neo4j v4.4.0

docker run -d -p 7474:7474 -p 7687:7687 -v /var/lib/neo4j/data:/var/lib/neo4j/data -v /var/lib/neo4j/plugins:/plugins -v /var/lib/neo4j/logs:/var/log/neo4j -e NEO4J_AUTH=none -e NEO4J_dbms_allow__upgrade=true --name neo4j  neo4j:4.0.0

Neo4j失败:"Transaction logs contains entries with prefix 2, and the highest supported prefix is 1. This indicates that the log files originates from a newer version of neo4j."这很奇怪,因为它是从3.5.5升级而来的,一直在3.5.11-上运行,从未被更新的版本接触过。

docker logs neo4j-apoc
Fetching versions.json for Plugin 'apoc' from https://neo4j-contrib.github.io/neo4j-apoc-procedures/versions.json
Installing Plugin 'apoc' from https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/4.0.0.7/apoc-4.0.0.7-all.jar to /plugins/apoc.jar 
Applying default values for plugin apoc to neo4j.conf
Skipping dbms.security.procedures.unrestricted for plugin apoc because it is already set
Directories in use:
home:         /var/lib/neo4j
config:       /var/lib/neo4j/conf
logs:         /logs
plugins:      /plugins
import:       /var/lib/neo4j/import
data:         /var/lib/neo4j/data
certificates: /var/lib/neo4j/certificates
run:          /var/lib/neo4j/run
Starting Neo4j.
2022-09-10 14:18:32.888+0000 WARN  Unrecognized setting. No declared setting with name: apoc.export.file.enabled
2022-09-10 14:18:32.892+0000 WARN  Unrecognized setting. No declared setting with name: apoc.import.file.enabled
2022-09-10 14:18:32.893+0000 WARN  Unrecognized setting. No declared setting with name: apoc.import.file.use_neo4j_config
2022-09-10 14:18:32.921+0000 INFO  ======== Neo4j 4.0.0 ========
2022-09-10 14:18:32.934+0000 INFO  Starting...
2022-09-10 14:18:48.713+0000 ERROR Failed to start Neo4j: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabaseService@123d7057' was successfully initialized, but failed to start. Please see the attached cause exception "Transaction logs contains entries with prefix 2, and the highest supported prefix is 1. This indicates that the log files originates from a newer version of neo4j.". Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabaseService@123d7057' was successfully initialized, but failed to start. Please see the attached cause exception "Transaction logs contains entries with prefix 2, and the highest supported prefix is 1. This indicates that the log files originates from a newer version of neo4j.".

我尝试了几件事:

1.(删除事务日志:sudo rm graph.db/neostore.transaction.db.*即使目录中没有事务日志,也会抛出完全相同的事务日志错误;

2.(通过将此添加到运行命令中尝试数据库恢复:-e NEO4J_unsupported_dbms_tx__log_fail__on__corrupted__log__files=false此操作在"Unknown store version 'SF4.3.0'":中失败

2022-09-10 15:39:48.458+0000 INFO  Starting...
2022-09-10 15:40:34.529+0000 ERROR Failed to start Neo4j: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabaseService@2a39aa2b' was successfully initialized, but failed to start. Please see the attached cause exception "Unknown store version 'SF4.3.0'". Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabaseService@2a39aa2b' was successfully initialized, but failed to start. Please see the attached cause exception "Unknown store version 'SF4.3.0'".
org.neo4j.server.ServerStartupException: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabaseService@2a39aa2b' was successfully initialized, but failed to start. Please see the attached cause exception "Unknown store version 'SF4.3.0'".

任何想法都值得赞赏!谢谢

删除事务日志从来都不是一个好主意。您要做的是添加一个环境变量:

dbms.allow_upgrade=true

然后,它应该像文档中所说的那样工作,您可以更新最新的3.5到4.0.0 Neo4j版本。

最新更新