欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

docker启动elasticsearch报错

程序员文章站 2024-03-25 12:55:40
...
docker run -dit --name dk-es -p 9200:9200 -p 9300:9300 -e ES_JAVA_OPTS="-Xms512m -Xms512m" xiadekang/dk-es:6.8.2

处理启动报错一:

[2017-01-12T15:55:55,433][INFO ][o.e.b.BootstrapCheck     ] [SfD5sIh] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
ERROR: bootstrap checks failed
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
  • 临时提高了vm.max_map_count的大小,此操作需要root权限:
sudo  sysctl -w vm.max_map_count=262144
sysctl -a|grep vm.max_map_count
  • 永久修改vm.max_map_count:

解决:切换到root用户修改配置sysctl.conf

vi /etc/sysctl.conf 
添加下面配置:
vm.max_map_count=655360
并执行命令:
sysctl -p
然后,重新启动elasticsearch,即可启动成功。

处理启动报错二:

2017-01-12T16:12:22,404][INFO ][o.e.b.BootstrapCheck     ] [SfD5sIh] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
ERROR: bootstrap checks failed
initial heap size [536870912] not equal to maximum heap size [1073741824]; this can cause resize pauses and prevents mlockall from locking the entire heap

解决方法:

find /var/lib/docker/overlay2/ -name jvm.options


vi jvm.options

###-Xms 和 -Xmx需要配置的相等,不然无法启动成功。
-Xms512m
-Xmx512m