# Getsockopt: connection timed out

**URL:** <https://discuss.elastic.co/t/getsockopt-connection-timed-out/143315>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [August 7, 2018, 11:55am UTC](https://discuss.elastic.co/t/getsockopt-connection-timed-out/143315 "2018-08-07T11:55:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_WCL](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@Sam\_WCL](https://discuss.elastic.co/u/Sam_WCL)\
**Post date:** [August 7, 2018, 11:55am UTC](https://discuss.elastic.co/t/getsockopt-connection-timed-out/143315/1 "2018-08-07T11:55:34Z")

</div>

Hello,  
I am having an issue on a few boxes reporting to my elastic stack,  
They look to be getting blocked/timing out with the below error in the metricbeat logs,

2018-08-07T12:33:49.810+0100 ERROR pipeline/output.go:74 Failed to connect: Get http://ELASTIC\_DOMAIN:9200: dial tcp SERVER\_IP:9200: getsockopt: connection timed out

I then ran a metricbeat test which returned the below,

elasticsearch: http://ELASTIC\_DOMAIN:9200...  
parse url... OK  
connection...  
parse host... OK  
dns lookup... OK  
addresses: SERVER\_IP  
dial up... ERROR dial tcp SERVER\_IP:9200: getsockopt: connection timed out

Can any one advise what might be the issue? I have 243 boxes that connect fine and im unsure of the amount that are having this issue. running a GET on the elasticsearch domain returns fine in 25-75MS.

Kind Regards,  
Sam

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [August 7, 2018, 1:47pm UTC](https://discuss.elastic.co/t/getsockopt-connection-timed-out/143315/2 "2018-08-07T13:47:47Z")

</div>

Hi @Sam_WCL,

243 doesn't look like a big number for this but... could you be hitting some connection limit in your network or your hosts?  
Could you try to connect from the affected hosts to the elasticsearch server or to other hosts using other tool like `curl` or `telnet`?

---

<div class="post-metadata">

**Author:** ![Sam\_WCL](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@Sam\_WCL](https://discuss.elastic.co/u/Sam_WCL)\
**Post date:** [August 7, 2018, 3:28pm UTC](https://discuss.elastic.co/t/getsockopt-connection-timed-out/143315/3 "2018-08-07T15:28:22Z")

</div>

Hello @jsoriano,  
Thanks for getting back to me,  
I ran the below command on a box that works and one that doesn't (both setup completely the same),

WORKING SERVER

> curl -X GET ELASTIC\_DOMAIN:9200  
> {  
> "name" : "PgUNPEj",  
> "cluster\_name" : "elasticsearch",  
> "cluster\_uuid" : "J26G1zdaRzefxPUOTn6JRw",  
> "version" : {  
> "number" : "6.3.0",  
> "build\_flavor" : "default",  
> "build\_type" : "rpm",  
> "build\_hash" : "424e937",  
> "build\_date" : "2018-06-11T23:38:03.357887Z",  
> "build\_snapshot" : false,  
> "lucene\_version" : "7.3.1",  
> "minimum\_wire\_compatibility\_version" : "5.6.0",  
> "minimum\_index\_compatibility\_version" : "5.0.0"  
> },  
> "tagline" : "You Know, for Search"  
> }

> telnet SERVER\_IP 9200  
> Trying SERVER\_IP...  
> Connected to SERVER\_IP.  
> Escape character is '^]'.

SERVER WITH ISSUES

> curl -X GET ELASTIC\_DOMAIN:9200  
> curl: (7) Failed connect to ELASTIC\_DOMAIN:9200; Connection timed out

> telnet SERVER\_IP 9200  
> Trying SERVER\_IP...  
> telnet: connect to address ELASTIC\_IP: Connection timed out

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [August 7, 2018, 3:57pm UTC](https://discuss.elastic.co/t/getsockopt-connection-timed-out/143315/4 "2018-08-07T15:57:09Z")

</div>

This looks like a connectivity problem. Are both machines in the same network? is it possible that some firewall is blocking connections from some servers but not others?

---

<div class="post-metadata">

**Author:** ![Sam\_WCL](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@Sam\_WCL](https://discuss.elastic.co/u/Sam_WCL)\
**Post date:** [August 8, 2018, 7:34am UTC](https://discuss.elastic.co/t/getsockopt-connection-timed-out/143315/5 "2018-08-08T07:34:21Z")

</div>

Hello @jsoriano,  
Nothing looks to be getting blocked at Firewall level etc.  
I think I will test building a replica elastic stack and change the host on a server with issues to point to the new one to see if that works.  
I'll keep posting here with any updates.

---

<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:** [September 5, 2018, 7:34am UTC](https://discuss.elastic.co/t/getsockopt-connection-timed-out/143315/6 "2018-09-05T07:34:27Z")

</div>

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