ElasticsearchException: java.io.IOException: failed to read [id:0, file:/data/elasticsearch/nodes/0/

Posted nohup python -u test.py >te

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ElasticsearchException: java.io.IOException: failed to read [id:0, file:/data/elasticsearch/nodes/0/相关的知识,希望对你有一定的参考价值。

from : https://www.cnblogs.com/hixiaowei/p/11213143.html

1.以前装过elasticsearch,重新安装elastic search ,报错

复制代码
[2019-07-19T14:32:10,720][ERROR][o.e.g.GatewayMetaState   ] [master-node] failed to read local state, exiting...
org.elasticsearch.ElasticsearchException: java.io.IOException: failed to read [id:0, file:/data/elasticsearch/nodes/0/_state/global-0.st]
    at org.elasticsearch.ExceptionsHelper.maybeThrowRuntimeAndSuppress(ExceptionsHelper.java:200) ~[elasticsearch-6.4.2.jar:6.4.2]
    at org.elasticsearch.gateway.MetaDataStateFormat.loadLatestState(MetaDataStateFormat.java:304) ~[elasticsearch-6.4.2.jar:6.4.2]
    at org.elasticsearch.gateway.MetaStateService.loadGlobalState(MetaStateService.java:112) ~[elasticsearch-6.4.2.jar:6.4.2]
    at org.elasticsearch.gateway.MetaStateService.loadFullState(MetaStateService.java:56) ~[elasticsearch-6.4.2.jar:6.4.2]
    at org.elasticsearch.gateway.GatewayMetaState.<init>(GatewayMetaState.java:86) [elasticsearch-6.4.2.jar:6.4.2]
    at org.elasticsearch.node.Node.<init>(Node.java:447) [elasticsearch-6.4.2.jar:6.4.2]
    at org.elasticsearch.node.Node.<init>(Node.java:256) [elasticsearch-6.4.2.jar:6.4.2]
    at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:213) [elasticsearch-6.4.2.jar:6.4.2]
    at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:213) [elasticsearch-6.4.2.jar:6.4.2]
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:326) [elasticsearch-6.4.2.jar:6.4.2]
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) [elasticsearch-6.4.2.jar:6.4.2]
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:127) [elasticsearch-6.4.2.jar:6.4.2]
    at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-6.4.2.jar:6.4.2]
    at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) [elasticsearch-cli-6.4.2.jar:6.4.2]
    at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-6.4.2.jar:6.4.2]
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) [elasticsearch-6.4.2.jar:6.4.2]
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:86) [elasticsearch-6.4.2.jar:6.4.2]
Caused by: java.io.IOException: failed to read [id:0, file:/data/elasticsearch/nodes/0/_state/global-0.st]
    at org.elasticsearch.gateway.MetaDataStateFormat.loadLatestState(MetaDataStateFormat.java:298) ~[elasticsearch-6.4.2.jar:6.4.2]
    ... 15 more
Caused by: java.lang.IllegalArgumentException: Unexpected field [cluster_uuid_committed]
    at org.elasticsearch.cluster.metadata.MetaData$Builder.fromXContent(MetaData.java:1232) ~[elasticsearch-6.4.2.jar:6.4.2]
    at org.elasticsearch.cluster.metadata.MetaData$1.fromXContent(MetaData.java:1262) ~[elasticsearch-6.4.2.jar:6.4.2]
    at org.elasticsearch.cluster.metadata.MetaData$1.fromXContent(MetaData.java:1253) ~[elasticsearch-6.4.2.jar:6.4.2]
    at org.elasticsearch.gateway.MetaDataStateFormat.read(MetaDataStateFormat.java:196) ~[elasticsearch-6.4.2.jar:6.4.2]
    at org.elasticsearch.gateway.MetaDataStateFormat.loadLatestState(MetaDataStateFormat.java:294) ~[elasticsearch-6.4.2.jar:6.4.2]
    ... 15 more
复制代码

2.删除*.st文件就可以了

find /data*/elasticsearch/data/nodes/0/indices/ | grep state | grep "\\.st" | xargs ls -l | awk \'{if($5==0)print $0}\'

以上是关于ElasticsearchException: java.io.IOException: failed to read [id:0, file:/data/elasticsearch/nodes/0/的主要内容,如果未能解决你的问题,请参考以下文章

ES IK拼音插件踩坑及填坑记录

kibana显示报错

Elasticsearch 常见异常

正在获取ElasticsearchStatusException和ElasticsearchResponseException?

Elasticsearch安装配置

Elasticsearch分页查询超过10000就报错