zoukankan      html  css  js  c++  java
  • 启动elasticsearch报错的几种原因及解决方法

    ERROR: [1] bootstrap checks failed
    [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
    解决:

    在宿主机执行:

    sysctl -w vm.max_map_count=262144

    原因:

    vm.max_map_count参数,是允许一个进程在VMAs拥有最大数量(VMA:虚拟内存地址, 一个连续的虚拟地址空间),当进程占用内存超过时, 直接OOM。

    elasticsearch占用内存较高。官方要求max_map_count需要配置到最小262144。

    问题

    Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c5330000, 986513408, 0) failed; error='Cannot allocate memory' (errno=12)
    #
    # There is insufficient memory for the Java Runtime Environment to continue.
    # Native memory allocation (mmap) failed to map 986513408 bytes for committing reserved memory.
    # An error report file with more information is saved as:
    # /usr/local/software/temp/elasticsearch-6.2.2/hs_err_pid1912.log

    解决:

    内存不够,购买阿里云的机器可以动态增加内存,或者启动时候现在内存为256M

    问题:

    [root@iZwz95j86y235aroi85ht0Z bin]# ./elasticsearch
    [2018-02-22T20:14:04,870][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
    org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:125) ~[elasticsearch-6.2.2.jar:6.2.2]
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-6.2.2.jar:6.2.2]
    at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.2.2.jar:6.2.2]
    at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.2.2.jar:6.2.2]

    解决:

    用非root用户
    添加用户:useradd -m 用户名 然后设置密码 passwd 用户名

    问题:

    ./elasticsearch
    Exception in thread "main" java.nio.file.AccessDeniedException: /usr/local/software/temp/elasticsearch-6.2.2/config/jvm.options

    解决:

    权限不够 chmod 777 -R 当前es目录

    max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536] 
    解决方案

    [root@centos7 sonarqube-7.2.1]# vi /etc/security/limits.conf 
    pangkunkun1 hard nofile 65536
    pangkunkun1 soft nofile 65536

    这里的pangkunkun1为上面创建的用来启动sonar的用户,修改好之后要切换到pangkunkun1这个用户之后才能生效。 
    使用ulimit -Hn指令查看配置是否生效:

    [pangkunkun1@centos7 sonarqube-7.2.1]$ ulimit -Hn
    65536

  • 相关阅读:
    C++模板进阶指南:SFINAE
    SFINAE and enable_if
    Effective Modern C++:05右值引用、移动语义和完美转发
    C++左值和右值
    Effective Modern C++:04智能指针
    Effective Modern C++:03转向现代C++
    Effective Modern C++:02auto
    Effective Modern C++:01类型推导
    c++ vitual继承
    c++正确处理 is-a has-a关系
  • 原文地址:https://www.cnblogs.com/dalianpai/p/11783004.html
Copyright © 2011-2022 走看看