0

已经在 Windows core 2016 Server 中安装了 Elasticsearch-6.6.0 和 kibana-6.6.0 它已启动并运行,我不得不从 Rabbitmq 索引数据,因此下载并解压缩了 logstash-6.0.0 并为 rabbitmq 制作了一个配置文件跟随

input {
    rabbitmq {
        arguments => { "x-ha-policy" => "all" }
        host => "172.xx.xx.xx"
        queue => "xx.flow.queue"
        #durable => true
        key => "flowtrack"
        exchange => "xx.test.exchange"
        threads => 120
        exclusive => false
        prefetch_count => 512
        vhost => "/"
        port => 5672
        user => "usr"
        password => "Pass@123"
    }
}
output {
  elasticsearch {
    hosts => ["172.xx.xx.xx:9200"]
  }
}

通过命令行运行logstash如下

    c:\logstash-6.0.0>bin\logstash -f config\rabbitmq.conf

但它会引发如下错误

 [2019-02-20T23:01:28,696][ERROR][logstash.inputs.rabbitmq ] RabbitMQ connection error, will retry. {:error_message=>"Connection to localhost:5672 refused", :exception=>"MarchHare::ConnectionRefused"}
    [2019-02-20T23:01:28,696][ERROR][logstash.inputs.rabbitmq ] RabbitMQ connection error, will retry. {:error_message=>"Connection to localhost:5672 refused", :exception=>"MarchHare::ConnectionRefused"}

端口 5672 在主机中打开 如果我在配置中遗漏了导致此错误的任何内容,请告诉我。

提前致谢

4

1 回答 1

0

已经找到问题了,是因为服务器没有启用路由。现在 Logstash 和 Rabbitmq 之间的连接已建立,索引已完成。

于 2019-02-21T17:46:16.487 回答