# 4 primary shards instead of 3

**URL:** https://discuss.elastic.co/t/4-primary-shards-instead-of-3/19513
**Category:** Elasticsearch
**Created:** [August 28, 2014, 4:04pm UTC](https://discuss.elastic.co/t/4-primary-shards-instead-of-3/19513 "2014-08-28T16:04:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Eddy\_Meds](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eddy_meds/32/1316_2.png) [@Eddy\_Meds](https://discuss.elastic.co/u/Eddy_Meds)
#### Post date: [August 28, 2014, 4:04pm UTC](https://discuss.elastic.co/t/4-primary-shards-instead-of-3/19513/1 "2014-08-28T16:04:39Z")

</div>

Hello

I created an index with 3 primarys shards but ElasticSearch return and  
indicate that there are 4 primary shards.

# Deleting the data in the cluster

DELETE /\_all

# Create an index with 3 primary shards with 1 replica each

PUT /blogs  
{  
"settings" : {  
"number\_of\_shards" : 3,  
"number\_of\_replicas" : 1  
}  
}

# Retrieve the cluster health

GET /\_cluster/health

And here is the response :

{  
"cluster\_name": "clus",  
"status": "yellow",  
"timed\_out": false,  
"number\_of\_nodes": 1,  
"number\_of\_data\_nodes": 1,  
"active\_primary\_shards": 4,  
"active\_shards": 4,  
"relocating\_shards": 0,  
"initializing\_shards": 0,  
"unassigned\_shards": 4  
}

I thought that there was only the number of replica shards that could  
change and that the number of primary shards was fixed at the time that the  
index was created, where does come from the fourth primary shard ?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bf10106b-d5c5-472b-ab73-a6e747e44e43%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bf10106b-d5c5-472b-ab73-a6e747e44e43%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [August 28, 2014, 10:36pm UTC](https://discuss.elastic.co/t/4-primary-shards-instead-of-3/19513/2 "2014-08-28T22:36:12Z")

</div>

Are you using marvel at all? It uses an index with a single shard by  
default.

Regards,  
Mark Walkom

Infrastructure Engineer  
Campaign Monitor  
email: [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
web: [www.campaignmonitor.com](http://www.campaignmonitor.com)

On 29 August 2014 02:04, Eddy Meds [zqckfair@gmail.com](mailto:zqckfair@gmail.com) wrote:

> Hello
> 
> I created an index with 3 primarys shards but Elasticsearch return and  
> indicate that there are 4 primary shards.
> 
> # Deleting the data in the cluster
> 
> DELETE /\_all
> 
> # Create an index with 3 primary shards with 1 replica each
> 
> PUT /blogs  
> {  
> "settings" : {  
> "number\_of\_shards" : 3,  
> "number\_of\_replicas" : 1  
> }  
> }
> 
> # Retrieve the cluster health
> 
> GET /\_cluster/health
> 
> And here is the response :
> 
> {  
> "cluster\_name": "clus",  
> "status": "yellow",  
> "timed\_out": false,  
> "number\_of\_nodes": 1,  
> "number\_of\_data\_nodes": 1,  
> "active\_primary\_shards": 4,  
> "active\_shards": 4,  
> "relocating\_shards": 0,  
> "initializing\_shards": 0,  
> "unassigned\_shards": 4  
> }
> 
> I thought that there was only the number of replica shards that could  
> change and that the number of primary shards was fixed at the time that the  
> index was created, where does come from the fourth primary shard ?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/bf10106b-d5c5-472b-ab73-a6e747e44e43%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bf10106b-d5c5-472b-ab73-a6e747e44e43%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/bf10106b-d5c5-472b-ab73-a6e747e44e43%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/bf10106b-d5c5-472b-ab73-a6e747e44e43%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEM624aN3kd8nMrofbq6Qa-N0bxZ8DcHd8JDw1AudV7yaAO0Gg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEM624aN3kd8nMrofbq6Qa-N0bxZ8DcHd8JDw1AudV7yaAO0Gg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Eddy\_Meds](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eddy_meds/32/1316_2.png) [@Eddy\_Meds](https://discuss.elastic.co/u/Eddy_Meds)
#### Post date: [August 28, 2014, 11:03pm UTC](https://discuss.elastic.co/t/4-primary-shards-instead-of-3/19513/3 "2014-08-28T23:03:39Z")

</div>

Yes thanks, that was Marvel !

On Thursday, August 28, 2014 6:04:39 PM UTC+2, Eddy Meds wrote:

> Hello
> 
> I created an index with 3 primarys shards but Elasticsearch return and  
> indicate that there are 4 primary shards.
> 
> # Deleting the data in the cluster
> 
> DELETE /\_all
> 
> # Create an index with 3 primary shards with 1 replica each
> 
> PUT /blogs  
> {  
> "settings" : {  
> "number\_of\_shards" : 3,  
> "number\_of\_replicas" : 1  
> }  
> }
> 
> # Retrieve the cluster health
> 
> GET /\_cluster/health
> 
> And here is the response :
> 
> {  
> "cluster\_name": "clus",  
> "status": "yellow",  
> "timed\_out": false,  
> "number\_of\_nodes": 1,  
> "number\_of\_data\_nodes": 1,  
> "active\_primary\_shards": 4,  
> "active\_shards": 4,  
> "relocating\_shards": 0,  
> "initializing\_shards": 0,  
> "unassigned\_shards": 4  
> }
> 
> I thought that there was only the number of replica shards that could  
> change and that the number of primary shards was fixed at the time that the  
> index was created, where does come from the fourth primary shard ?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e998670b-8a8d-4ecd-ad6b-a92799f1bebf%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e998670b-8a8d-4ecd-ad6b-a92799f1bebf%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 1:05am UTC](https://discuss.elastic.co/t/4-primary-shards-instead-of-3/19513/4 "2017-07-06T01:05:35Z")

</div>


