原文: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. rsync nfs 实时同步,结合实战

    目录 rsync nfs 实时同步,实战 一.部署rsync服务端(backup) 二.部署rsync客户端(nfs,web01) 三.部署web代码(web01) 四.NFS服务端部署(nfs) 五 ...

  2. IO,文件

    IO 1. 定义 >在内存中存在数据交换的操作认为是IO操作,比如和终端交互 ,和磁盘交互,和网络交互等 2. 程序分类 >* IO密集型程序:在程序执行中有大量IO操作,而cpu运算较少 ...

  3. package.json和package-lock.json的区别

    参考:https://blog.csdn.net/c2311156c/article/details/80320046 package.json: 主要用来定义项目中需要依赖的包 package-lo ...

  4. windows下基于(QPC)实现的微秒级延时

    1.为什么会写windows下微秒级延时 在上一篇 实现memcpy()函数及过程总结 中测试memcpy的效率中,测试时间的拷贝效率在微秒级别,需要使用微秒级时间间隔计数. windows下提供Qu ...

  5. 力扣 ——4Sum (四数之和)python 实现

    题目描述: 中文: 给定一个包含 n 个整数的数组 nums 和一个目标值 target,判断 nums 中是否存在四个元素 a,b,c 和 d ,使得 a + b + c + d 的值与 targe ...

  6. deep features for text spotting 在linux,windows上使用

    做文本检测这个方向的同学应该都知道 deep features for text spotting 这篇ECCV14的文章. 用的是Matconvnet这个是深度学习框架来做文本检测,同时他还提供了代 ...

  7. IronPython C#与Python相互调用

    ironphy  microsoft.scripting dll using System;using System.Collections.Generic;using System.Linq;usi ...

  8. Android 编译笔记20191205

    gradle下载很慢 解决问题的方法如下: 使用文件管理器 打开用户主目录 windows平台: c:\Users\用户名\.gradle macos平台: /Users/用户名/.gradle li ...

  9. 24.循环栅栏 CyclicBarrier

    import java.util.concurrent.BrokenBarrierException; import java.util.concurrent.CyclicBarrier; /** * ...

  10. C语言结构体实例-创建兔子

    参考裸编程思想. #include <stdio.h> //#include "ycjobject.h" // 颜色定义 #define CL_BLACK 0 #def ...