# When using bulk to input data during rolling restart elasticsearch, error happens,primary shard is not active Timeout: \[1m\]

**URL:** https://discuss.elastic.co/t/when-using-bulk-to-input-data-during-rolling-restart-elasticsearch-error-happens-primary-shard-is-not-active-timeout-1m/187704
**Category:** Elasticsearch
**Created:** [June 27, 2019, 2:33am UTC](https://discuss.elastic.co/t/when-using-bulk-to-input-data-during-rolling-restart-elasticsearch-error-happens-primary-shard-is-not-active-timeout-1m/187704 "2019-06-27T02:33:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![luxx](https://avatars.discourse-cdn.com/v4/letter/l/e19b73/32.png) [@luxx](https://discuss.elastic.co/u/luxx)
#### Post date: [June 27, 2019, 2:33am UTC](https://discuss.elastic.co/t/when-using-bulk-to-input-data-during-rolling-restart-elasticsearch-error-happens-primary-shard-is-not-active-timeout-1m/187704/1 "2019-06-27T02:33:03Z")

</div>

elasticsearch6.7.1  
3 hosts  
1：EsMaster  
2：EsMaster、EsClient、EsNode1、EsNode2  
3：EsMaster、EsClient、EsNode1、EsNode2

keep bulk data into es during rolling restart,  
my steps:  
1.set "cluster.routing.allocation.enable": "none"  
2.\_flush/synced(may not success)  
3.restart a esnode;  
4.set "cluster.routing.allocation.enable": "all"  
5.waiting until the cluster status become green;  
6.repeat 1~5 until all esnodes are restarted.

question:  
when some esnode stoped,some json response of bulk may be failed,the error is

`primary shard is not active Timeout: [1m], request: [BulkShardRequest [[myindex-002][3]] containing [198] requests]","type":"unavailable_shards_exception"},"status":503`

I consider that when a esnode is shutdown,primary shards on it will soon transfer to the corresponding replica, which means,primary shard become replica, replica become primary shard.  
And I tested ,shutdown a esnode when not bulking , the transfer happens in a moment.

So，does anyone has some suggestion？ thanks a lot.

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [June 27, 2019, 5:02am UTC](https://discuss.elastic.co/t/when-using-bulk-to-input-data-during-rolling-restart-elasticsearch-error-happens-primary-shard-is-not-active-timeout-1m/187704/2 "2019-06-27T05:02:48Z")

</div>

Does all your indices have at least one replica configured? Can you see anything about cluster state updates timing out in the Elasticsearch logs, likely on the currently elected master node? How many indices and shards do you have in the cluster?

---

<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 25, 2019, 5:02am UTC](https://discuss.elastic.co/t/when-using-bulk-to-input-data-during-rolling-restart-elasticsearch-error-happens-primary-shard-is-not-active-timeout-1m/187704/3 "2019-07-25T05:02:51Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
