zoukankan      html  css  js  c++  java
  • Elasticsearch 6.8.4 启动报错解决方法

    运行环境:centos 7,jdk 1.8

    问题一:

    ERROR: bootstrap checks failed
    max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]

    原因:无法创建本地文件问题,用户最大可创建文件数太小

    解决方案:
    切换到root用户,编辑limits.conf配置文件, 添加类似如下内容:

    vim /etc/security/limits.conf

    添加如下内容:
    * soft nofile 65536

    * hard nofile 131072

    备注:* 代表Linux所有用户名称(比如 hadoop)

    保存、退出、重新登录才可生效

    问题二:

    修改limits.conf配置文件不生效解决方法:

    1. 确保 pam 生效

    在 /etc/pam.d/login 中,存在:

    session required pam_limits.so

    2. 确保 ssh 使用 pam

    在 /etc/pam.d/sshd 中,存在:

    session required pam_limits.so

    在 /etc/ssh/sshd_config 中, 存在:

    UsePAM yes

    3. limits.conf 建议不要使用星号

    官方 manual 以及网上的教程有很多都用了 * 符号,然而不是所有系统都认的

    # 不兼容方式:
    * soft nofile 51200
    * hard nofild 51200
    # 兼容方式
    root soft nofile 51200
    root hard nofile 51200
    qhwa soft nofile 51200
    qhwa hard nofile 51200

    问题三:

    max number of threads [1024] for user [es] likely too low, increase to at least [2048]

    原因:无法创建本地线程问题,用户最大可创建线程数太小
    解决方案:

    切换到root用户,进入limits.d目录下,修改90-nproc.conf 配置文件。

    vi /etc/security/limits.d/90-nproc.conf

    找到如下内容:

    * soft nproc 1024

    #修改为

    * soft nproc 2048

    问题四:

    max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]

    原因:最大虚拟内存太小
    解决方案:切换到root用户下,修改配置文件sysctl.conf

    vi /etc/sysctl.conf

    添加下面配置:

    vm.max_map_count=655360

    并执行命令:

    sysctl -p

    然后重新启动elasticsearch,即可启动成功。

    问题五:

    服务器已开放端口,确无法访问到es?

    原因:端口被限制为本地访问;

    解决方法:配置文件elasticsearch.yml中添加:

    network.host: 0.0.0.0

    问题六:

    访问报跨域问题?

    解决方法:配置文件elasticsearch.yml中添加:

    http.cors.enabled: true
    http.cors.allow-origin: "*"

     

  • 相关阅读:
    [Leetcode 56] 55 Jump Game
    [Leetcode 57] 61 Rotate List
    [Leetcode 61] 73 Set Matrix Zeros
    [Leetcode 62] 74 Search a 2D Matrix
    [Leetcode 64] 78 Subsets
    [Leetcode 63] 77 Combinations
    [Leetcode 58] 63 Unique Path II
    python学习笔记第1章节 基础知识
    python学习笔记第2章节 分支,循环,还有条件
    visual studio 2008 试用版评估期已结束的解决方法(转载)
  • 原文地址:https://www.cnblogs.com/gdwkong/p/12112468.html
Copyright © 2011-2022 走看看