运行脚本
sudo docker run -d \ --name container_name \ -p 27474:7474 \ -p 27687:7687 \ -v /home/neo4j/data:/data \ -v /home/neo4j/logs:/logs \ -v /home/neo4j/conf:/var/lib/neo4j/conf \ -v /home/neo4j/import:/var/lib/neo4j/import \ -v /home/lighthouse/tcmkg_v0.2/data/import:/home/data \ --env NEO4J_AUTH=neo4j/password \ neo4j:4.4-community
报错如下:
Caused by: java.lang.IllegalArgumentException: The read version string length 99 is not proper.
at org.neo4j.kernel.impl.store.MetaDataStore.versionLongToString(MetaDataStore.java:892) ~[neo4j-record-storage-engine-4.4.36.jar:4.4.36]
at org.neo4j.kernel.impl.store.format.RecordFormatSelector.selectForStore(RecordFormatSelector.java:159) ~[neo4j-record-storage-engine-4.4.36.jar:4.4.36]
at org.neo4j.kernel.impl.store.format.RecordFormatSelector.selectNewestFormat(RecordFormatSelector.java:280) ~[neo4j-record-storage-engine-4.4.36.jar:4.4.36]
at org.neo4j.kernel.impl.storemigration.RecordStoreVersionCheck.configuredVersion(RecordStoreVersionCheck.java:169) ~[neo4j-record-storage-engine-4.4.36.jar:4.4.36]
at org.neo4j.kernel.impl.storemigration.RecordStoreVersionCheck.<init>(RecordStoreVersionCheck.java:56) ~[neo4j-record-storage-engine-4.4.36.jar:4.4.36]
at org.neo4j.internal.recordstorage.RecordStorageEngineFactory.versionCheck(RecordStorageEngineFactory.java:128) ~[neo4j-record-storage-engine-4.4.36.jar:4.4.36]
at org.neo4j.kernel.impl.storemigration.DatabaseMigrator.migrate(DatabaseMigrator.java:90) ~[neo4j-kernel-4.4.36.jar:4.4.36]
at org.neo4j.kernel.database.Database.upgradeStore(Database.java:681) ~[neo4j-kernel-4.4.36.jar:4.4.36]
at org.neo4j.kernel.database.Database.start(Database.java:410) ~[neo4j-kernel-4.4.36.jar:4.4.36]
at org.neo4j.dbms.database.AbstractDatabaseManager.startDatabase(AbstractDatabaseManager.java:234) ~[neo4j-4.4.36.jar:4.4.36]
at org.neo4j.dbms.database.DefaultDatabaseManager.startDatabase(DefaultDatabaseManager.java:145) ~[neo4j-4.4.36.jar:4.4.36]
at org.neo4j.dbms.database.DefaultDatabaseManager.startDatabase(DefaultDatabaseManager.java:34) ~[neo4j-4.4.36.jar:4.4.36]
at org.neo4j.dbms.database.AbstractDatabaseManager.forEachDatabase(AbstractDatabaseManager.java:212) ~[neo4j-4.4.36.jar:4.4.36]
at org.neo4j.dbms.database.AbstractDatabaseManager.startAllDatabases(
如何解决
是因为 neo4j4.x与neo4j 5.x 之间没有向下兼容,我一开始的运行脚本的时候,没有指定neo4j的版本,默认使用了5.x的版本,后面使用4.x的版本,但是映射的目录没有调整,neo4j4.x与neo4j5.x映射同一个目录导致容器无法运行起来