Well OK, I have a replica! But alas, it cannot be allocated:
"decision": "NO",
"explanation": "primary shard for this replica is not yet active"
}
So... what is the proper way to handle this? I guess it has something to do with the cluster/reroute API calls?
I just want to promote the replica 0 shard and forgot about the loss of primary 0.
systemctl restart is reasonable, and shouldn't cause this situation. I think something else is wrong with your setup. Can you share the full output of this command?
GET _cluster/allocation/explain
{"index":"FILL_IN_INDEX_NAME_HERE","shard":0,"primary":true}
Yes data is stored on raid 10/60 depending on how often it is accessed. I'm not aware of any disk failures. (And this is the second time a cluster restart resulted in a couple of red indices... )
Is it possible that the data files are on the node, but are not being read/found by Elasticsearch?
Also, this is version 6.8. And the cluster is overloaded, we are in the process of drastically reducing shard count and data stored in the cluster.
It seems that only those indices are really affected that were 0 or 1 days old. (The one in the example may be the result of an aborted shrink job(?)).
Also we have ZFS under the cluster, may be that has to do something with it... (Yea I was wrong about RAID10/60, that was the earlier cluster, this one has mirrors.)
So... if I have an index with a shard missing (store.found:false), but I do have the replica of the missing shard... How do I promote that replica to primary?
Cluster allocation API explains that:
"decision": "NO",
"explanation": "primary shard for this replica is not yet active"
No, that's not what this means. Until the shards are allocated there's not really any difference between primaries and replicas, and we don't even bother looking for possible replicas until we've assigned a primary. So store.found: false means that there's no copy of this shard, neither primary nor replica.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.