# Logstash-forwarder not connecting with the server

**URL:** <https://discuss.elastic.co/t/logstash-forwarder-not-connecting-with-the-server/45688>\
**Category:** Logstash\
**Created:** [March 29, 2016, 1:35pm UTC](https://discuss.elastic.co/t/logstash-forwarder-not-connecting-with-the-server/45688 "2016-03-29T13:35:05Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roshan\_r](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roshan_r/32/9760_2.png) [@Roshan\_r](https://discuss.elastic.co/u/Roshan_r)\
**Post date:** [March 29, 2016, 1:35pm UTC](https://discuss.elastic.co/t/logstash-forwarder-not-connecting-with-the-server/45688/1 "2016-03-29T13:35:05Z")

</div>

**Hi All,**  
I am trying to use the logstash and logstash-forwarder fir the first time. My logstash-forwarder and logstash are installed on 2 separate VMs.  
**Consider forwarder on server A and Logstash on Server B.**

I generated the SSL certificates from **Server B** using the command  
**openssl req -x509 -nodes -newkey rsa:2048 -keyout logstash-forwarder.key -out logstash-forwarder.crt** and when Common Name was asked, i entered the Server A name which is already in /etc/hosts/.

**This is the config for logstash in server B**  
input {  
lumberjack {  
port =\> 5043  
ssl\_certificate =\> "/etc/logstash/server.crt"  
ssl\_key =\> "/etc/logstash/server.key"  
}  
}  
These crt and key files are copied to Server A to /opt/logstash-forwarder/bin/

Below is the config from Server A [Forwarder]  
{  
"network": {  
"servers": ["astroELK:5043"],  
"ssl certificate": "/opt/logstash-forwarder/bin/logstash-forwarder.crt",  
"ssl key": "/opt/logstash-forwarder/bin/logstash-forwarder.key",  
"ssl ca": "/opt/logstash-forwarder/bin/logstash-forwarder.crt",  
"timeout": 15  
},

"files": [  
{  
"paths": [  
"/var/log/nds/cmdc/cmdc.audit"  
],  
"fields": { "type": "cmdc" }  
}  
]  
}

if i run the logstash-forwarder using the command, ./logstash-forwarder -config config.json I am getting the following output

2016/03/29 13:31:51.725925 Waiting for 1 prospectors to initialise  
2016/03/29 13:31:51.726049 Launching harvester on new file: /var/log/nds/cmdc/cmdc.audit  
2016/03/29 13:31:51.726111 Started harvester at end of file (current offset now 2828108): /var/log/nds/cmdc/cmdc.audit  
2016/03/29 13:31:51.726148 All prospectors initialised with 0 states to persist  
2016/03/29 13:31:51.726243 Loading client ssl certificate: /opt/logstash-forwarder/bin/logstash-forwarder.crt and /opt/logstash-forwarder/bin/logstash-forwarder.key  
2016/03/29 13:31:52.035688 Setting trusted CA from file: /opt/logstash-forwarder/bin/logstash-forwarder.crt  
2016/03/29 13:31:52.036614 Connecting to [10.209.26.147]:5043 (astroELK)  
2016/03/29 13:31:52.037147 Failure connecting to 10.209.26.147: dial tcp 10.209.26.147:5043: connection refused

Not sure whether i made any mistakes here.

---

<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:** [March 29, 2016, 4:43pm UTC](https://discuss.elastic.co/t/logstash-forwarder-not-connecting-with-the-server/45688/2 "2016-03-29T16:43:22Z")

</div>

> 2016/03/29 13:31:52.037147 Failure connecting to 10.209.26.147: dial tcp 10.209.26.147:5043: connection refused

The computer running LSF can't connect to 10.209.26.147:5043. This might be because Logstash on that host isn't running, or that it's running but wasn't able to bind to that port, or that there's a firewall blocking the access, or something else.

---

<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:** [March 29, 2016, 8:50pm UTC](https://discuss.elastic.co/t/logstash-forwarder-not-connecting-with-the-server/45688/3 "2016-03-29T20:50:53Z")

</div>

Please be aware that LSF is deprecated. You should be moving to filebeat instead.

---

<div class="post-metadata">

**Author:** ![Roshan\_r](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roshan_r/32/9760_2.png) [@Roshan\_r](https://discuss.elastic.co/u/Roshan_r)\
**Post date:** [March 30, 2016, 6:47am UTC](https://discuss.elastic.co/t/logstash-forwarder-not-connecting-with-the-server/45688/4 "2016-03-30T06:47:56Z")

</div>

Thanks warkolm. I will try using filebeat. Will you be kind to give me the versions of elastic search, logstash , kibana and filebeat

---

<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:** [March 30, 2016, 7:12am UTC](https://discuss.elastic.co/t/logstash-forwarder-not-connecting-with-the-server/45688/5 "2016-03-30T07:12:17Z")

</div>

> Will you be kind to give me the versions of Elasticsearch, logstash , kibana and filebeat

What do you mean?

---

<div class="post-metadata">

**Author:** ![Roshan\_r](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roshan_r/32/9760_2.png) [@Roshan\_r](https://discuss.elastic.co/u/Roshan_r)\
**Post date:** [March 30, 2016, 7:12am UTC](https://discuss.elastic.co/t/logstash-forwarder-not-connecting-with-the-server/45688/6 "2016-03-30T07:12:56Z")

</div>

I wanted to know the latest versions of all 4 components which supports each other.

---

<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:** [March 30, 2016, 7:17am UTC](https://discuss.elastic.co/t/logstash-forwarder-not-connecting-with-the-server/45688/7 "2016-03-30T07:17:29Z")

</div>

See [https://www.elastic.co/support/matrix](https://www.elastic.co/support/matrix).

---

<div class="post-metadata">

**Author:** ![Roshan\_r](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roshan_r/32/9760_2.png) [@Roshan\_r](https://discuss.elastic.co/u/Roshan_r)\
**Post date:** [March 30, 2016, 7:53am UTC](https://discuss.elastic.co/t/logstash-forwarder-not-connecting-with-the-server/45688/8 "2016-03-30T07:53:53Z")

</div>

Thanks. One last query. When i try to upgrade from 1.5.2 logstash to 2.2.1, i found this. May i know the reason please?

[root@astroELK rpms]# rpm -ivh logstash-2.2.2-1.noarch.rpm  
Preparing... ########################################### [100%]  
file /etc/init.d/logstash from install of logstash-1:2.2.2-1.noarch conflicts with file from package logstash-1:1.5.2-1.noarch  
file /etc/logrotate.d/logstash from install of logstash-1:2.2.2-1.noarch conflicts with file from package logstash-1:1.5.2-1.noarch

---

<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:** [March 30, 2016, 7:55am UTC](https://discuss.elastic.co/t/logstash-forwarder-not-connecting-with-the-server/45688/9 "2016-03-30T07:55:16Z")

</div>

I believe RPMs should be upgraded with `rpm -U`, not `rpm -i`.

---

<div class="post-metadata">

**Author:** ![Roshan\_r](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roshan_r/32/9760_2.png) [@Roshan\_r](https://discuss.elastic.co/u/Roshan_r)\
**Post date:** [March 30, 2016, 7:57am UTC](https://discuss.elastic.co/t/logstash-forwarder-not-connecting-with-the-server/45688/10 "2016-03-30T07:57:23Z")

</div>

Sorry. My mistake. Its done.  
Many thanks

---

<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, 5:04am UTC](https://discuss.elastic.co/t/logstash-forwarder-not-connecting-with-the-server/45688/11 "2017-07-06T05:04:48Z")

</div>


