linux - 如何在 ELK 的 rabbitmq 中使用 guest 以外的用户?

标签 linux elasticsearch rabbitmq logstash-configuration rabbitmqctl

我正在使用 rabbitmq 在 ubuntu 14.04 上为 ELK 进行日志排队。我能够通过 rabbitmq guest 用户进行通信,并且一切正常。然后我使用这些命令创建一个新用户:

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

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

关于linux - 如何在 ELK 的 rabbitmq 中使用 guest 以外的用户?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32911626/

相关文章:

linux - 如何使用 imagemagick convert 合并 5 个以上的 PDF?

elasticsearch - Elasticsearch聚合(重复)搜索未返回所有重复项

elasticsearch - 从ES 2.1到ES 7.2的转储映射

azure - Azure 中的 Rabbit MQ 支持

java - 使用测试中的 Spring Cloud Stream 连接到消息代理

rabbitmq - Varnish 中的 HTTP 方法 PURGE 是幂等的吗?

linux - 计算列的中值,输出该值并说明是否为 "OK"或 "ERROR"(如果在可接受范围内或之外)

linux - 在 Alpine Docker 容器中运行 OpenSSH

linux - 用于更新 Deluged Interface IP 的 Bash 脚本无法作为 cron 作业运行,但在手动运行时有效

elasticsearch - 自定义停用词分析器无法正常运行