簡體   English   中英

在rabbitmq中如何使用訪客以外的用戶進行ELK?

[英]how to use user other than guest in rabbitmq for ELK?

我正在使用rabbitmq在ubuntu 14.04上對ELK進行日志排隊。 我能夠通過Rabbitmq來賓用戶進行交流,並且一切正常。 然后,我使用以下命令創建一個新用戶:

rabbitmqctl add_user username pass
rabbitmqctl set_user_tags username administrator

然后,我將無法發送消息並出現以下錯誤。 有什么幫助嗎?

ERROR REPORT==== 30-Sep-2015::15:53:53 ===
connection <0.1626.0>, channel 1 - soft error:
{amqp_error,not_found,"no exchange 'my-exchange' in vhost '/'",
            'queue.bind'}

=INFO REPORT==== 30-Sep-2015::15:54:03 ===
accepting AMQP connection <0.1638.0> (192.168.1.25:36313 -> 192.168.1.24:5672)

=ERROR REPORT==== 30-Sep-2015::15:54:03 ===
connection <0.1638.0>, channel 1 - soft error:
{amqp_error,not_found,"no exchange 'my-exchange' in vhost '/'",
            'queue.bind'}

=INFO REPORT==== 30-Sep-2015::15:54:13 ===
accepting AMQP connection <0.1650.0> (192.168.1.25:36314 -> 192.168.1.24:5672)

=ERROR REPORT==== 30-Sep-2015::15:54:13 ===
connection <0.1650.0>, channel 1 - soft error:
{amqp_error,not_found,"no exchange 'my-exchange' in vhost '/'", 'queue.bind'}
=INFO REPORT==== 30-Sep-2015::15:54:23 ===
accepting AMQP connection <0.1662.0> (192.168.1.25:36315 -> 192.168.1.24:5672)
=ERROR REPORT==== 30-Sep-2015::15:54:23 ===
connection <0.1662.0>, channel 1 - soft error:
{amqp_error,not_found,"no exchange 'my-exchange' in vhost '/'",
            'queue.bind'}

用於創建用戶運行命令:

  rabbitmqctl add_user username pass
  rabbitmqctl set_user_tags username administrator
  rabbitmqctl set_permissions -p / username ".*" ".*" ".*"

也不要忘記在/etc/logstash/conf.d/下創建的logstash文件中添加新用戶

 user => "username"
 password  => "password"

編輯:詳細地講,如果您使用logstash來發送日志,則可以創建任何文件/etc/logstash/conf.d/anyfile.conf並放置以下內容(以下是基本輸入文件,您可以對其進行更改)

input {
    file {
        type => "logstash"
        path => ["/var/log/anylogfilepath"]
        start_position => "beginning"
        sincedb_path => "/dev/null"
     }
}

output {

  rabbitmq {
    exchange => "my-exchange"
    host => "my.domainname.com"
    exchange_type => "direct"
    key => "test"
    durable => true
    persistent => true
    workers => 4
    user => "username"
    password  => "password"


  }

  stdout {
    codec => rubydebug
  }
}

也不要忘記在您要分析的ELK末尾輸入Rabbitmq用戶名和密碼作為輸入,並希望從Rabbitmq獲取輸入日志。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM