elasticsearch: how to remove unassigned shards

elasticsearch 1.7.x on centOS

Our three node cluster became a 2 node cluster. All is well. We had 3 replicas of every shard, so we have it all.

But now cluster health is yellow, and we have:

 "unassigned_shards" : 5,

We already changed the replica count setting in elasticsearch.yml down to 1 (from 2) and restarted ES on both nodes. This made no difference.

What is the next step?

I see how to reassign shards, but not how to eliminate the unassigned shards.

Upvotes: 0

Views: 4461

Answers (1)

G Quintana
G Quintana

Reputation: 4667

Changing the number_of_replicas in elasticsearch.yaml is not enough, this setting is only used when creating new indices.

Use the Index Settings API to change the number of replicas of existing indexes:

PUT /_all/_settings
{
    "number_of_replicas": 2
}

Upvotes: 1

Related Questions