Logstash 无法连接到我的 RabbitMQ 代理



我正在尝试将在docker容器中运行的Logstash实例连接到AmazonMQ Broker。我的最终目标是将MQ消息体插入ElasticSearch

根据日志,我认为Logstash能够到达MQ队列,但错误消息没有提供任何其他信息:

[2021-05-21T23:30:53,226][ERROR][logstash.inputs.rabbitmq ][instance_journal_pipeline][rmq_instance_source] 
RabbitMQ connection error, will retry. {
:error_message=>"An unknown error occurred. RabbitMQ gave no hints as to the cause. Maybe this is a configuration error (invalid vhost, for example). I recommend checking the RabbitMQ server logs for clues about this failure.", 
:exception=>"Java::JavaIo::IOException"
}

我的输入配置如下:

input {
rabbitmq {
id => "rmq_instance_source"
ack => true
durable => true
passive => true
exchange => "events"
exchange_type => "topic"
host => "${AWS_MQ_URL}"
user => "${AWS_MQ_USER}"
port => "${AWS_MQ_PORT}"
password => "${AWS_MQ_PASSWORD}"
queue => "outbound_task_queue_name"
key => "outbound_task_key"
arguments => {
# arguments reproduced from the RMQ Queue's admin page
}
}
}

原来这是SSL配置问题。RMQLogstash插件要求您指定服务器正在使用SSL和版本。错误消息不会告诉您这种情况。使用MQ Broker验证SSL版本。

我在配置中添加了以下参数(以匹配AmazonMQ配置(,并解决了这个问题:

ssl => true
ssl_version => "TLSv1.2"

最新更新