LOGSTASH and REDIS input - connection refused from redis

Hello,

Here's my set-up:

I'm running 1 vagrant vbox containing ELK, and another vagrant vbox containing a redis machine.

On my local machine I'm running a website with a service that sends data to the redis machine.

From my redis machine I want to transfer data to ES and visualize it in Kibana, but for some reason, I cannot seem to make it work between Logstash and Redis.

  • Logstash version 2.1.3
  • Redis version 3.0.7

Logstash error:
{:timestamp=>"2016-05-05T15:03:41.788000+0000", :message=>"Redis connection problem", :exception=>#<Redis::CannotConnectError: Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED)>, :level=>:warn}

Logstash configuration
input { redis { host => "127.0.0.1" port => 6379 type => "redis-input" data_type => "list" key => "perf_monitor" } } output { file { path => "/vagrant/log/logstash-output.log" } elasticsearch { hosts => "localhost:9200" index => "perf_monitor" } }

Worth mentioning:
Tried the same set-up but with 1.x version of ELK and redis on my local machine (without the vms and everything work perfectly). Switched to VM trying to create a more production-like environment, and everything stopped working.

What might be the problem? What am I doing wrong?

Regards

Sounds like a vagrant networking issue, have you forwarded the ports correctly in the config?

Yes, the ports are forwarded correctly:

  • redis:
    config.vm.network :forwarded_port, guest: 6379, host: 6379
  • ELK:
    config.vm.network :forwarded_port, guest: 5601, host: 5601 config.vm.network :forwarded_port, guest: 9200, host: 9200 config.vm.network :forwarded_port, guest: 9300, host: 9300

The interesting thing is that I can connect with a redis desktop client on the redis machine without any issues.