Why ElassticSearch unavailable after restart, some shard unassigned?
<p>I have a elasticsearch service running on one node.  After I restart the ES. Some shard remain unassigned for a few minute. </p>

<p>The whole step is like below:</p>

<ol>
<li><p>I load a lot data into my Elasticsearch.</p></li>
<li><p>I kill my elasticsearch process </p></li>
<li><p>After restart, the elasticsearch become red. Some Shard remain un-assigned.</p></li>
</ol>

<p>Something I noticed is that. Before I kill the elasticsearch, I checked the shard, it is like this</p>

<pre><code>[sflow@ES01 bin]$ curl 'localhost:9200/_cat/shards?v'
index             shard prirep state      docs store ip            node 
sflow_51452355200 2     p      STARTED 5997062 2.8gb 10.79.148.184 ES01 
sflow_51452355200 1     p      STARTED 6000474 2.9gb 10.79.148.184 ES01 
sflow_51452355200 4     p      STARTED 5997701 3.1gb 10.79.148.184 ES01 
sflow_51452355200 3     p      STARTED 5999565   3gb 10.79.148.184 ES01 
sflow_51452355200 0     p      STARTED 5999198 2.8gb 10.79.148.184 ES01 
</code></pre>

<p>The size of each shard is not balanced.</p>

<p>After I restart, the shard will like below for a while</p>

<pre><code>[sflow@ES01 bin]$ curl 'localhost:9200/_cat/shards?v'
index             shard prirep state        docs store ip            node 
sflow_51452355200 4     p      INITIALIZING            10.79.148.184 ES01 
sflow_51452355200 2     p      INITIALIZING            10.79.148.184 ES01 
sflow_51452355200 3     p      UNASSIGNED                                 
sflow_51452355200 1     p      INITIALIZING            10.79.148.184 ES01 
sflow_51452355200 0     p      INITIALIZING            10.79.148.184 ES01 
</code></pre>

<p>Then after a few min， the shard become below </p>

<pre><code>[sflow@ES01 bin]$ curl 'localhost:9200/_cat/shards?v'
index             shard prirep state      docs store ip            node 
sflow_51452355200 4     p      STARTED 5997701 2.3gb 10.79.148.184 ES01 
sflow_51452355200 2     p      STARTED 5997062 2.3gb 10.79.148.184 ES01 
sflow_51452355200 3     p      STARTED 5999565 2.3gb 10.79.148.184 ES01 
sflow_51452355200 1     p      STARTED 6000474 2.3gb 10.79.148.184 ES01 
sflow_51452355200 0     p      STARTED 5999198 2.3gb 10.79.148.184 ES01 
</code></pre>

<p><strong>It seems data in the index is re-balanced. But I thought the where the data should be located is decided during the index time by the routing method. Why the data got re-balanced after I restart the index?</strong></p>