连接问题 - Celery/Django

发布于 2024-10-09 01:39:11 字数 1017 浏览 1 评论 0原文

漫漫长夜...我的第二个 Celery/RabbitMQ 设置无法运行。

步骤 1

sudo rabbitmq-server

运行:ok!

步骤 2

python manage.py celeryd -l info

错误:[2010-12-28 03:38:24,690: ERROR/MainProcess] CarrotListener:连接错误:套接字已关闭。 28秒后重试...


我肯定:

  • 添加了rabbitmq用户和vhost
  • 更新了Django设置。py

编辑:

我认为可能必须从.deb而不是apt-get安装。

卸载 deb 并安装 apt-get 版本后,我得到:

invoke-rc.d: initscript rabbitmq-server, action "start" failed.
dpkg: error processing rabbitmq-server (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 rabbitmq-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

我的解决方案:

apt-get --purge 删除rabbitmq-server

apt-get 安装rabbitmq-server

...没有评论...也许需要一些睡眠:)


关于如何调试这个有什么想法吗? :|

long night... can't get my second Celery/RabbitMQ setup run to work.

step 1

sudo rabbitmq-server

runs: ok!

step 2

python manage.py celeryd -l info

error: [2010-12-28 03:38:24,690: ERROR/MainProcess] CarrotListener: Connection Error: Socket closed. Trying again in 28 seconds...


I have definitely:

  • added rabbitmq user and vhost
  • updated the Django setings.py

Edit:

I think it might have to with installing from a .deb instead of apt-get.

After uninstalling the deb and installing the apt-get version I get this:

invoke-rc.d: initscript rabbitmq-server, action "start" failed.
dpkg: error processing rabbitmq-server (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 rabbitmq-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

My Solution:

apt-get --purge remove rabbitmq-server

apt-get install rabbitmq-server

...no comment...maybe need some sleep :)


Any ideas on how I could debug this? :|

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

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

发布评论

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

评论(2

腻橙味 2024-10-16 01:39:12

检查您正在使用的 RabbitMQ 的不同版本,较新的版本具有新功能,并且可能与 Celery 不兼容。我的机器上有最新的 2.3.1 版本,从 RabbitMQ deb 安装,这可以正常工作,除非您需要使用 SSL,在这种情况下您必须安装更新版本的 Erlang/OTP,这很痛苦。

另外,最好使用 init 脚本来启动代理:

sudo /etc/init.d/rabbitmq-server start

如果您从 init 脚本启动代理,如果问题仍然存在,您应该能够查看代理错误日志:

sudo tail -f /var/log/rabbit@<your-local-host>.log

HTH。

Check the different versions of RabbitMQ that you're using, newer versions have new features and may be incompatible with Celery. I've got the latest 2.3.1 version on my machine, installed from the RabbitMQ deb, this works OK unless you need to use SSL in which case you have to install a more recent version of Erlang/OTP, which is painful.

Also, it's probably better to use the init script to start the broker:

sudo /etc/init.d/rabbitmq-server start

If you start the broker from the init script you should be able to look at the broker error logs if the problem persists:

sudo tail -f /var/log/rabbit@<your-local-host>.log

HTH.

盗梦空间 2024-10-16 01:39:12

我在安装rabbitmq-server和安装chef时确实遇到了这个问题。
我的解决方法以及该问题的解决方案如下。

    $ sudo vim /etc/hosts

然后添加。

    127.0.0.1 <hostname>

这是您的主机名,如果不确定主机名,请运行以下命令:

    $ hostname

结果是您的主机名。只需将其添加到您的 /etc/hosts 中,然后运行:

    $ sudo service rabbitmq-server start

它就启动了。:)
这对我有用。
感谢您花时间阅读。:)

I did faced this issue while installing rabbitmq-server, while i was installing chef.
The work around for me and the solution to this problem is given as follows.

    $ sudo vim /etc/hosts

Then add.

    127.0.0.1 <hostname>

Here is your hostname, if not sure about the hostname then run the following command:

    $ hostname

the Result is your hostname. Just add that to your /etc/hosts and then run:

    $ sudo service rabbitmq-server start

And it was started.:)
This worked for me.
Thanks for your time to read.:)

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