栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

elasticsearch未正常停止,重启报错

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

elasticsearch未正常停止,重启报错

1. 问题描述

== failed to obtain node locks, tried [[/var/lib/elasticsearch]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing==

[2022-05-20T14:11:28,005][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [st-police-cdh001] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to obtain node locks, tried [[/var/lib/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:163) ~[elasticsearch-7.12.1.jar:7.12.1]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-7.12.1.jar:7.12.1]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:75) ~[elasticsearch-7.12.1.jar:7.12.1]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:116) ~[elasticsearch-cli-7.12.1.jar:7.12.1]
	at org.elasticsearch.cli.Command.main(Command.java:79) ~[elasticsearch-cli-7.12.1.jar:7.12.1]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115) ~[elasticsearch-7.12.1.jar:7.12.1]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:81) ~[elasticsearch-7.12.1.jar:7.12.1]
Caused by: java.lang.IllegalStateException: failed to obtain node locks, tried [[/var/lib/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.(NodeEnvironment.java:292) ~[elasticsearch-7.12.1.jar:7.12.1]
	at org.elasticsearch.node.Node.(Node.java:352) ~[elasticsearch-7.12.1.jar:7.12.1]
	at org.elasticsearch.node.Node.(Node.java:278) ~[elasticsearch-7.12.1.jar:7.12.1]
	at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:217) ~[elasticsearch-7.12.1.jar:7.12.1]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:217) ~[elasticsearch-7.12.1.jar:7.12.1]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:397) ~[elasticsearch-7.12.1.jar:7.12.1]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-7.12.1.jar:7.12.1]
	... 6 more
2. 原因分析

没有正常停止elasticsearch

3. 解决办法

在每个ES节点,杀掉所有ES进程(带/usr/java/jdk1.8.0_181-cloudera的),然后在CDH中重启服务

(base) [root@st-police-java001 ~]# ps -ef | grep elasticsearch
root      4594 20870  0 14:32 pts/1    00:00:00 grep --color=auto elasticsearch
root     14622     1  0 5月16 ?       00:00:00 runuser -l elasticsearch -c ulimit -n 65536 && cd /opt/cloudera/parcels/ELASTICSEARCH/bin/ && JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera ./elasticsearch
elastic+ 14633 14622  0 5月16 ?       00:00:00 -bash -c ulimit -n 65536 && cd /opt/cloudera/parcels/ELASTICSEARCH/bin/ && JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera ./elasticsearch
elastic+ 14668 14633  0 5月16 ?       00:18:27 /usr/java/jdk1.8.0_181-cloudera/bin/java -Xshare:auto -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dio.netty.allocator.numDirectArenas=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Djava.locale.providers=SPI,JRE -XX:+AlwaysPreTouch -XX:CMSInitiatingOccupancyFraction=75 -XX:+DisableExplicitGC -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCMSInitiatingOccupancyOnly -XX:+UseConcMarkSweepGC -Xms2g -Xmx2g -Xss1m -Dfile.encoding=UTF-8 -Dio.netty.noKeySetOptimization=true -Dio.netty.noUnsafe=true -Dio.netty.recycler.maxCapacityPerThread=0 -Djava.awt.headless=true -Djdk.io.permissionsUseCanonicalPath=true -Djna.nosys=true -Dlog4j.shutdownHookEnabled=false -Dlog4j.skipJansi=true -Dlog4j2.disable.jmx=true -server -XX:MaxDirectMemorySize=1073741824 -Des.path.home=/opt/cloudera/parcels/ELASTICSEARCH -Des.path.conf=/opt/cloudera/parcels/ELASTICSEARCH/config -Des.distribution.flavor=default -Des.distribution.type=tar -Des.bundled_jdk=true -cp /opt/cloudera/parcels/ELASTICSEARCH/lib/* org.elasticsearch.bootstrap.Elasticsearch
(base) [root@st-police-java001 ~]# kill -9 14622
(base) [root@st-police-java001 ~]# kill -9 14633
(base) [root@st-police-java001 ~]# kill -9 14668
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/922090.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号