# Access to elasticsearch server from logstash into private subnet on AWS

**URL:** <https://discuss.elastic.co/t/access-to-elasticsearch-server-from-logstash-into-private-subnet-on-aws/129748>\
**Category:** Logstash\
**Created:** [April 26, 2018, 10:12pm UTC](https://discuss.elastic.co/t/access-to-elasticsearch-server-from-logstash-into-private-subnet-on-aws/129748 "2018-04-26T22:12:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hermann](https://avatars.discourse-cdn.com/v4/letter/h/b487fb/32.png) [@Hermann](https://discuss.elastic.co/u/Hermann)\
**Post date:** [April 26, 2018, 10:12pm UTC](https://discuss.elastic.co/t/access-to-elasticsearch-server-from-logstash-into-private-subnet-on-aws/129748/1 "2018-04-26T22:12:19Z")

</div>

Hi, can someone help me to resolve this problem?

I'm new in ELK stack and I deployed it on AWS. Logstash and elasticseach are hosted on different EC2 instances into a private VPC subnet. These EC2 instances are hosted behind an AWS alb.

My logstash output plugin configuration is:

output {  
elasticsearch {  
hosts =\> "http://my\_private\_ip\_address:9200/"  
}  
}

When I run this command : bin/logstash -f /etc/logstash/conf.d/ I'm face of this

Attempted to resurrect connection to dead ES instance, but got an error. {:url=\>"http://my\_private\_ip\_address:9200/", :error\_type=\>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=\>"Elasticsearch Unreachable: [http://my\_private\_ip\_address:9200/][Manticore::ConnectTimeout] connect timed out"}

Can you please help me to resolve this issue.

---

<div class="post-metadata">

**Author:** ![yaauie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaauie/32/23363_2.png) [@yaauie](https://discuss.elastic.co/u/yaauie)\
**Post date:** [April 26, 2018, 11:08pm UTC](https://discuss.elastic.co/t/access-to-elasticsearch-server-from-logstash-into-private-subnet-on-aws/129748/2 "2018-04-26T23:08:47Z")

</div>

can you connect to the Elasticsearch node from the Logstash node _without_ Logstash?

```auto
curl -X GET http://my_private_ip_address:9200/_cat/master?v

```

---

<div class="post-metadata">

**Author:** ![Hermann](https://avatars.discourse-cdn.com/v4/letter/h/b487fb/32.png) [@Hermann](https://discuss.elastic.co/u/Hermann)\
**Post date:** [April 26, 2018, 11:24pm UTC](https://discuss.elastic.co/t/access-to-elasticsearch-server-from-logstash-into-private-subnet-on-aws/129748/3 "2018-04-26T23:24:20Z")

</div>

No I can't. Connection through port 9200 is refused

the exact message is: curl: (7) Failed to connect to my\_private\_ip\_address port 9200: Connection refused

---

<div class="post-metadata">

**Author:** ![Hermann](https://avatars.discourse-cdn.com/v4/letter/h/b487fb/32.png) [@Hermann](https://discuss.elastic.co/u/Hermann)\
**Post date:** [April 26, 2018, 11:28pm UTC](https://discuss.elastic.co/t/access-to-elasticsearch-server-from-logstash-into-private-subnet-on-aws/129748/4 "2018-04-26T23:28:32Z")

</div>

For my logstash node instance (EC2) all port in outbound traffic are open into My VPC and inbound traffic to my elasticseach insatnce is also open to all traffic into my VPC

---

<div class="post-metadata">

**Author:** ![yaauie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaauie/32/23363_2.png) [@yaauie](https://discuss.elastic.co/u/yaauie)\
**Post date:** [April 27, 2018, 1:12am UTC](https://discuss.elastic.co/t/access-to-elasticsearch-server-from-logstash-into-private-subnet-on-aws/129748/5 "2018-04-27T01:12:27Z")

</div>

> [@Hermann](#):
>
> No I can't. Connection through port 9200 is refused

Then the problem lies outside of the Elastic Stack.

Previously, when using AWS for other purposes, I have had to open specific routes between hosts in my virtual private network in order to create paths between hosts.

---

<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:** [May 25, 2018, 1:12am UTC](https://discuss.elastic.co/t/access-to-elasticsearch-server-from-logstash-into-private-subnet-on-aws/129748/6 "2018-05-25T01:12:28Z")

</div>

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