elasticSearch启动错误

  1. max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
    编辑/etc/security/limits.conf,追加以下内容;

    * soft nofile 65536
    * hard nofile 65536
    

    此文件修改后需要重新登录用户,才会生效
    登录后使用ulimit -S -nulimit -H -n查看

  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
    原因分析
    看提示可知:缺少默认配置,至少需要配置 discovery.seed_hosts/discovery.seed_providers/cluster.initial_master_nodes中的一个参数.
    discovery.seed_hosts: 集群主机列表
    discovery.seed_providers: 基于配置文件配置集群主机列表
    cluster.initial_master_nodes: 启动时初始化的参与选主的node,生产环境必填

    处理办法
    修改配置文件,添加参数即可

    vim config/elasticsearch.yml
    
    
    #添加配置
    discovery.seed_hosts: ["127.0.0.1"]
    
    cluster.initial_master_nodes: ["node-1"]
    
  3. max number of threads [3767] for user [xxx] is too low, increase to at least [4096]

    # 脚本
    #!/bin/bash
    echo "* soft nproc 2048" >> /etc/security/limits.conf
    echo "* hard nproc 4096" >> /etc/security/limits.conf
    echo "* soft nofile 65536" >> /etc/security/limits.conf
    echo "* hard nofile 65536" >> /etc/security/limits.conf
    echo "* soft memlock unlimited" >> /etc/security/limits.conf
    echo "* hard memlock unlimited" >> /etc/security/limits.conf
    echo "vm.max_map_count = 262144" >> /etc/sysctl.conf
    sysctl -p
    ulimit -l unlimited
    
  4. initial heap size [268435456] not equal to maximum heap size [536870912]
    /config/jvm.options中修改一下配置即可
    XmsXmx的大小要一样

作者: 忞翛

出处: https://www.lczmx.top/错误记录/48c4baa850f6/

版权: 本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」许可协议进行许可。

转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。

在线工具