Advertisement

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)

还没有任何评论哟~