rabbitmq and logstash configuration not working

2.4k views Asked by At

I am trying to link logstash to read messages from a queue that will get indexed in elasticsearch. I initially had it working with a shipper sending messages to the logstash port but now even that is not working. The error when trying to run the logstash conf file:

RabbitMq connection error: . Will reconnect in 10 seconds... {:level=>error}
//not sure if the next piece is related:

WARN: org.elasticsearch.discovery.zen.ping.unicast: [Hellstrom, Damion] failed to send ping 
     to [[#zen_unicast_2#][inet[localhost/127.0.0.1:9301]]]
    org.elasticsearch.transport.ReceiveTimeoutTransportException: []
  [inet[localhost/127.0.0.1:9301]][discovery/zen/unicast] request_id [0] timed out after [3752ms]
    at org.elasticsearch.transport.TransportService$TimeoutHandler.run(TransportService.java:356)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
    log4j, [2014-03-17T14:48:20.197]  WARN: org.elasticsearch.discovery.zen.ping.
    unicast:   [Hellstrom, Damion] failed to send ping to 
    [[#zen_unicast_4#]  [inet[localhost/127.0.0.1:9303]]]
    org.elasticsearch.transport.ReceiveTimeoutTransportException: 
    []                [inet[localhost/127.0.0.1:9303]][discovery/zen/unicast] 
   request_id [3] 
    timed out after [3752ms]
    at org.elasticsearch.transport.TransportService$TimeoutHandler.run(TransportService.java:356)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
     log4j, [2014-03-17T14:48:20.198]  WARN: org.elasticsearch.discovery.zen.ping.unicast: 
    [Hellstrom, Damion] failed to send ping to 
     [[#zen_unicast_3#]    [inet[localhost/127.0.0.1:9302]]]

Please I would really appreciate help on this. I have spent all weekend trying to get it to work. Even tried Redis initially but that had its own set of errors.

Oh yes is my conf file:

input {
 rabbitmq {
    queue => "input.queue"
    host => "192.xxx.x.xxx"
    exchange => "exchange.output"
    vhost => "myhost"
  }
 }
output {
elasticsearch {
    embedded => true
     index => "board-feed"
}

}

1

There are 1 answers

0
Daryl Robbins On

The problem is related to authentication with the RabbitMQ server. For the RabbitMQ transport, the default values for user/password are guest/guest, which by default in Rabbit will only work when connecting locally (to 127.0.0.1), whereas you are connecting to 192.xxx.x.xxx. (https://www.rabbitmq.com/access-control.html)

My guess is that when it worked before, you were running the Logstash Server on the same machine as RabbitMQ.

To fix the problem, setup an account in RabbitMQ and fill in the user/password fields of the RabbitMQ output to match.