SoftwareNerd
SoftwareNerd

Reputation: 1905

Elastic Search Remove Unassigned Shards

I have an issue with the shards in Elastic Search. Whenever I create my index it creates an unassigned node with unassigned shards as shown below.

enter image description here

Can anyone please help me out here? Any help is much appreciated.

Upvotes: 0

Views: 2156

Answers (2)

BabaJaga
BabaJaga

Reputation: 59

PUT */_settings { "index.number_of_replicas": 0 }

This will update all indexes to have zero replicas. This will only work if wild card operations are allowed. Otherwise the command has to be run on every index in your cluster.

Upvotes: 1

Val
Val

Reputation: 217554

The reason is simply because you have only one node and one shard replica is always created by default.

In order to prevent this, you can remove the replicas from your index by calling this:

PUT suppliercloudproductindex1/_settings
{
    "index.number_of_replicas": 0
}

Alternately, you can also specify this setting when initially creating your index in order to make sure that no replica shard gets created:

PUT suppliercloudproductindex1
{
    "settings": {
        "index.number_of_replicas": 0
    }
}

Upvotes: 3

Related Questions