Consistency checker
You can use the neo4j-admin database check
command to check the consistency of a database, a dump, or a backup.
The neo4j-admin
tool is located in the /bin directory.
Syntax
The neo4j-admin database check
command has the following syntax:
neo4j-admin database check [-h] [--expand-commands] [--force] [--verbose]
[--check-counts[=true|false]] [--check-graph[=true|false]]
[--check-indexes[=true|false]] [--check-property-owners[=true|false]]
[--additional-config=<file>] [--max-off-heap-memory=<size>]
[--report-path=<path>] [--threads=<number of threads>]
[[--from-path-data=<path> --from-path-txn=<path>] | [--from-path=<path> [--temp-path=<path>]]]
<database>
Description
This command allows for checking the consistency of a database, a dump, or a backup. It cannot be used with a database that is currently in use.
Some checks can be quite expensive, so it may be useful to turn some of them off for very large databases. Increasing the heap size might be a good idea.
It is not recommended to use an NFS to check the consistency of a database, a dump, or a backup as this slows the process down significantly. |
Parameters
Parameter | Description |
---|---|
|
Name of the database to check. |
Options
The neo4j-admin database check
command has the following options:
Option | Description | Default |
---|---|---|
|
Enable verbose output. |
|
|
Show this help message and exit. |
|
|
Allow command expansion in config value evaluation. |
|
|
Configuration file with additional configuration. |
|
|
Force a consistency check to be run, despite resources, and may run a more thorough check. |
|
|
Perform consistency checks on indexes. |
|
|
Perform consistency checks between nodes, relationships, properties, types, and tokens. |
|
|
Perform consistency checks on the counts. Requires <check-graph>, and may implicitly enable <check-graph> if it were not explicitly disabled. |
|
|
Perform consistency checks on the ownership of properties. Requires <check-graph>, and may implicitly enable <check-graph> if it were not explicitly disabled. |
|
|
Path to where a consistency report will be written. Interpreted as a directory, unless it has an extension of |
|
|
Maximum memory that |
|
|
Number of threads used to check the consistency. |
|
|
Path to the databases directory, containing the database directory to source from. |
|
|
Path to the transactions directory, containing the transaction directory for the database to source from. |
|
|
Path to directory containing dump/backup artifacts to check the consistency of. |
|
|
Path to directory to be used as a staging area to extract dump/backup artifacts, if needed. |
|
Output
If the consistency checker does not find errors, it exits cleanly and does not produce a report.
If the consistency checker finds errors, it exits with an exit code other than 0
and writes a report file with a name in the format inconsistencies-YYYY-MM-DD.HH24.MI.SS.report
.
The location of the report file is the current working directory, or as specified by the parameter report-path
.
Example
Note that the database must be stopped first.
$neo4j-home> bin/neo4j-admin database check neo4j Running consistency check with max off-heap:618.6MiB Store size:160.0KiB Allocated page cache:160.0KiB Off-heap memory for caching:618.5MiB ID Generator consistency check .................... 10% .................... 20% .................... 30% .................... 40% .................... 50% .................... 60% .................... 70% .................... 80% .................... 90% .................... 100% Index structure consistency check .................... 10% .................... 20% .................... 30% .................... 40% .................... 50% .................... 60% .................... 70% .................... 80% .................... 90% .................... 100% Consistency check .................... 10% .................... 20% .................... 30% .................... 40% .................... 50% .................... 60% .................... 70% .................... 80% .................... 90% .................... 100%
Run with the --from-path
option to check the consistency of a backup or a dump.
bin/neo4j-admin database check --from-path=<directory-with-backup-or-dump> neo4j
|