# Running logstash and elasticsearch on two machine

**URL:** <https://discuss.elastic.co/t/running-logstash-and-elasticsearch-on-two-machine/26270>\
**Category:** Logstash\
**Created:** [July 24, 2015, 9:47pm UTC](https://discuss.elastic.co/t/running-logstash-and-elasticsearch-on-two-machine/26270 "2015-07-24T21:47:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![DavidL](https://avatars.discourse-cdn.com/v4/letter/d/ecc23a/32.png) [@DavidL](https://discuss.elastic.co/u/DavidL)\
**Post date:** [July 24, 2015, 9:47pm UTC](https://discuss.elastic.co/t/running-logstash-and-elasticsearch-on-two-machine/26270/1 "2015-07-24T21:47:31Z")

</div>

I have worked out everything on my local machine, parsed my logs in logstash, stored them in kibana, and built dashboards for my data on Kibana.  
Now I trying to mock a production scenario where logstash is installed on one server and elasticsearch on another.  
Currently, the only thing I did was specifying in logstash the host to be the IP address of the elasticsearch host:  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/8/8a4a0038dc2911068a6bc852d26f1c52c0c8e0d1.png)  
and in elasticsearch.yml on the elasticsearch server, change network.host to the IP address of the logstash server.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/d/def82fe6ed5d4cb98c48808be450f8a9db163885.png)  
And I dont think it works, can some one tell me what other settings I need to change or point me to some guides regarding setting this up? Thanks a million in advance

---

<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 25, 2015, 12:45am UTC](https://discuss.elastic.co/t/running-logstash-and-elasticsearch-on-two-machine/26270/2 "2015-07-25T00:45:12Z")

</div>

Add `protocol => http` to the ES output and try again.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 25, 2015, 8:50am UTC](https://discuss.elastic.co/t/running-logstash-and-elasticsearch-on-two-machine/26270/3 "2015-07-25T08:50:20Z")

</div>

> and in elasticsearch.yml on the elasticsearch server, change network.host to the IP address of the logstash server.

No, don't do that. The `network.*` settings must point to addresses held by interfaces _by the machine running Elasticsearch_. You don't need to do anything special to have Logstash connect to ES. Just make sure Logstash can connect to port 9300 on the ES machine (or port 9200 if you're using HTTP, which I'd recommend anyway) and that they have the same cluster name configured.

---

<div class="post-metadata">

**Author:** ![DavidL](https://avatars.discourse-cdn.com/v4/letter/d/ecc23a/32.png) [@DavidL](https://discuss.elastic.co/u/DavidL)\
**Post date:** [July 27, 2015, 3:33pm UTC](https://discuss.elastic.co/t/running-logstash-and-elasticsearch-on-two-machine/26270/4 "2015-07-27T15:33:30Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![DavidL](https://avatars.discourse-cdn.com/v4/letter/d/ecc23a/32.png) [@DavidL](https://discuss.elastic.co/u/DavidL)\
**Post date:** [July 27, 2015, 6:23pm UTC](https://discuss.elastic.co/t/running-logstash-and-elasticsearch-on-two-machine/26270/5 "2015-07-27T18:23:57Z")

</div>

Thanks Magnus, it works now!

---

<div class="post-metadata">

**Author:** ![taraka16](https://avatars.discourse-cdn.com/v4/letter/t/97f17d/32.png) [@taraka16](https://discuss.elastic.co/u/taraka16)\
**Post date:** [February 19, 2016, 1:05pm UTC](https://discuss.elastic.co/t/running-logstash-and-elasticsearch-on-two-machine/26270/6 "2016-02-19T13:05:26Z")

</div>

Should I have elasticsearch and logstash on different machines when deploying the ELK stack in production (as I've read that somewhere in the internet)? or can they be installed on the same server with the following logstash output:

```
output{
   elasticsearch {host => "localhost"}
 }
```

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 19, 2016, 1:47pm UTC](https://discuss.elastic.co/t/running-logstash-and-elasticsearch-on-two-machine/26270/7 "2016-02-19T13:47:40Z")

</div>

@taraka16, please start a new thread for your unrelated question.

---

<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, 4:56am UTC](https://discuss.elastic.co/t/running-logstash-and-elasticsearch-on-two-machine/26270/9 "2017-07-06T04:56:39Z")

</div>


