添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

一、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 64-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
[2018-06-20T02:19:58,978][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:140) ~[elasticsearch-6.3.0.jar:6.3.0]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:127) ~[elasticsearch-6.3.0.jar:6.3.0]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.3.0.jar:6.3.0]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.3.0.jar:6.3.0]
	at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.3.0.jar:6.3.0]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-6.3.0.jar:6.3.0]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:86) ~[elasticsearch-6.3.0.jar:6.3.0]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
	at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:104) ~[elasticsearch-6.3.0.jar:6.3.0]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:171) ~[elasticsearch-6.3.0.jar:6.3.0]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:326) ~[elasticsearch-6.3.0.jar:6.3.0]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) ~[elasticsearch-6.3.0.jar:6.3.0]
	... 6 more

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

step1:用户组进行授权启动
groupadd elsearch           
useradd elsearch -g elsearch -p elasticsearch
chown -R elsearch:elsearch  elasticsearch-6.3.0
备注: 添加用户组 elsearch  
      添加用户 elsearch 密码为 elasticsearch 到用户组 elsearch
      将elsearch安装目录授权给 用户组:用户  即 elsearch:elsearch
step2: 重新启动
su elsearch
/elasticsearch-6.3.0/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.0/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 4 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.0/bin/elasticsearch

四、ERROR: [3] bootstrap checks failed

详细错误:

[2018-06-20T02:35:47,152][INFO ][o.e.b.BootstrapChecks    ] [SUcoFrg] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [3] bootstrap checks failed
[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]
[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2018-06-20T02:35:47,170][INFO ][o.e.n.Node               ] [SUcoFrg] stopping ...
[2018-06-20T02:35:47,316][INFO ][o.e.n.Node               ] [SUcoFrg] stopped
[2018-06-20T02:35:47,316][INFO ][o.e.n.Node               ] [SUcoFrg] closing ...
[2018-06-20T02:35:47,336][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        65536 
elsearch       soft        nofile        65536
*               soft       nproc         4096
*               hard       nproc         4096 
备注: 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(5) and sysctl.d(5).
vm.max_map_count = 655360
备注:vm.max_map_count = 655360 值大于错误提示值
step3:重启
su elsearch
/elasticsearch-6.3.0/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])?

详细报错:
[2018-06-20T04:23:25,003][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.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])?
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:140) ~[elasticsearch-6.3.0.jar:6.3.0]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:127) ~[elasticsearch-6.3.0.jar:6.3.0]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.3.0.jar:6.3.0]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.3.0.jar:6.3.0]
	at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.3.0.jar:6.3.0]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-6.3.0.jar:6.3.0]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:86) ~[elasticsearch-6.3.0.jar:6.3.0]
Caused by: 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])?
	at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:243) ~[elasticsearch-6.3.0.jar:6.3.0]
	at org.elasticsearch.node.Node.<init>(Node.java:270) ~[elasticsearch-6.3.0.jar:6.3.0]
	at org.elasticsearch.node.Node.<init>(Node.java:252) ~[elasticsearch-6.3.0.jar:6.3.0]
	at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:213) ~[elasticsearch-6.3.0.jar:6.3.0]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:213) ~[elasticsearch-6.3.0.jar:6.3.0]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:326) ~[elasticsearch-6.3.0.jar:6.3.0]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) ~[elasticsearch-6.3.0.jar:6.3.0]
	... 6 more

原因:线程占用

解决:重新启动

step1:杀死elasticsearch线程
ps -ef | grep elastic
kill -9 2002
step2: 重启
su elsearch
/elasticsearch-6.3.0/bin/elasticsearch

1、后台启动

 /home/elasticsearch-6.3.0/bin/elasticsearch -d

2、curl验证

curl http://zk01:9200

3、网站验证

org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root at org.elasticsearch.boots...
Issue Exception in thread "main" org.elasticsearch.bootstrap.BootstrapException: java.nio.file.AccessDeniedException: /usr/local/elasticsearch/elasticsearch-7.1.0/config/elasticsearch.keystore Likely ...
初始化密钥库问题 Exception in thread "main" org.elasticsearch.bootstrap.BootstrapException: java.nio.file.AccessDeniedException: /usr/local/elasticsearch/elasticsearch-6.6.0/config/elasticsearch.keystore Like...
解决方法: 该xxxx.dat文件,最后一个参数后没有加回车。这样,在Virtual User Genertator里面能读出最后一个参数,查看列表也正确,但是在Cotroller工具里却无法识别最后一个参数,所以报错。 2  Error-26612:HTTP Status-Code=500(Internal Server Er...
1.由gc引起节点脱离集群      因为gc时会使jvm停止工作,如果某个节点gc时间过长,master ping3次(zen discovery默认ping失败重试3次)不通后就会把该节点剔除出集群,从而导致索引进行重新分配。 解决方法: (1)优化gc,减少gc时间。(2)调大zen discovery的重试次数(es参数:ping_retries)和超时时间(es参数:ping_ti
1、使用root用户启动失败 在有一次搭建elasticsearch的时候,使用systemctl启动elasticsearch失败,然后在bin目录下面去使用启动脚本启动,发现报错不能用root用户启动,报“Caused by: java.lang.RuntimeException: can not run elasticsearch as root”: [root@localhost bin]...
本来只想安安静静装个es,看网上的步骤就两三步就完成了,但是到了我这里,因为我的服务器是新的,只有jdk是我自己装的1.8版本的,装的时候那真的是把坑都踩遍了,看样子不光是软件问题,环境也有很大的关系。下面就把我遇到的坑都贴出来看看吧。 安装的过程就只是解压,修改配置文件,启动的时候,错误就都来了。 启动bin目录下的elasticsearch [root@VM_0_4_centos elasti...
今天收到告警,vcenter链接状态异常,检查从center发现,输入正确的用户名和密码后,无法登录,提示:User name and password are required(用户名和密码被需要),即等同你未输入用户名和密码;输入错误的密码会提示身份认证非法,说明身份认证还是起作用的,服务状态可判断为正常。 页面强行登录时,报400错误。 问题分析: 1、vcenter输入正确的用户名和密码,无法登录,且提示需要用户名和密码,明明输入了为啥会不识别呢?后沟通确认无人修改过密码;即时修改过,应 [o.e.b.ElasticsearchUncaughtExceptionHandler] [node-1] uncaught exception in thread [main] org.elasticsearch.bootstrap.StartupException:...
完整的错误信息是:uncaught exception in thread [main]org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to obtain node locks, tried [[/data/elasticsearch]] with lock id [0...
[2019-03-18T22:24:21,549][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main] org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not ...
#系统网络通信需要通过ip地址这个数字 #当操作者输入网址www.baidu.com,这个网址不是一个可以通信的IP地址 #于是必须要在系统中把www.baidu.com变成百度服务器的IP地址 #这样的过程叫做地址解析 DNS服务器:domain name server == 域名解析服务 ##解析就是把域名变成IP vim /etc/resolv.conf ##dns的指向文件 不需要重新启动网络立即生效 nameserver 114.