我正在使用 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/