5

我正在尝试连接到 RabbitMQ 服务器,但总是出现以下错误:

W, [2015-12-08T15:38:01.993251 #37405]  WARN -- #<Bunny::Session:0x7fe07b894f78 guest@localhost:5672, vhost=/dev_prod, addresses=[localhost:5672]>: An empty frame was received while opening the connection. In RabbitMQ <= 3.1 this could mean an authentication issue.

.../.rvm/gems/ruby-2.1.2/gems/bunny-2.2.0/lib/bunny/session.rb:315:in `rescue in start': Could not establish TCP connection to any of the configured hosts (Bunny::TCPConnectionFailedForAllHosts)

我在 MAC OS 上使用 Ruby 2.1.2、RabbitMQ 3.5.6。对不起,我是 RabbitMQ 的新手,只是想使用它,但无法处理这个问题。请给我一些建议。

4

1 回答 1

0

这可能是因为您要么没有传递用户名和密码,要么传递了错误的用户名和密码。

用户名和密码的默认值是 guest 和 guest。

尝试像这样初始化连接:

 conn = Bunny.new(host:  'localhost',
                  port:  '5672',
                  vhost: '/',
                  user:  'guest',
                  pass:  'guest')
 conn.start

看看会发生什么

于 2017-11-15T11:19:23.587 回答