我正在尝试在新机器上加载现有的 neo4j 数据库。旧机器运行的是 1.9.M05,而新机器运行的是 1.9RC1。我只是将 data/graph.db 文件从旧安装复制到新安装。
服务器启动正常,webadmin 界面看起来一切正常。
但是,当我尝试从 Java 中将数据库作为 EmbeddedDatabase 访问时,我收到以下错误消息,指出它无法解析 mapped_memory 属性。当我在代码库和 neo4j 源中查找“94M”的“坏值”时,我找不到任何提及它的内容。webadmin 界面报告 mapped_memory 属性设置为 45M。
如果 db 文件中存储了错误值,是否有办法在加载损坏的设置之前强制指定 .props 文件?
调用代码:
GraphDatabaseFactory factory =
new org.neo4j.graphdb.factory.GraphDatabaseFactory();
GraphDatabaseService graphDb = factory
.newEmbeddedDatabaseBuilder(DB_PATH)
.loadPropertiesFromFile(NEO_HOME + "conf/neo4j.properties" )
.newGraphDatabase();
例外:
[java] Exception in thread "main" java.lang.IllegalArgumentException: Bad value '-94M' for setting 'neostore.propertystore.db.strings.mapped_memory': value does not match expression:\d+[kmgKMG]?
[java] at org.neo4j.helpers.Settings$DefaultSetting.apply(Settings.java:788)
[java] at org.neo4j.helpers.Settings$DefaultSetting.apply(Settings.java:708)
[java] at org.neo4j.graphdb.factory.GraphDatabaseSetting$SettingWrapper.apply(GraphDatabaseSetting.java:215)
[java] at org.neo4j.graphdb.factory.GraphDatabaseSetting$SettingWrapper.apply(GraphDatabaseSetting.java:189)
[java] at org.neo4j.kernel.configuration.ConfigurationValidator.validate(ConfigurationValidator.java:50)
[java] at org.neo4j.kernel.configuration.Config.applyChanges(Config.java:121)
[java] at org.neo4j.kernel.InternalAbstractGraphDatabase.create(InternalAbstractGraphDatabase.java:337)
[java] at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:254)
[java] at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:90)
[java] at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:85)
[java] at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:205)
[java] at com.mycompany.CMDRunner.printNeoSegments(CMDRunner.java:27)