# The number of shards becomes 0 after changing index.number\_of\_shards

**URL:** <https://discuss.elastic.co/t/the-number-of-shards-becomes-0-after-changing-index-number-of-shards/10954>\
**Category:** Elasticsearch\
**Created:** [February 28, 2013, 5:06pm UTC](https://discuss.elastic.co/t/the-number-of-shards-becomes-0-after-changing-index-number-of-shards/10954 "2013-02-28T17:06:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jingang\_Wang](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@Jingang\_Wang](https://discuss.elastic.co/u/Jingang_Wang)\
**Post date:** [February 28, 2013, 5:06pm UTC](https://discuss.elastic.co/t/the-number-of-shards-becomes-0-after-changing-index-number-of-shards/10954/1 "2013-02-28T17:06:24Z")

</div>

Hi there, I found that when I changed the index.number\_of\_shards, such as  
from 5 to 10, the shards will become 0 (using elasticsearch master to  
view), it's so weird.  
could anybody encounter this situation? Where have I make a mistake?  
Any help would be appreciated!

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Kay\_Ropke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kay_ropke/32/2424_2.png) [@Kay\_Ropke](https://discuss.elastic.co/u/Kay_Ropke)\
**Post date:** [February 28, 2013, 5:09pm UTC](https://discuss.elastic.co/t/the-number-of-shards-becomes-0-after-changing-index-number-of-shards/10954/2 "2013-02-28T17:09:25Z")

</div>

You cannot change the number of shards dynamically. The logs should show an  
exception and the number shouldn't change.

On Thu, Feb 28, 2013 at 6:06 PM, Jingang Wang [bitwjg@gmail.com](mailto:bitwjg@gmail.com) wrote:

> Hi there, I found that when I changed the index.number\_of\_shards, such as  
> from 5 to 10, the shards will become 0 (using elasticsearch master to  
> view), it's so weird.  
> could anybody encounter this situation? Where have I make a mistake?  
> Any help would be appreciated!
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Jingang\_Wang](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@Jingang\_Wang](https://discuss.elastic.co/u/Jingang_Wang)\
**Post date:** [February 28, 2013, 5:21pm UTC](https://discuss.elastic.co/t/the-number-of-shards-becomes-0-after-changing-index-number-of-shards/10954/3 "2013-02-28T17:21:08Z")

</div>

Thanks for your reply, and sorry for my wrong description.  
I know I can not change it dynamically, but I changed it in the config file\* elasticsearch.yml  
\*and restart ES, the number of shards is 0.

On Friday, March 1, 2013 1:09:25 AM UTC+8, Kay Röpke wrote:

> You cannot change the number of shards dynamically. The logs should show  
> an exception and the number shouldn't change.
> 
> On Thu, Feb 28, 2013 at 6:06 PM, Jingang Wang \<[bit...@gmail.com](mailto:bit...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > Hi there, I found that when I changed the index.number\_of\_shards, such as  
> > from 5 to 10, the shards will become 0 (using elasticsearch master to  
> > view), it's so weird.  
> > could anybody encounter this situation? Where have I make a mistake?  
> > Any help would be appreciated!
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [March 1, 2013, 9:26am UTC](https://discuss.elastic.co/t/the-number-of-shards-becomes-0-after-changing-index-number-of-shards/10954/4 "2013-03-01T09:26:23Z")

</div>

even if you change it in the yml file it would not be applied to existing  
indices. Yet, I think we should still fail in that case

simon

On Thursday, February 28, 2013 6:21:08 PM UTC+1, Jingang Wang wrote:

> Thanks for your reply, and sorry for my wrong description.  
> I know I can not change it dynamically, but I changed it in the config file
> 
> - elasticsearch.yml \*and restart ES, the number of shards is 0.
> 
> On Friday, March 1, 2013 1:09:25 AM UTC+8, Kay Röpke wrote:
> 
> > You cannot change the number of shards dynamically. The logs should show  
> > an exception and the number shouldn't change.
> > 
> > On Thu, Feb 28, 2013 at 6:06 PM, Jingang Wang [bit...@gmail.com](mailto:bit...@gmail.com) wrote:
> > 
> > > Hi there, I found that when I changed the index.number\_of\_shards, such  
> > > as from 5 to 10, the shards will become 0 (using elasticsearch master to  
> > > view), it's so weird.  
> > > could anybody encounter this situation? Where have I make a mistake?  
> > > Any help would be appreciated!
> > > 
> > > --  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:48am UTC](https://discuss.elastic.co/t/the-number-of-shards-becomes-0-after-changing-index-number-of-shards/10954/5 "2017-07-06T02:48:54Z")

</div>


