English 中文(简体)
What does it mean when an Elasticsearch index has yellow health?
原标题:

I m working on an application that creates N indices and N aliases, and there s a one-to-one correspondence between these indices and aliases.

But once in a while, I instead get N indices and N-1 aliases, and one of the indices has a name that should ve been used by an alias. For some reason when this happens, the bogus index-that-should-have-been-an-alias-name has a yellow status, while the other indices are all green.

What might cause an index to be the only one that is yellow? I m hoping understanding this might help me narrow down which part of the code I need to scrutinize to fix the bug.

My elasticsearch.yml has just:

cluster.name: "docker-cluster"
network.host: 0.0.0.0
discovery.zen.ping.unicast.hosts: ["127.0.0.1", "[::1]"]

In production we may have more ES nodes, but this is just a test system, so just one ES node.

最佳回答

The status "yellow" indicates that replica shards of that certain index could not get allocated to other nodes.

This can happen for various reasons. For example, you have specified more replicas than you have nodes. It depends on your cluster setup and whether you configured shard allocation by your own or not.

问题回答

Elasticsearch will never assign a replica to the same node as the primary shard, so if you only have one node it is perfectly normal and expected for your cluster to indicate yellow. If you feel better about it being green, then change the number of replicas on each index to be 0.

PUT /my-index/_settings
{
    "index" : {
        "number_of_replicas" : 0
    }
}

Please read this blog https://opster.com/guides/elasticsearch/operations/elasticsearch-yellow-status/

It explains very well how to fix yellow indexes.





相关问题
WCF Web Services and native ASP.NET Health Monitoring

I need a final answer to the following question! :-) I was wondering if you can enable Health Monitoring for WCF Web services. I m hosting a number of services in IIS and configured it to send the ...

Monitor memory usage of child process

I have a Linux daemon that forks a few children and monitors them for crashes (restarting as needed). It will be great if the parent could monitor the memory usage of child processes - to detect ...

Unusual request URL in ASP.NET health monitoring event

I’m seeing a rather strange occurrence in the request information section of an ASP.NET health monitoring email I hope someone can shed some light on. This is a publicly facing website which runs on ...

How to maintain external links for a website?

I want to know how to control the links on the webpage, where the link leads to external sites. Sometimes it can be that an external site just vanishes and you don t know that such an event occurred. ...

SqlWebEventProvider w/ windows service

I am trying to raise some custom events to a SqlWebEventProvider from a windows service. Here are the steps I have taken and the results I have seen. I cannot figure this one out. Setup 2 ...

ASP.Net Health Monitoring - How to check Requests Queued

I have just discovered ASP.Net Health Monitoring - it looks awesome. I have been developing ASP.Net apps for years, and have even taken the Microsoft certs and have never seen it before. I can t ...

热门标签