简体   繁体   English

RabbitMQ 和 Logstash 集成在 kubernetes 集群中

[英]RabbitMQ and Logstash integration in kubernetes cluster

I have deployed ELK stack in kubernetes cluster which is working fine.我已经在 kubernetes 集群中部署了 ELK 堆栈,它工作正常。 Now i have deployed rabbitMQ in the cluster and integrated with logstash so that i can view the message in kibana.现在我已经在集群中部署了 rabbitMQ 并与 logstash 集成,以便我可以在 kibana 中查看消息。 My logstash configMap looks like this:我的 logstash configMap 如下所示:

apiVersion: v1
kind: ConfigMap
metadata:
  name: logstash-configmap
  namespace: kube-system
data:
  logstash.yml: |
     http.host: "0.0.0.0"
     path.config: /usr/share/logstash/pipeline
  logstash.conf: |
   
    input {
      rabbitmq{
        host => "rabbitmq-cip-svc"
        port => 15672
        durable => true
      }
    }

     output {
        elasticsearch {
            hosts => [ "elasticsearch-logging:9200" ]
        }
    }

I also checked the config file inside the container using the command below and it has the same configuration as mentioned in the configmap.我还使用下面的命令检查了容器内的配置文件,它具有与 configmap 中提到的相同的配置。

kubectl exec logstash-deployment-d85dbdcdc-k662d --stdin --tty  -- binbash

Now the issue is the connection between rabbitmq and logstash is not working and when i checked the log i can see the following error message.现在的问题是 rabbitmq 和 logstash 之间的连接不起作用,当我检查日志时,我可以看到以下错误消息。

[INFO ] 2020-07-17 12:27:52.933 [Ruby-0-Thread-1: /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/task.rb:22] agent - Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
[INFO ] 2020-07-17 12:27:53.049 [Api Webserver] agent - Successfully started Logstash API endpoint {:port=>9600}
[ERROR] 2020-07-17 12:30:03.834 [[main]<rabbitmq] rabbitmq - RabbitMQ connection error, will retry. {:error_message=>"Connection to localhost:5672 refused", :exception=>"MarchHare::ConnectionRefused"}

Not sure from where it is picking up this configuration.不确定从哪里获取此配置。 Can someone help regarding this?有人可以帮忙吗?

The issue was resolved after changing the rabbit MQ port to 5672.将 rabbit MQ 端口更改为 5672 后问题得到解决。

Thanks, Rabin谢谢,拉宾

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM