elasticsearch failed to obtain node locks
0x00 事件
重启服务器后,启动 elasticsearch 失败,在日志中观察到以下错误:
[2019-10-25T17:29:54,639][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [test-machine] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to obtain node locks, tried [[/var/lib/elasticsearch/sunaw-cluster]] 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.4.3.jar:6.4.3]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:127) ~[elasticsearch-6.4.3.jar:6.4.3]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.4.3.jar:6.4.3]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.4.3.jar:6.4.3]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.4.3.jar:6.4.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-6.4.3.jar:6.4.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:86) ~[elasticsearch-6.4.3.jar:6.4.3]
Caused by: java.lang.IllegalStateException: failed to obtain node locks, tried [[/var/lib/elasticsearch/sunaw-cluster]] 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:247) ~[elasticsearch-6.4.3.jar:6.4.3]
at org.elasticsearch.node.Node.<init>(Node.java:274) ~[elasticsearch-6.4.3.jar:6.4.3]
at org.elasticsearch.node.Node.<init>(Node.java:256) ~[elasticsearch-6.4.3.jar:6.4.3]
at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:213) ~[elasticsearch-6.4.3.jar:6.4.3]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:213) ~[elasticsearch-6.4.3.jar:6.4.3]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:326) ~[elasticsearch-6.4.3.jar:6.4.3]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) ~[elasticsearch-6.4.3.jar:6.4.3]
0x01 解决
在一些文章的帮助下查询了进程,发现了另一个 elasticsearch 服务,虽然不清楚是如何启动的,kill 掉即可:
[root@central-machine /usr/share/elasticsearch]#ps -ef | grep elasticsearch
elastic+ 1113 1 24 17:17 ? 00:03:19 /bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -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 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Djava.io.tmpdir=/tmp/elasticsearch.O6OSL2h2 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/lib/elasticsearch -XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -Xloggc:/var/log/elasticsearch/gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=32 -XX:GCLogFileSize=64m -Des.path.home=/usr/share/elasticsearch -Des.path.conf=/etc/elasticsearch -Des.distribution.flavor=default -Des.distribution.type=rpm -cp /usr/share/elasticsearch/lib/* org.elasticsearch.bootstrap.Elasticsearch -p /var/run/elasticsearch/elasticsearch.pid --quiet
elastic+ 5193 1113 0 17:17 ? 00:00:00 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller
root 14123 10944 0 17:30 pts/0 00:00:00 grep --color=auto elasticsearch
[root@central-machine /usr/share/elasticsearch]#kill -9 1113
[root@central-machine /usr/share/elasticsearch]#ps -ef | grep elasticsearch
root 14151 10944 0 17:31 pts/0 00:00:00 grep --color=auto elasticsearch
kill 掉之后,再启动 elasticsearch,没有再出现此错误,服务也正常运行。
elasticsearch failed to obtain node locks的更多相关文章
- elastic search报错——“failed to obtain node locks”
启动时报错信息: 这里写图片描述 寻找主要信息:failed to obtain node locks这里写图片描述简单理解为:绑定节点失败!!! 百度后,好多人同样遇到了这个问题,导致的原因可能是因 ...
- 配置web pack loader 报错:Module build failed: Error: The node API for `babel` has been moved to `babel-core`.
报错如下 Module build failed: Error: The node API for `babel` has been moved to `babel-core`. 在我配置loader ...
- HikariCP 脑火Failed to obtain JDBC Connection: You need to run the CLI build and you need target/classes in your classpath to run.
测试了一下 HikariCP 连接池报错,无解 十一月 16, 2017 5:31:59 下午 org.apache.catalina.core.StandardContext loadOnStart ...
- failed to obtain a cell from its dataSource 问题处理
最近在处理bugly问题的时候,总会看到回话列表有奔溃,但是由于没有啥具体的细节原因也无从下手. 只知道ConversationListViewController这个类的奔溃,报的问题是这个,也只有 ...
- Failed to obtain lock on file /usr/local/nagios/var/ndo2db.lock: Permission denied : Permission denied
Failed to obtain lock on file /usr/local/nagios/var/ndo2db.lock: Permission denied : Permission den ...
- springCloud微服务调用失败【CannotGetJdbcConnectionException: Failed to obtain JDBC Connection】
详情如下: 2019-07-28 10:56:18.229 ERROR 16212 --- [nio-8081-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet ...
- docker启动elasticsearch异常Failed to create node environment(解决)
异常说是创建节点环境失败,操作/usr/share/elasticsearch/data/nodes的IO错误,尝试给此目录添加读写权限后,依旧没什么**用,灵机一动是不是挂载目录没有权限导致的? c ...
- Elasticsearch.js 发布 —— 在Node.js和浏览器中调用Elasticsearch(1)
继PHP.Ruby.Python和Perl之后,Elasticsearch最近发布了Elasticsearch.js,Elasticsearch的JavaScript客户端库.可以在Node.js和浏 ...
- Elasticsearch.js 发布 —— 在Node.js和浏览器中调用Elasticsearch
继PHP.Ruby.Python和Perl之后,Elasticsearch最近发布了Elasticsearch.js,Elasticsearch的JavaScript客户端库.可以在Node.js和浏 ...
随机推荐
- Codeforces Round #608 (Div. 2) 题解
目录 Codeforces Round #608 (Div. 2) 题解 前言 A. Suits 题意 做法 程序 B. Blocks 题意 做法 程序 C. Shawarma Tent 题意 做法 ...
- 剑指offer-36:数组中的逆序对
参考:1. https://www.geeksforgeeks.org/merge-sort/ 2.<剑指Offer:名企面试官精讲典型编程题> 题目描述 在数组中的两个数字,如果前面一个 ...
- gorm操练记录
这个数据库的定义蛮全的,先作个记录. package main import ( "time" "github.com/jinzhu/gorm" _ " ...
- JavaScript-----15.简单数据类型和复杂数据类型
1. 简单数据类型和复杂数据类型 简单数据类型又叫做基本数据类型或者值类型,复杂类型又叫做引用类型 值类型:在存储时变量中存储的是值本身:string number Boolean undefined ...
- CentOS7中_带sqlite3_CGO的golang程序_交叉编译到arm中
CentOS7中_带sqlite3_CGO的golang程序_交叉编译到arm中 转载注明来源: 本文链接 来自osnosn的博客,写于 2019-10-28. 编写了个golang程序,用到了这个C ...
- Centos 下安装 PHP (新)
今天重新实践了下 CentOS 7.6 下安装 PHP7 并完成配置,总结了一条可以照其实现的套路. 安装 PHP 所需扩展 # yum install libxml2 libxml2-devel o ...
- C# Monitor and transfer or copy the changed or created file to a new location
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Tex ...
- 字符串模式匹配——KMP算法
KMP算法匹配字符串 朴素匹配算法 字符串的模式匹配的方法刚开始是朴素匹配算法,也就是经常说的暴力匹配,说白了就是用子串去和父串一个一个匹配,从父串的第一个字符开始匹配,如果匹配到某一个失配了,就 ...
- python3 tornado api + angular8 + nginx 跨域问题
问题: 上一个博客部署好了api之后,前端开始吊发现了跨域的问题. 接口地址: http://111.231.201.164/api/houses 服务器上使用的是nginx转发 数据: 前端ang ...
- XTTS Creates Alias on Destination when Source and Destination use ASM (Doc ID 2351123.1)
XTTS Creates Alias on Destination when Source and Destination use ASM (Doc ID 2351123.1) APPLIES TO: ...