rabbitmq和logstash配置无法正常工作

时间:2014-03-17 18:54:13

标签: rabbitmq logstash

我正在尝试链接logstash以读取将在elasticsearch中编入索引的队列中的消息。我最初让它与托运人一起发送消息到logstash端口,但现在甚至没有用。尝试运行logstash conf文件时出错:

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]]]

我真的很感谢你的帮助。我花了整个周末试图让它发挥作用。甚至最初尝试过Redis,但它有一组错误。

哦,是的,我的conf文件:

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

}

1 个答案:

答案 0 :(得分:2)

问题与使用RabbitMQ服务器进行身份验证有关。对于RabbitMQ传输,用户/密码的默认值为guest / guest,默认情况下,Rabbit仅在本地连接时(127.0.0.1)工作,而您连接到192.xxx.x.xxx。 (https://www.rabbitmq.com/access-control.html

我的猜测是,当它运行之前,你在与RabbitMQ相同的机器上运行Logstash服务器。

要解决此问题,请在RabbitMQ中设置一个帐户并填写RabbitMQ输出的用户/密码字段以匹配。