简体   繁体   中英

ElasticSearch IndexMissingException while using prepareGet

I am trying to get data from elasticsearch using Java's GET API. but I keep on getting the IndexMisingException.

 Exception in thread "main" org.elasticsearch.indices.IndexMissingException: [logstash-*] missing at org.elasticsearch.cluster.metadata.MetaData.concreteIndices(MetaData.java:768) at org.elasticsearch.cluster.metadata.MetaData.concreteIndices(MetaData.java:691) at org.elasticsearch.cluster.metadata.MetaData.concreteSingleIndex(MetaData.java:748) at org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.<init>(TransportShardSingleOperationAction.java:139) at org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.<init>(TransportShardSingleOperationAction.java:116) at org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:89) at org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:55) at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:75) at org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:98) at org.elasticsearch.client.support.AbstractClient.get(AbstractClient.java:193) at org.elasticsearch.action.get.GetRequestBuilder.doExecute(GetRequestBuilder.java:201) at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:91) at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:65) at elasticConnection.ClientElastic.main(ClientElastic.java:18) 

I have the Index in elasticsearch.

 health status **index** pri rep docs.count docs.deleted store.size pri.store.size yellow open **events** 5 1 39 0 48.7kb 48.7kb yellow open **logstash-2016.03.30** 5 1 152 0 137.8kb 137.8kb 

please help.

Your indexes are still waiting for replica, which generally we avoid when working on a single node.

Run this command on your local host :

curl -XPUT 'localhost:9200/_settings' -d '{ "index" : { "number_of_replicas" : 0 } }'

This should change the index status to green and your program should be good to go.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM