zoukankan      html  css  js  c++  java
  • ELK学习003:Elasticsearch启动常见问题

    一、Caused by: java.lang.RuntimeException: can not run elasticsearch as root

    这个错误,是因为使用root用户启动elasticsearch,elasticsearch是不允许使用root用户启动的,所以我们需要添加用户。

    [root@localhost ~]# adduser elsearch
    [root@localhost ~]# passwd elsearch
    [root@localhost ~]# chown -R elsearch:elsearch elasticsearch-7.6.0
    [root@localhost ~]# chmod 770 elasticsearch-7.6.0/      # 这一步之后,切换到elsearch用户,再执行下面两条命令。
    [root@localhost ~]# cd elasticsearch-7.6.0/
    [root@localhost ~]# bin/elasticsearch

    二、OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000e5330000, 449642496, 0) failed; error='Not enough space' (errno=12); 或者error='Cannot a ...'(errno=12);

    原因:jvm要分配最大内存超出系统内存

    解决:

    root@localhost ~]# vim /elasticsearch-7.6.0/config/jvm.options   # 适当调整指定jvm内存,由于虚拟机内存制定1g,所以适当降低jvm内存指定,这里改成512m。
    -Xms512m
    -Xmx512m
    [root@localhost ~]# /elasticsearch-7.6.0/bin/elasticsearch       # 重启elasticsearch

    三、org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to obtain node locks, tried [[/www/wwwroot/elasticsearch-7.6.0/data]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?

    原因:线程占用

    解决:重新启动

    [root@localhost ~]# ps -ef | grep elasticsearch                 # 找到elasticsearch线程
    [root@localhost ~]# kill -9 pid                                 # 杀死elasticsearch线程
    [root@localhost ~]# /elasticsearch-7.6.0/bin/elasticsearch      # 重启elasticsearch
    

     https://www.cnblogs.com/sitongyan/p/11263753.html

    https://blog.csdn.net/weixin_41238134/article/details/99291917

  • 相关阅读:
    泰国行记三:PP岛三天的休闲时光
    泰国行记二:普吉印象
    177. Nth Highest Salary
    176. Second Highest Salary
    175. Combine Two Tables
    Regular Expression Matching
    斐波那契数列
    用两个栈实现队列
    二叉树的下一个节点
    重建二叉树
  • 原文地址:https://www.cnblogs.com/liuhaidon/p/12301150.html
Copyright © 2011-2022 走看看