RabbitMQ 和 Django-Celery 运行时出现问题:目标机器主动拒绝连接

发布于 2024-11-26 07:53:01 字数 1739 浏览 5 评论 0原文

我正在尝试让 Django-Celery 在我的 Django 应用程序上运行。我无法让工作服务器运行。当我尝试时,我收到消息:无法建立连接,因为目标计算机主动拒绝

这是我到目前为止所做的事情。首先,我安装了 django celery 包: http://pypi.python.org/pypi/django- celery

我可以毫无问题地将它加载到 python 中。我还按照 Windows 安装说明安装了 RabbitMQ 服务器: http://www.rabbitmq.com/install .html#windows

在 RabbitMQ 站点上的 pytho 中启动教程,我看到需要安装 pika: http://pypi.python.org/pypi/pika。它导入没有任何问题。

从那里,我通过在命令行运行以下命令来启动 RabbitMQ 服务器: rabbitmq-service start

我收到消息说 Service RabbitMQ started

这是我开始遇到问题的地方。

我尝试了 django-celery 中的第一步: http ://packages.python.org/django-celery/getting-started/first-steps-with-django.html 和rabbitMQ站点上的“hello world”示例:http://www.rabbitmq.com/tutorials/tutorial-one-python.html

在这两种情况下,我都会收到消息:无法建立连接,因为目标计算机主动拒绝

我的第一个想法是,这听起来像是防火墙问题。所以我进入Windows 7防火墙并添加入站和出站规则以打开本地和远程端口5672和5673到TCP协议,但我仍然收到相同的错误消息。

当我运行rabbitmqctl status时,我收到消息:
错误:无法连接到节点“rabbit@hostname”:nodedown
诊断:
- 主机名上的节点及其端口:[{rabbitmqctl18856, 505031}]

这是否意味着它正在尝试在这些端口上进行操作?那么默认的5672呢?

有什么建议吗?

更新:这实际上是由于多次失败的rabbitmq安装与最新安装冲突而导致的问题。如果你必须删除rabbitmq,请使用“rabbitmq-service remove”命令而不是SC DELETE,这会给我带来很多问题,我不得不进去清理我的Windows注册表文件。

I am trying to get Django-Celery running on my Django App. I cannot get the worker server to run. When I try I get the message: No Connection could be made because the target machine actively refused it

Here is what I have done so far. First, I installed the django celery package: http://pypi.python.org/pypi/django-celery

I can load it into python without problems. I also installed the RabbitMQ server per the windows install instructions: http://www.rabbitmq.com/install.html#windows

Starting the tutorials in pytho on the RabbitMQ site I saw the need to install pika: http://pypi.python.org/pypi/pika. It imports without any problems.

From there I start the RabbitMQ server by running this at the command line: rabbitmq-service start

I get the message back that Service RabbitMQ started

Here is where I start to have problems.

I attempted the first steps in django-celery: http://packages.python.org/django-celery/getting-started/first-steps-with-django.html and the "hello world" example on the rabbitMQ site: http://www.rabbitmq.com/tutorials/tutorial-one-python.html

In both cases I get the message: No Connection could be made because the target machine actively refused it

My first thought was that this sounded like a firewall problem. So I went into the windows 7 firewall and added inbound and outbound rules to open the local and remote ports 5672 and 5673 to TCP protocol, but I still get the same error message.

When I run rabbitmqctl status i get the message:
Error: unable to connect to node 'rabbit@hostname': nodedown
diagnostics:
- nodes and their ports on hostname: [{rabbitmqctl18856, 505031}]

Does that mean it that it is trying to operate on those ports? what about the default 5672?

Any suggestions?

UPDATE: This was actually a problem resulting from several failed rabbitmq installs conflicting with the latest installation. If you have to remove rabbitmq use the 'rabbitmq-service remove' command and not SC DELETE, which cause a lot of problems for me and I had to go in and clean up my windows registry file.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我也只是我 2024-12-03 07:53:01

rabbitmqctl 指示的 nodedown 错误表明服务器未在该计算机上运行。

尝试执行 RabbitMQ 的故障排除指南中的步骤。特别要密切关注日志。服务器是否因某种原因崩溃了?您可以将日志发布到某处吗?

The nodedown error indicated by rabbitmqctl suggests that the server isn't running on that machine.

Try going though the steps in RabbitMQ's troubleshooting guide. In particular, pay close attention to the logs. Has the server crashed for some reason? Could you post the logs somewhere?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文