尝试将消息发送到远程队列时出现 pika.exceptions.ProbableAuthenticationError

pika.exceptions.ProbableAuthenticationError when trying to send message to remote queue(尝试将消息发送到远程队列时出现 pika.exceptions.ProbableAuthenticationError)
本文介绍了尝试将消息发送到远程队列时出现 pika.exceptions.ProbableAuthenticationError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在尝试运行 RabbitMQ Python 教程,但使用了发件人在 virtualbox 主机和接收器上,并在 virtualbox 客户机上排队.所以我修改了提到的 send.py 代码,仅将 localhost 替换为 192.168.1.5.当我运行它时,我收到以下错误:

I'm trying to run RabbitMQ Python tutorial but with sender on virtualbox host machine and receiver and queue on virtualbox guest machine. So I modified mentioned send.py code by only replacing localhost with 192.168.1.5. When I run it, i receive following error:

...
  File "/home/damian/.virtualenvs/kivy_1.9/local/lib/python2.7/site-packages/pika/adapters/base_connection.py", line 153, in _check_state_on_disconnect
    raise exceptions.ProbableAuthenticationError
pika.exceptions.ProbableAuthenticationError

rabbitmq-server 似乎正在运行,因为当我停止它时 send.py 给了我:

rabbitmq-server seems to be running, because when I stop it send.py gives me:

...
  File "/home/damian/.virtualenvs/kivy_1.9/local/lib/python2.7/site-packages/pika/adapters/blocking_connection.py", line 301, in _adapter_connect
    raise exceptions.AMQPConnectionError(error)
pika.exceptions.AMQPConnectionError: Connection to 192.168.1.5:5672 failed: [Errno 111] Connection refused

这很有意义.

如何解决这个ProbableAuthenticationError?

主机是 Debian 7,带有 Python 2.7.3 和 pika 0.9.14,来宾是 Ubuntu 15.04,带有 rabbitmq-server 3.4.3-2

Host machine is Debian 7 with Python 2.7.3 and pika 0.9.14, guest is Ubuntu 15.04 with rabbitmq-server 3.4.3-2

推荐答案

这是因为您尝试使用用户名和密码 guest 远程进行身份验证.从 RabbitMQ 3.3 开始,您需要创建一个新帐户才能使用远程,guest/guest只能在本地使用.

This is because you are trying to authenticate using the username and password guest remotely. Starting with RabbitMQ 3.3 you need to create a new account to use remotely, and guest/guest can only be used locally.

这取自更改日志这里.

25603 prevent access using the default guest/guest credentials except via localhost since (1.0.0)

可以通过从 loopback_users 中删除 guest 来修改 RabbitMQ 配置以允许使用 guest 帐户进行远程访问,但建议创建一个新用户以最好地遵循实践.

It's possible to modify the RabbitMQ configuration to allow remote access using the guest account, by removing guest from loopback_users, but it's recommended to create a new user to follow best practices.

[{rabbit, [{loopback_users, []}]}].

这篇关于尝试将消息发送到远程队列时出现 pika.exceptions.ProbableAuthenticationError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Seasonal Decomposition of Time Series by Loess with Python(Loess 用 Python 对时间序列进行季节性分解)
Resample a time series with the index of another time series(使用另一个时间序列的索引重新采样一个时间序列)
How can I simply calculate the rolling/moving variance of a time series in python?(如何在 python 中简单地计算时间序列的滚动/移动方差?)
How to use Dynamic Time warping with kNN in python(如何在python中使用动态时间扭曲和kNN)
Keras LSTM: a time-series multi-step multi-features forecasting - poor results(Keras LSTM:时间序列多步多特征预测 - 结果不佳)
Python pandas time series interpolation and regularization(Python pandas 时间序列插值和正则化)