1

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'}
4

1 回答 1

2

对于创建用户运行命令:

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

也不要忘记在logstash 您创建的文件中添加新用户/etc/logstash/conf.d/

 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
  }
}

也不要忘记将 rabbitmq 用户名和密码输入作为您正在分析的 ELK 端的输入,并希望从 rabbitmq 获取输入日志。

于 2015-10-02T16:26:31.730 回答