# Restarting Elasticsearch when running along with logstash

**URL:** <https://discuss.elastic.co/t/restarting-elasticsearch-when-running-along-with-logstash/25851>\
**Category:** Elasticsearch\
**Created:** [July 18, 2015, 9:31pm UTC](https://discuss.elastic.co/t/restarting-elasticsearch-when-running-along-with-logstash/25851 "2015-07-18T21:31:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![BZen](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@BZen](https://discuss.elastic.co/u/BZen)\
**Post date:** [July 18, 2015, 9:31pm UTC](https://discuss.elastic.co/t/restarting-elasticsearch-when-running-along-with-logstash/25851/1 "2015-07-18T21:31:58Z")

</div>

I started using Elastic Search very recently. So my questions might seen really idiotic. I have 2 es nodes and I am using logstash to send logs to them. The problem comes when I do a restart.  
After I do a restart either both the ES nodes become masters and the cluster becoes red and they dont seem to identify the other. Error I got

```
 org.elasticsearch.index.gateway.IndexShardGatewayRecoveryException: [logstash-2015.07.18][2] failed recovery
 at org.elasticsearch.index.gateway.IndexShardGatewayService$1.run(IndexShardGatewayService.java:162)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 at java.lang.Thread.run(Thread.java:745)
 Caused by: org.elasticsearch.index.engine.EngineCreationFailureException: [logstash-2015.07.18][2] failed to upgrade 3x segments
 at org.elasticsearch.index.engine.InternalEngine.<init>(InternalEngine.java:121)
 at org.elasticsearch.index.engine.InternalEngineFactory.newReadWriteEngine(InternalEngineFactory.java:24)
 at org.elasticsearch.index.shard.IndexShard.newEngine(IndexShard.java:1251)
 at org.elasticsearch.index.shard.IndexShard.createNewEngine(IndexShard.java:1246)
 at org.elasticsearch.index.shard.IndexShard.prepareForTranslogRecovery(IndexShard.java:767)
 at org.elasticsearch.index.gateway.local.LocalIndexShardGateway.recover(LocalIndexShardGateway.java:226)
 at org.elasticsearch.index.gateway.IndexShardGatewayService$1.run(IndexShardGatewayService.java:112)
```

---

<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:** [July 18, 2015, 10:04pm UTC](https://discuss.elastic.co/t/restarting-elasticsearch-when-running-along-with-logstash/25851/2 "2015-07-18T22:04:19Z")

</div>

That's not related to your dual master issue, to fix that you should really read [https://www.elastic.co/guide/en/elasticsearch/guide/current/\_important\_configuration\_changes.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/_important_configuration_changes.html)

---

<div class="post-metadata">

**Author:** ![BZen](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@BZen](https://discuss.elastic.co/u/BZen)\
**Post date:** [July 18, 2015, 10:28pm UTC](https://discuss.elastic.co/t/restarting-elasticsearch-when-running-along-with-logstash/25851/3 "2015-07-18T22:28:31Z")

</div>

@warkolm Thanks for the quick response. I changed the settings and did a quick restart. I dont get that error now and also the cluster status is not red. On a completely different note I get this error in Logstash and it cannot connect to Elasticsearch sometimes.

```
Jul 18, 2015 8:14:33 AM org.elasticsearch.discovery.zen.ZenDiscovery joinElectedMaster
 failed to send join request to master connect_timeout[30s]]; nested: SocketException[Network is unreachable]; ]
```

---

<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:** [July 18, 2015, 10:47pm UTC](https://discuss.elastic.co/t/restarting-elasticsearch-when-running-along-with-logstash/25851/4 "2015-07-18T22:47:27Z")

</div>

> [@BZen](#):
>
> Network is unreachable

That means you have a problem with your networking.  
Can you telnet from the LS host to the ES host on 9200?

---

<div class="post-metadata">

**Author:** ![BZen](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@BZen](https://discuss.elastic.co/u/BZen)\
**Post date:** [July 18, 2015, 10:53pm UTC](https://discuss.elastic.co/t/restarting-elasticsearch-when-running-along-with-logstash/25851/5 "2015-07-18T22:53:21Z")

</div>

They are both running in the same machine. In my logstash I have

```
elasticsearch { 
  host => localhost
  cluster => MyCluster
  ...
}
```

---

<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:** [July 18, 2015, 11:01pm UTC](https://discuss.elastic.co/t/restarting-elasticsearch-when-running-along-with-logstash/25851/6 "2015-07-18T23:01:13Z")

</div>

You need to put those in quotes, check the docs for formatting requirements 🙂

---

<div class="post-metadata">

**Author:** ![BZen](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@BZen](https://discuss.elastic.co/u/BZen)\
**Post date:** [July 18, 2015, 11:03pm UTC](https://discuss.elastic.co/t/restarting-elasticsearch-when-running-along-with-logstash/25851/7 "2015-07-18T23:03:51Z")

</div>

> [@warkolm](#):
>
> You need to put those in quotes, check the docs for formatting requirements

Sorry They are already in quotes in the conf file, I did not copy them I just typed them for reference. Thanks for the info though.

---

<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, 12:00am UTC](https://discuss.elastic.co/t/restarting-elasticsearch-when-running-along-with-logstash/25851/8 "2017-07-06T00:00:34Z")

</div>


