使用docker部署Elasticsearch报错:ERROR: Elasticsearch exited unexpectedly, with exit code 78

报错信息

笔者参考Elasticsearch的官网链接部署docker版本的Es报错。报错信息如下:

{"@timestamp":"2024-01-16T08:53:50.091Z", "log.level":"ERROR", "message":"node validation exception\n[1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch. For more information see [https://www.elastic.co/guide/en/elasticsearch/reference/8.11/bootstrap-checks.html]\nbootstrap check failure [1] of [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]; for more information see [https://www.elastic.co/guide/en/elasticsearch/reference/8.11/_maximum_map_count_check.html]", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"main","log.logger":"org.elasticsearch.bootstrap.Elasticsearch","elasticsearch.node.name":"aa7f36766585","elasticsearch.cluster.name":"docker-cluster"}

在这里插入图片描述

原因

vm.max_map_count 是一个 Linux 内核参数,用于设置进程的最大内存映射数量。在一些特定的应用场景中,例如运行 Elasticsearch,需要适当地调整 vm.max_map_count 的值。

# 查看
sysctl vm.max_map_count
# 临时修改值
sudo sysctl -w vm.max_map_count=<value>

解决方案

下文的262144是报错信息中提示的最小值。

  • 临时解决方案
sudo sysctl -w vm.max_map_count=262144
  • 永久方案
    如果你想永久修改 vm.max_map_count 的值,可以编辑 /etc/sysctl.conf 文件,在文件的末尾添加一行:
vm.max_map_count=262144

然后加载配置

sudo sysctl -p

这将重新加载 /etc/sysctl.conf 中的配置,并将新的 vm.max_map_count 值应用到系统中。请记住,在修改系统参数时要小心,并确保你了解修改的目的以及潜在的影响。

参考

Elasticsearch Container Stopped with Exit 78 state in Ubuntu 18.04 #1699

后记

天灵灵地灵灵,快把bug收了吧

  • 9
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值