docker安装elasticsearch内存修改

用docker 安装的elasticsearch默认堆内存最大设置的2G或者1G

可以通过如下方法修改

[ logs]# find /var/lib/docker/ -name jvm.options


/var/lib/docker/overlay2/f394fa1197ace3d592bb37738b95335fc722950c6a39167a0106586f0d2f2382/diff/etc/elasticsearch/jvm.options
/var/lib/docker/overlay2/1bda3723143784e9db1324180f741dc2532addf41f9224248ade99964966cf18/merged/etc/elasticsearch/jvm.options

然后 vim /var/lib/docker/overlay2/f394fa1197ace3d592bb37738b95335fc722950c6a39167a0106586f0d2f2382/diff/etc/elasticsearch/jvm.options

修改里面

-Xms4g
-Xmx4g

然后保存,

然后重启docker 里的 elasticsearch 容器

docker restart elasticsearch