docker启动elasticsearch5.5.2报错

[root@lisongyu ~]# docker run -p 9200:9200 hub.c.163.com/library/elasticsearch:5.5.2
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 2060255232 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /tmp/hs_err_pid1.log
  • 原因:默认启动参数jvm内存设置是2g,而我的服务器只是一台1g运存的便宜货,所以需要手动修改参数
  • 解决办法: 在启动参数中配置修改掉jvm的默认值
    • -e "ES_JAVA_OPTS=-Xms512m -Xmx512m"
posted @ 2019-08-28 22:41  lisongyu  阅读(536)  评论(0编辑  收藏  举报