java.io.EOFException当logstash-1.4.2 elasticsearch_river连接到rabbitmq时

时间:2015-01-09 09:05:20

标签: java elasticsearch rabbitmq logstash

当我使用elasticsearch_river作为输出并尝试连接到rabbitmq时,我得到了EOFException。

这是我的配置文件:

input {
    file {
            path => "/tmp/logstash/logstash-1.4.2/log.txt"
    }
}

filter {
}

output {
     elasticsearch_river {
            rabbitmq_host => "hostname"
            rabbitmq_port => 15671
            es_host => "hostname"
            user => "user"
            password => "password"
    }
}

这是堆栈跟踪:

Exception in thread ">output" java.io.IOException
    at com.rabbitmq.client.impl.AMQChannel.wrap(com/rabbitmq/client/impl/AMQChannel.java:106)
    at com.rabbitmq.client.impl.AMQChannel.wrap(com/rabbitmq/client/impl/AMQChannel.java:102)
    at com.rabbitmq.client.impl.AMQConnection.start(com/rabbitmq/client/impl/AMQConnection.java:378)
    at com.rabbitmq.client.ConnectionFactory.newConnection(com/rabbitmq/client/ConnectionFactory.java:516)
    at com.rabbitmq.client.ConnectionFactory.newConnection(com/rabbitmq/client/ConnectionFactory.java:533)
    at java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:606)
    at RUBY.new_connection_impl(/tmp/logstash/logstash-1.4.2/vendor/bundle/jruby/1.9/gems/march_hare-2.1.2-java/lib/march_hare/session.rb:387)
    at org.jruby.RubyProc.call(org/jruby/RubyProc.java:271)
    at RUBY.converting_rjc_exceptions_to_ruby(/tmp/logstash/logstash-1.4.2/vendor/bundle/jruby/1.9/gems/march_hare-2.1.2-java/lib/march_hare/session.rb:357)
    at RUBY.new_connection_impl(/tmp/logstash/logstash-1.4.2/vendor/bundle/jruby/1.9/gems/march_hare-2.1.2-java/lib/march_hare/session.rb:382)
    at RUBY.initialize(/tmp/logstash/logstash-1.4.2/vendor/bundle/jruby/1.9/gems/march_hare-2.1.2-java/lib/march_hare/session.rb:82)
    at RUBY.connect(/tmp/logstash/logstash-1.4.2/vendor/bundle/jruby/1.9/gems/march_hare-2.1.2-java/lib/march_hare/session.rb:69)
    at RUBY.connect(/tmp/logstash/logstash-1.4.2/vendor/bundle/jruby/1.9/gems/march_hare-2.1.2-java/lib/march_hare.rb:20)
    at RUBY.connect(/tmp/logstash/logstash-1.4.2/lib/logstash/outputs/rabbitmq/march_hare.rb:111)
    at RUBY.register(/tmp/logstash/logstash-1.4.2/lib/logstash/outputs/rabbitmq/march_hare.rb:18)
    at RUBY.prepare_river(/tmp/logstash/logstash-1.4.2/lib/logstash/outputs/elasticsearch_river.rb:111)
    at RUBY.register(/tmp/logstash/logstash-1.4.2/lib/logstash/outputs/elasticsearch_river.rb:89)
    at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)
    at RUBY.outputworker(/tmp/logstash/logstash-1.4.2/lib/logstash/pipeline.rb:220)
    at RUBY.start_outputs(/tmp/logstash/logstash-1.4.2/lib/logstash/pipeline.rb:152)
    at java.lang.Thread.run(java/lang/Thread.java:745)
Caused by: com.rabbitmq.client.ShutdownSignalException: connection error; reason: java.io.EOFException
....

1 个答案:

答案 0 :(得分:0)

使用5672,

" 15672是HTTP API / Web UI的端口。 AMQP使用端口5672。"

http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2013-October/030989.html

也不要忘记安装ES插件,如下面的链接所述,然后重新启动ES。 https://github.com/elastic/elasticsearch-river-rabbitmq/blob/master/README.md