0

We are learning Elasticsearch with a Docker image, so we don't think there is any clustering involved.

We checked the status of the indices by the command GET _cat/indices/_all, and the health shows in "yellow".

The sample output of the command GET _cat/indices/_all:

yellow open logstash                     bNGIURXyQmWyPjFjWMOILQ 1 1    200    0 193.8kb 193.8kb
yellow open my-index-000001_bak_20230706 YJc1kqTTTt6WwQMX2Gz9kA 1 1 111113    0  80.8mb  80.8mb
yellow open my-index-000001              tjkcic-4SPyym0SP0GOkNA 3 2 111113 1689  78.1mb  78.1mb

Moreover, we collected more information by additional tests:

  • Deleting an index and then re-create a new index by the following commands. However, the re-created index still has health in "yellow".
DELETE /my-index-000001
PUT /my-index-000001
  • Check the number of the shards in the index by the command GET /_cat/indices/my-index-000001?v=true&h=index,shards. However the following output does not seem to contain any shards information.
index
my-index-000001

Our Question:

We wonder why the health status of the index is in "yellow".

James
  • 1,373
  • 3
  • 13
  • 27
  • 1
    Since you mentioned using a Docker image, are you running only 1 container with Elasticsearch? Which means you only have 1 Elasticsearch node? Then it means ES cannot allocate replicas for your index. See: [What does it mean when an Elasticsearch index has yellow health?](https://stackoverflow.com/q/60819814/2745495) – Gino Mempin Jul 08 '23 at 03:10
  • Yes, thank you for directions, and we have resolved the issue as described in the post below. Thank you again for the link. – James Jul 10 '23 at 17:48

1 Answers1

0

We understand the "yellow" status in the index health status now. Thanks to @gino-mempin for the directions.

With the following command we found out the default setting of number_of_replicas is 1, therefore our system does not have enough nodes to satisfy the allocation of the replicas.

GET /my-index-000001/_settings?include_defaults=true&filter_path=my-index-000001.settings.index.number_of_replicas
# Result:
# {
#   "my-index-000001": {
#     "settings": {
#       "index": {
#         "number_of_replicas": "1"
#       }
#     }
#   }
# }

We followed this post and changed the value to zero, so that the system is no longer looking for replicas. Then, the index health changed to green.

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

GET _cat/indices/_all
# yellow open test            YUBT2IhRQGSnnIFPrtaI_Q 1 1 257303     0 162.7mb 162.7mb
# green  open my-index-000001 J_ttsV5kRrSnX5_iufQD-Q 1 0 257306 21010 162.1mb 162.1mb

Thank you again for the help.

James
  • 1,373
  • 3
  • 13
  • 27