原文:https://blog.csdn.net/qq_22211217/article/details/80740873

一、Exception in thread "main" SettingsException[Failed to load settings from [elasticsearch.yml]]; nested: ElasticsearchParseException[malformed, expected settings to start with 'object', instead was [VALUE_STRING]];
原因:elasticsearch.yml文件错误
解决:参数与参数值等号间需要空格

node.name ="node"  ##错误
node.name = "node" ##正确

二、org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root

详细错误:

OpenJDK -Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads a
[--20T02::,][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:) ~[elasticsearch-6.3..jar:6.3.]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:) ~[elasticsearch-6.3..jar:6.3.]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:) ~[elasticsearch-6.3..jar:6.3.]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:) ~[elasticsearch-cli-6.3..jar:6.3.]
at org.elasticsearch.cli.Command.main(Command.java:) ~[elasticsearch-cli-6.3..jar:6.3.]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:) ~[elasticsearch-6.3..jar:6.3.]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:) ~[elasticsearch-6.3..jar:6.3.]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:) ~[elasticsearch-6.3..jar:6.3.]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:) ~[elasticsearch-6.3..jar:6.3.]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:) ~[elasticsearch-6.3..jar:6.3.]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:) ~[elasticsearch-6.3..jar:6.3.]
... more

原因:处于对root用户的安全保护,需要使用其他用户组进行授权启动
解决:
step1:用户组进行授权启动

    groupadd elsearch
useradd elsearch -g elsearch -p elasticsearch
chown -R elsearch:elsearch elasticsearch-6.3. 备注: 添加用户组 elsearch
添加用户 elsearch 密码为 elasticsearch 到用户组 elsearch
将elsearch安装目录授权给 用户组:用户 即 elsearch:elsearch

step2: 重新启动

    su elsearch
/elasticsearch-6.3./bin/elasticsearch 备注:切换 elsearch 用户
重新启动

三、OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0) failed; error='Cannot a ...'(errno=12);
原因:jvm要分配最大内存超出系统内存
解决:

step1:适当调整指定jvm内存
vi /home/elasticsearch-6.3./config/jvm.options 

备注:编辑elasticsearch jvm配置文件 修改如下 esc+:wq保存退出
## JVM configuration

################################################################
## IMPORTANT: JVM heap size
################################################################
##
## You should always set the min and max JVM heap
## size to the same value. For example, to set
## the heap to GB, set:
##
## -Xms4g
## -Xmx4g
##
## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html
## for more information
##
################################################################ # Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space -Xms512m
-Xmx512m
备注:由于虚拟机内存制定1g,所以适当降低jvm内存指定
step2:重启
su elsearch
/elasticsearch-6.3./bin/elasticsearch

四、ERROR: [3] bootstrap checks failed

详细错误:

[--20T02::,][INFO ][o.e.b.BootstrapChecks    ] [SUcoFrg] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [] bootstrap checks failed
[]: max file descriptors [] for elasticsearch process is too low, increase to at least []
[]: max number of threads [] for user [elsearch] is too low, increase to at least []
[]: max virtual memory areas vm.max_map_count [] is too low, increase to at least []
[--20T02::,][INFO ][o.e.n.Node ] [SUcoFrg] stopping ...
[--20T02::,][INFO ][o.e.n.Node ] [SUcoFrg] stopped
[--20T02::,][INFO ][o.e.n.Node ] [SUcoFrg] closing ...
[--20T02::,][INFO ][o.e.n.Node ] [SUcoFrg] closed

原因:虚拟机限制用户的执行内存
解决:
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2]: max number of threads [3802] for user [elsearch] is too low, increase to at least [4096]

step1:修改安全限制配置文件

    su root
vi /etc/security/limits.conf 备注:使用最高权限 修改安全配置 在文件末尾加入 # End of file
elsearch hard nofile
elsearch soft nofile
* soft nproc
* hard nproc
备注: elsearch为用户名 可以是使用*进行通配
nofile 最大打开文件数目
nproc 最大打开线程数目

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

step2:修改系统配置文件
vi /etc/sysctl.conf 
备注:行末加上vm.max_map_count = 655360 ,esc +:wq保存退出
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf() and sysctl.d().
vm.max_map_count =
备注:vm.max_map_count = 655360 值大于错误提示值
step3:重启
su elsearch
/elasticsearch-6.3./bin/elasticsearch

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

详细报错:
[--20T04::,][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to obtain node locks, tried [[/home/elasticsearch-6.3./data/elasticsearch]] with lock id []; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [])?
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:) ~[elasticsearch-6.3..jar:6.3.]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:) ~[elasticsearch-6.3..jar:6.3.]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:) ~[elasticsearch-6.3..jar:6.3.]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:) ~[elasticsearch-cli-6.3..jar:6.3.]
at org.elasticsearch.cli.Command.main(Command.java:) ~[elasticsearch-cli-6.3..jar:6.3.]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:) ~[elasticsearch-6.3..jar:6.3.]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:) ~[elasticsearch-6.3..jar:6.3.]
Caused by: java.lang.IllegalStateException: failed to obtain node locks, tried [[/home/elasticsearch-6.3./data/elasticsearch]] with lock id []; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [])?
at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:) ~[elasticsearch-6.3..jar:6.3.]
at org.elasticsearch.node.Node.<init>(Node.java:) ~[elasticsearch-6.3..jar:6.3.]
at org.elasticsearch.node.Node.<init>(Node.java:) ~[elasticsearch-6.3..jar:6.3.]
at org.elasticsearch.bootstrap.Bootstrap$.<init>(Bootstrap.java:) ~[elasticsearch-6.3..jar:6.3.]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:) ~[elasticsearch-6.3..jar:6.3.]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:) ~[elasticsearch-6.3..jar:6.3.]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:) ~[elasticsearch-6.3..jar:6.3.]
... more

