Neo4j -社区版本从4.3.x升级到5.x失败

wyyhbhjk  于 2023-03-29  发布在  其他
关注(0)|答案(1)|浏览(421)

在docker环境中,我正在将neo4j版本从4.3升级到5.x。
作为升级的一部分,我使用以下命令加载备份转储,但由于以下异常而失败。

命令

/var/lib/neo4j/bin# neo4j-admin database load --from-path=/backups  neo4j --overwrite-destination --verbose

日志

Executing command line: /opt/java/openjdk/bin/java -cp /var/lib/neo4j/plugins/*:/var/lib/neo4j/conf/*:/var/lib/neo4j/lib/* -XX:+UseParallelGC -XX:-OmitStackTraceInFastThrow -XX:+UnlockExperimentalVMOptions -XX:+TrustFinalNonStaticFields -XX:+DisableExplicitGC -Djdk.nio.maxCachedBufferSize=1024 -Dio.netty.tryReflectionSetAccessible=true -XX:+ExitOnOutOfMemoryError -Djdk.tls.ephemeralDHKeySize=2048 -XX:FlightRecorderOptions=stackdepth=256 -XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED -Dlog4j2.disable.jmx=true -Dfile.encoding=UTF-8 -Xmx2097152k org.neo4j.cli.AdminTool database load --from-path=/backups neo4j --overwrite-destination --verbose
neo4j 5.5.0
VM Name: OpenJDK 64-Bit Server VM
VM Vendor: Eclipse Adoptium
VM Version: 17.0.6+10
JIT compiler: HotSpot 64-Bit Tiered Compilers
VM Arguments: [-XX:+UseParallelGC, -XX:-OmitStackTraceInFastThrow, -XX:+UnlockExperimentalVMOptions, -XX:+TrustFinalNonStaticFields, -XX:+DisableExplicitGC, -Djdk.nio.maxCachedBufferSize=1024, -Dio.netty.tryReflectionSetAccessible=true, -XX:+ExitOnOutOfMemoryError, -Djdk.tls.ephemeralDHKeySize=2048, -XX:FlightRecorderOptions=stackdepth=256, -XX:+UnlockDiagnosticVMOptions, -XX:+DebugNonSafepoints, --add-opens=java.base/java.nio=ALL-UNNAMED, --add-opens=java.base/java.io=ALL-UNNAMED, --add-opens=java.base/sun.nio.ch=ALL-UNNAMED, -Dlog4j2.disable.jmx=true, -Dfile.encoding=UTF-8, -Xmx2097152k]
Configuration files used (ordered by priority):
/var/lib/neo4j/conf/neo4j-admin.conf
/var/lib/neo4j/conf/neo4j.conf
--------------------
Done: 53 files, 251.4MiB processed.
Failed to load database 'neo4j': Can not read store version of database neo4jLoad failed for databases: 'neo4j'
org.neo4j.cli.CommandFailedException: Load failed for databases: 'neo4j'
        at org.neo4j.commandline.dbms.LoadCommand.checkFailure(LoadCommand.java:219)
        at org.neo4j.commandline.dbms.LoadCommand.loadDump(LoadCommand.java:207)
        at org.neo4j.commandline.dbms.LoadCommand.execute(LoadCommand.java:150)
        at org.neo4j.cli.AbstractCommand.call(AbstractCommand.java:92)
        at org.neo4j.cli.AbstractCommand.call(AbstractCommand.java:37)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
        at picocli.CommandLine.execute(CommandLine.java:2170)
        at org.neo4j.cli.AdminTool.execute(AdminTool.java:94)
        at org.neo4j.cli.AdminTool.main(AdminTool.java:82)
Caused by: java.lang.IllegalStateException: Can not read store version of database neo4j
        at org.neo4j.commandline.dbms.StoreVersionLoader.loadStoreVersion(StoreVersionLoader.java:88)
        at org.neo4j.dbms.archive.Loader.getStoreVersion(Loader.java:131)
        at org.neo4j.commandline.dbms.LoadDumpExecutor.execute(LoadDumpExecutor.java:84)
        at org.neo4j.commandline.dbms.LoadCommand.loadDump(LoadCommand.java:197)
        ... 13 more
wixjitnu

wixjitnu1#

neo4j-admin这样的Neo4j工具只能访问neo4j用户拥有的文件。您的转储文件可能由其他用户拥有。
尝试使用以下命令更改文件所有权(其中/backup/neo4j.dump是转储文件的路径):

sudo chown neo4j:neo4j /backup/neo4j.dump

相关问题