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 ...
随机推荐
- DataX简介
DataX 是阿里巴巴集团内被广泛使用的离线数据同步工具/平台,实现包括 MySQL.Oracle.SqlServer.Postgre.HDFS.Hive.ADS.HBase.TableStore(O ...
- 扩展阿里巴巴Java开发规约插件(转)
转自:https://blog.csdn.net/u014513883/article/details/79186893 1.前言 工作中难免会遇到维护别人代码的情况,那么首先就得看懂别人写的代码.如 ...
- github 配置ssh
https://www.cnblogs.com/superGG1990/p/6844952.html
- java输出当前文件所在路径
System.out.println(System.getProperty("user.dir"));//user.dir指定了当前的路径
- 关于Linux_系统资源监控_dmesg_free_uptime_uname
(系统资源查看命令-dmesg[查看系统内核资源信息])->判断服务器的硬件状态 Comment:dmesg | grep CPU,指定查看cpu资源信息 (系统资源查看命令-free[查看内存 ...
- nodejs npm 常用配置
npm install moduleNames : 安装 Node 模块.node安装分为全局模式和本地模式. npm install -g moduleName.npm install expres ...
- Halo(四)
BeanWrapper 接口 操作属性 package org.springframework.beans; BeanWrapper bw = new BeanWrapperImpl(beanObje ...
- PHP filter_var_array() 函数
定义和用法 filter_var_array() 函数获取多个变量,并进行过滤. 该函数对过滤多个值很有用,无需重复调用 filter_var(). 如果成功,则以数组形式返回请求变量的值.如果失败, ...
- VIM的一些使用积累
替换: :s/cst/dst/gc 黏贴后格式不对齐: gg=G 全选并黏贴 gg :"+yG
- QT树莓派交叉编译开发环境搭建
QT树莓派交叉编译开发环境搭建 - JerryZone <Cross-compiling Qt Embedded 5.5 for Raspberry Pi 2> <Qt for Em ...