Docker启动elasticsearch闪退问题解决(ERROR: [2] bootstrap checks failed)

Docker启动elasticsearch闪退问题解决

报错信息

可以查看运行的日志看问题出在哪里

docker logs -f 容器ID
ERROR: [2] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
ERROR: Elasticsearch did not exit normally - check the logs at /usr/share/elasticsearch/logs/docker-cluster.log

原因

官方的elasticsearch缺少配置,需要配置两处地方

解决办法

修改max_map_count大小

sysctl -w vm.max_map_count=262144

查看max_map_count,确保修改成功

sysctl -a|grep vm.max_map_count

修改句柄
跳转目录

cd /var/lib/docker/overlay2/

找到elasticsearch.yml配置文件

find . -name "elasticsearch.yml"

如果有多个容器会查到多个配置文件,每一个配置文件都添加一下配置信息
对配置文件进行编辑
修改配置文件
在配置文件中增加两行配置

bootstrap.system_call_filter: false
cluster.initial_master_nodes: ["node-1"]

增加配置信息
保存并退出
重新启动一下容器,这时候就可以在浏览器中使用配置的端口访问到信息啦

可以学习elasticsearch了/(ㄒoㄒ)/~~

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值