2017-02-27 199 views
1

我在Docker(v。3.1.0)中使用Neo4j。我试图用一个单一查询来更新整个数据库,当我面对错误:不需要的还原为原始的dbms.memory.heap.max_size

There is not enough memory to perform the current task. Please try increasing 'dbms.memory.heap.max_size' in the neo4j configuration (normally in 'conf/neo4j.conf' or, if you you are using Neo4j Desktop, found through the user interface) or if you are running an embedded installation increase the heap by using '-Xmx' command line flag, and then restart the database.

所以我去设置配置文件中的条目:

dbms.memory.heap.initial_size=512M 
dbms.memory.heap.max_size=512M 

我给他们两个2048M(如我阅读here这两个更好地匹配)。但是,在保存并重新启动Docker之后,条目将恢复为其512M原始值。为了确保它不是码头问题,我在配置文件中写了一些注释行,并坚持下来。这意味着这些值有意地被Neo4j恢复。但为什么?这是码头工人施加的限制吗?因为我的硬件有足够的内存!

回答

2

如果您使用的是标准Docker镜像,/docker_entrypoint.sh将根据环境变量设置内存或将其默认设置为512M。

setting "dbms.memory.heap.initial_size" "${NEO4J_dbms_memory_heap_maxSize:-512M}" 
setting "dbms.memory.heap.max_size" "${NEO4J_dbms_memory_heap_maxSize:-512M}" 

当你实例化泊坞窗容器中添加--env NEO4J_dbms_memory_heap_maxSize=2048的命令。