原因:线程占用

解决:重新启动

step1:杀死elasticsearch线程
ps -ef | grep elastic
step2: 重启
su elsearch
/elasticsearch-6.3./bin/elasticsearch

原文:https://blog.csdn.net/qq_22211217/article/details/80740873

elasticsearch启动常见问题的更多相关文章

  1. ELK学习003:Elasticsearch启动常见问题

    一.Caused by: java.lang.RuntimeException: can not run elasticsearch as root 这个错误,是因为使用root用户启动elastic ...

  2. Tomcat服务器启动常见问题

    参考:http://www.cnblogs.com/xdp-gacl/p/3729033.html 学习web开发,需要先安装一台web服务器,然后再在web服务器中开发相应的web资源,供用户使用浏 ...

  3. ElasticSearch 启动时加载 Analyzer 源码分析

    ElasticSearch 启动时加载 Analyzer 源码分析 本文介绍 ElasticSearch启动时如何创建.加载Analyzer,主要的参考资料是Lucene中关于Analyzer官方文档 ...

  4. ElasticSearch启动错误处理方法

    在配置完elasticsearch,启动程序会包如下错误: [elk@localhost bin]$ ./elasticsearch ... ... ERROR: [3] bootstrap chec ...

  5. Linux安装ElasticSearch启动报错的解决方法

    Linux安装ElasticSearch后,ElasticSearch是不能用root用户启动的,以root用户启动会报错Refer to the log for complete error det ...

  6. ELK 学习笔记之 elasticsearch启动时Warning解决办法

    elasticsearch启动时Warning解决办法: 转载:http://www.dajiangtai.com/community/18136.do?origin=csdn-geek&dt ...

  7. 记一次环境变量导致的elasticsearch启动错误:max file descriptors [65535] for elasticsearch process is too low, incre

    问题描述,elasticsearch启动时报max file descriptors错误: [hadoop@node-33 elasticsearch-5.4.0]$ bin/elasticsearc ...

  8. elasticsearch启动时遇到的错误

    elasticsearch启动时遇到的错误 问题翻译过来就是:elasticsearch用户拥有的内存权限太小,至少需要262144: 解决: 切换到root用户 执行命令: sysctl -w vm ...

  9. Elasticsearch启动、停止脚本

    注:本文出自博主 Chloneda:个人博客 | 博客园 | Github | Gitee | 知乎 本文源链接:https://www.cnblogs.com/chloneda/p/es-shell ...

随机推荐

  1. 理解 TCP/IP 三次握手与四次挥手

    TCP建立连接为什么是三次握手,而不是两次或四次? TCP,名为传输控制协议,是一种可靠的传输层协议,IP协议号为6. 顺便说一句,原则上任何数据传输都无法确保绝对可靠,三次握手只是确保可靠的基本需要 ...

  2. java 多线程间通信(二)

    传统的线程通信 Object提供了三个方法wait(), notify(), notifyAll()在线程之间进行通信,以此来解决线程间执行顺序等问题. wait():释放当前线程的同步监视控制器,并 ...

  3. 七、Null、空以及0的区别

    一.Null的区别 create database scort use scort create table emp ( empno int primary key, ename ), sal int ...

  4. 转载:tomcat过程原理

    基于Java的Web 应用程序是 servlet.JSP 页面.静态页面.类和其他资源的集合,它们可以用标准方式打包,并运行在来自多个供应商的多个容器.Web 应用程序存在于结构化层次结构的目录中,该 ...

  5. Codeforces 1188D Make Equal DP

    题意:给你个序列,你可以给某个数加上2的幂次,问最少多少次可以让所有的数相等. 思路(官方题解):我们先给序列排序,假设bit(c)为c的二进制数中1的个数,假设所有的数最后都成为了x, 显然x &g ...

  6. ArrayList详解,底层是数组,实现Serializable接口

    一.对于ArrayList需要掌握的七点内容 ArrayList的创建:即构造器往ArrayList中添加对象:即add(E)方法获取ArrayList中的单个对象:即get(int index)方法 ...

  7. 理解Java主函数中的"String[] args"

    public class Understand_String_args { public static void main(String[] args) { System.out.printf(&qu ...

  8. JavaScript设计模式小抄集(持续更新)

    前言 本文旨在记录JavaScript中常用的设计模式代码片段,简要说明使用场景,不过于追究细节.在设计模式开篇之前,还是先要搞清楚JavaScript中关于面向对象的基础知识,可以先看看JavaSc ...

  9. 文本处理工具——sed进阶

    一sed的搜索替代 (一)常见的和替代相关的选项 搜索替代,和vim的写法很像 s///:查找替换,支持使用其它分隔符,s@@@,s### p: 显示替换成功的行,就是打印. w /PATH/TO/S ...

  10. font-size-adjust属性定义及用法

    font-size-adjust属性定义及用法 在css中,font-size-adjust属性是使用来更好的控制字体大小,当第一个选择的字体不可用时,浏览器使用第二个指定的字体,这可能会导致改变字体 ...