elasticsearch启动常见问题
原文: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启动常见问题的更多相关文章
- ELK学习003:Elasticsearch启动常见问题
一.Caused by: java.lang.RuntimeException: can not run elasticsearch as root 这个错误,是因为使用root用户启动elastic ...
- Tomcat服务器启动常见问题
参考:http://www.cnblogs.com/xdp-gacl/p/3729033.html 学习web开发,需要先安装一台web服务器,然后再在web服务器中开发相应的web资源,供用户使用浏 ...
- ElasticSearch 启动时加载 Analyzer 源码分析
ElasticSearch 启动时加载 Analyzer 源码分析 本文介绍 ElasticSearch启动时如何创建.加载Analyzer,主要的参考资料是Lucene中关于Analyzer官方文档 ...
- ElasticSearch启动错误处理方法
在配置完elasticsearch,启动程序会包如下错误: [elk@localhost bin]$ ./elasticsearch ... ... ERROR: [3] bootstrap chec ...
- Linux安装ElasticSearch启动报错的解决方法
Linux安装ElasticSearch后,ElasticSearch是不能用root用户启动的,以root用户启动会报错Refer to the log for complete error det ...
- ELK 学习笔记之 elasticsearch启动时Warning解决办法
elasticsearch启动时Warning解决办法: 转载:http://www.dajiangtai.com/community/18136.do?origin=csdn-geek&dt ...
- 记一次环境变量导致的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 ...
- elasticsearch启动时遇到的错误
elasticsearch启动时遇到的错误 问题翻译过来就是:elasticsearch用户拥有的内存权限太小,至少需要262144: 解决: 切换到root用户 执行命令: sysctl -w vm ...
- Elasticsearch启动、停止脚本
注:本文出自博主 Chloneda:个人博客 | 博客园 | Github | Gitee | 知乎 本文源链接:https://www.cnblogs.com/chloneda/p/es-shell ...
随机推荐
- python基础篇(文件操作)
Python基础篇(文件操作) 一.初始文件操作 使用python来读写文件是非常简单的操作. 我们使用open()函数来打开一个文件, 获取到文件句柄. 然后通过文件句柄就可以进行各种各样的操作了. ...
- how to use gflags
参考https://blog.csdn.net/jcjc918/article/details/50876613 安装: git clone https://github.com/gflags/gfl ...
- 链表反转&交换链表结点
leetcode链表反转链接 要求摘要: 反转一个单链表 输入: 1->2->3->4->5->NULL 输出: 5->4->3->2->1-&g ...
- The Preliminary Contest for ICPC Asia Nanjing 2019 D. Robots
题意:给出一个DAG,一只机器人从1点出发,等概率地选择一条出边走或者停留在原点,机器人的第k次行动消耗能量是k(无论是走还是停留都算一次行动).问1到n的期望. 解法:因为行动消耗的能量跟行动次数有 ...
- maven更换下载镜像源-解决下载慢问题(转)
转自:http://www.cnblogs.com/duking1991/p/6110192.html maven更换下载镜像源-解决下载慢问题 Maven是当前流行的项目管理工具,但官方的库在国 ...
- 横纵方向走马灯滚动,纯javascript代码
<body onload="beginmarquee()"> <table width="1024" border="0" ...
- CascadeCNN人脸检测结构
模型的结构大致由图可以完整展现,三个分类是否人脸的12.24.48net,再加上三个用于修正预测框的分类网络: 这三个分类是否人脸的网络,结构逐渐变复杂, 由上图可以看出,前2阶的网络都非常简单,只有 ...
- Java中"String.equals()“和"=="的区别
Do NOT use the `==`` operator to test whether two strings are equal! It only determines whether or n ...
- 【leetcode】316. Remove Duplicate Letters
题目如下: Given a string which contains only lowercase letters, remove duplicate letters so that every l ...
- vue 路由动态传参 (多个)
动态传参 传值页面 客户列表clientList.vue 路由 router.js 配置路由 接收参数的页面 客户详情CustomerDetails.vue 通过this.$router.para ...