为了在 Windows 机器上增加 Elasticsearch 的 JVM 堆大小,我定义了以下环境变量:
ES_HEAP_SIZE=6g
(机器总共有12G RAM)。
我已经重启了 ES 并使用 _nodes/stat HTTP GET 命令查询了它的内存使用情况。但是,它似乎仍在使用 1GB:
内存:{
heap_used_in_bytes: 1032367576,
heap_used_percent: 99,
heap_committed_in_bytes: 1037959168,
heap_max_in_bytes: 1037959168,
...
重启后ES不应该调整它的堆内存大小吗?
最佳答案
来自 running ES as a service on windows 上的注释:
Note that the environment configuration options available during the installation are copied and will be used during the service lifecycle. This means any changes made to them after the installation will not be picked up unless the service is reinstalled.
如果您不想卸载并重新安装,可以使用服务管理器进行更改。运行>服务管理器
然后选择“Java”选项卡
更改内存池设置,点击“应用”并重新启动服务。
关于设置环境变量后 Elasticsearch 报告默认堆内存大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27128620/