0
votes

I have script for uploading the data to ElasticSearch and it works fine with ES clusters containing 3 ES instances. But running the script against a 2-instance cluster throws that cluster into yellow status. Deleting the index restores them to green.

Found this: "A yellow cluster status means that the primary shards for all indices are allocated to nodes in a cluster, but the replica shards for at least one index are not."

How could I fix that? Should I improve my script somehow with a cluster size switch?

1

1 Answers

0
votes

You certainly have in your index settings that you need 2 replicas. And as you cant have a replica and a primary shard on the same node, your cluster cant allocate all your shards in a 2 node cluster.

Could you try to decrease your number of replica to 1 ?

see here for the doc:

PUT /<your_index>/_settings
{
    "index" : {
        "number_of_replicas" : 1
    }
}

Keep us posted !