升级到 Neo4j 4 后 Neo4j 一致性检查问题

问题描述 投票:0回答:1

我目前正在从 Neo4j 3.5.35 升级到 4.0.12(社区版),并且在使用

neo4j-admin dump
创建的备份的一致性检查方面遇到问题。 Neo4j 作为 Docker Swarm 中的服务运行。

备份和一致性检查是通过运行 shell 脚本在 Jenkins 管道中完成的,步骤如下:

  1. 将 Neo4j 服务缩放为 0,即关闭 Neo4j。
  2. 启动一个新的 Neo4j 容器并运行
    neo4j-admin dump
    创建转储文件。
  3. 启动一个基于 Neo4j 的新自定义容器,使用
    neo4j-admin load
    加载上一步中创建的转储文件,然后使用
    neo4j-admin check-consistency
    进行一致性检查。

这在 Neo4j 3.5.35 上运行良好,但在 Neo4j 4.0.12 上我收到以下错误:

org.neo4j.cli.CommandFailedException: Active logical log detected, this might be a source of inconsistencies.
Please recover database before running the consistency check.
To perform recovery please start database and perform clean shutdown.
        at org.neo4j.consistency.CheckConsistencyCommand.checkDbState(CheckConsistencyCommand.java:181)
        at org.neo4j.consistency.CheckConsistencyCommand.execute(CheckConsistencyCommand.java:129)
        at org.neo4j.cli.AbstractCommand.call(AbstractCommand.java:59)
        at org.neo4j.cli.AbstractCommand.call(AbstractCommand.java:29)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1743)
        at picocli.CommandLine.access$900(CommandLine.java:145)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2101)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2068)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:1935)
        at picocli.CommandLine.execute(CommandLine.java:1864)
        at org.neo4j.cli.AdminTool.execute(AdminTool.java:87)
        at org.neo4j.cli.AdminTool.main(AdminTool.java:65)

除了将 Docker 服务缩放到 0 之外,不知道如何彻底关闭,

STOP DATABASE
命令似乎在社区版中不可用。

/data/databases/graph.db
文件夹的内容如下所示:

-rwxrwxrwx 1 root root         0 Apr  8 14:21 database_lock
drwxrwxrwx 2 root root      4096 Apr  8 14:21 index
-rwxrwxrwx 1 root root      8192 Apr  8 14:21 neostore
-rwxrwxrwx 1 root root     46688 Apr  8 14:21 neostore.counts.db.a
-rwxrwxrwx 1 root root     46688 Apr  8 14:21 neostore.counts.db.b
-rwxrwxrwx 1 root root         9 Apr  8 14:21 neostore.id
-rwxrwxrwx 1 root root  18776064 Apr  8 14:21 neostore.labelscanstore.db
-rwxrwxrwx 1 root root      8190 Apr  8 14:21 neostore.labeltokenstore.db
-rwxrwxrwx 1 root root         9 Apr  8 14:21 neostore.labeltokenstore.db.id
-rwxrwxrwx 1 root root      8192 Apr  8 14:21 neostore.labeltokenstore.db.names
-rwxrwxrwx 1 root root         9 Apr  8 14:21 neostore.labeltokenstore.db.names.id
-rwxrwxrwx 1 root root  10835370 Apr  8 14:21 neostore.nodestore.db
-rwxrwxrwx 1 root root    111793 Apr  8 14:21 neostore.nodestore.db.id
-rwxrwxrwx 1 root root  10190848 Apr  8 14:21 neostore.nodestore.db.labels
-rwxrwxrwx 1 root root      1409 Apr  8 14:21 neostore.nodestore.db.labels.id
-rwxrwxrwx 1 root root 139951327 Apr  8 14:21 neostore.propertystore.db
-rwxrwxrwx 1 root root  30515200 Apr  8 14:21 neostore.propertystore.db.arrays
-rwxrwxrwx 1 root root       289 Apr  8 14:21 neostore.propertystore.db.arrays.id
-rwxrwxrwx 1 root root    435785 Apr  8 14:21 neostore.propertystore.db.id
-rwxrwxrwx 1 root root      8190 Apr  8 14:21 neostore.propertystore.db.index
-rwxrwxrwx 1 root root         9 Apr  8 14:21 neostore.propertystore.db.index.id
-rwxrwxrwx 1 root root      8192 Apr  8 14:21 neostore.propertystore.db.index.keys
-rwxrwxrwx 1 root root         9 Apr  8 14:21 neostore.propertystore.db.index.keys.id
-rwxrwxrwx 1 root root   1523712 Apr  8 14:21 neostore.propertystore.db.strings
-rwxrwxrwx 1 root root       785 Apr  8 14:21 neostore.propertystore.db.strings.id
-rwxrwxrwx 1 root root    106275 Apr  8 14:21 neostore.relationshipgroupstore.db
-rwxrwxrwx 1 root root       273 Apr  8 14:21 neostore.relationshipgroupstore.db.id
-rwxrwxrwx 1 root root  31571040 Apr  8 14:21 neostore.relationshipstore.db
-rwxrwxrwx 1 root root    112545 Apr  8 14:21 neostore.relationshipstore.db.id
-rwxrwxrwx 1 root root      8190 Apr  8 14:21 neostore.relationshiptypestore.db
-rwxrwxrwx 1 root root         9 Apr  8 14:21 neostore.relationshiptypestore.db.id
-rwxrwxrwx 1 root root      8192 Apr  8 14:21 neostore.relationshiptypestore.db.names
-rwxrwxrwx 1 root root         9 Apr  8 14:21 neostore.relationshiptypestore.db.names.id
-rwxrwxrwx 1 root root      8192 Apr  8 14:21 neostore.schemastore.db
-rwxrwxrwx 1 root root         9 Apr  8 14:21 neostore.schemastore.db.id
drwxrwxrwx 3 root root      4096 Apr  8 14:21 schema

非常感谢任何有关此的提示。

neo4j
1个回答
0
投票

我设法通过使用

--database
选项而不是
--backup
调用一致性检查器来解决此问题。

在 Neo4j 3.5.35 中,我使用的是

neo4j-admin check-consistency --backup=/data/databases/graph.db

其中

/data/databases/graph.db
是要检查的转储已加载到的目录。

我正在使用Neo4j 4.0

neo4j-admin check-consistency --database=graph.db

在容器的根目录中,一切正常。

© www.soinside.com 2019 - 2024. All rights reserved.