elasticsearch启动后自动关闭:max virtual memory areas vm.max_map_count [65530] is too low, increase to at...

elasticsearch启动后自动关闭:max virtual memory areas vm.max_map_count [65530] is too low, increase to at…

elasticsearch

  • 我遇到的问题是用docker 启动elasticsearch后会自动关闭,具体关闭时间点没注意,访问9200端口不成功

错误寻找

  • 首先判断错误:docker logs ES02

    • 调出ES02容器(就是错误容器的名字)的日志内容:
    • 部分日志
  • 原因找到了max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144],就是它!

    • 这句话的意思是虚拟内存空间太小了,至少需要262144这么多,意思是elasticsearch拥有的内存权限太小,得扩大

解决方案:

      sysctl -w vm.max_map_count=262144
      //查看结果:
      sysctl -a|grep vm.max_map_count
      //显示:vm.max_map_count = 262144
      //上述方法修改之后,如果重启虚拟机将失效

  • 所以我们需要在配置文件中改配置

    vim /etc/sysctl.conf
    //在最后一行上加上
    vm.max_map_count=262144
    //保存退出,加载配置,启动容器,就能够访问了

  • 解决成功,Web访问

发布了78 篇原创文章 · 获赞 24 · 访问量 9万+

猜你喜欢

转载自blog.csdn.net/symuamua/article/details/104346501
今日推荐