RabbitMQ的芹菜挂在“混合:寻找邻居"上,但是普通芹菜的作品 [英] celeryd with RabbitMQ hangs on "mingle: searching for neighbors", but plain celery works

查看:51
本文介绍了RabbitMQ的芹菜挂在“混合:寻找邻居"上,但是普通芹菜的作品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用芹菜和RabbitMQ撞墙.

I'm banging my head to the wall with celeryd and RabbitMQ.

本教程中的示例工作正常:

This example from tutorial is working just fine:

from celery import Celery

app = Celery('tasks', backend='amqp', broker='amqp://')

@app.task
def add(x, y):
return x + y

我跑步:

celery -A tasks worker --loglevel=info

然后我得到输出:

[2014-11-18 19:47:58,874: INFO/MainProcess] Connected to amqp://guest:**@127.0.0.1:5672//
[2014-11-18 19:47:58,881: INFO/MainProcess] mingle: searching for neighbors
[2014-11-18 19:47:59,889: INFO/MainProcess] mingle: all alone
[2014-11-18 19:47:59,896: WARNING/MainProcess] celery@vagrant-ubuntu-trusty-64 ready.

我现在可以从python repl运行任务并获得结果.

I can run the task now from python repl and get a result.

但是,当我安装celeryd时,该过程在混合步骤中挂起:

But when I install celeryd, the process hangs up on the mingle-step:

[2014-11-18 20:18:33,893: INFO/MainProcess] mingle: searching for neighbors

在此之后没有输出.

我的/etc/default/celeryd看起来像这样:

My /etc/default/celeryd looks like this:

ENABLED="true"
CELERYD_NODES="w1"
CELERYD_CHDIR="/home/myusername/src/celery-test"
CELERYD_OPTS="--time-limit=300 --concurrency=8"
CELERY_CONFIG_MODULE="celeryconfig"
CELERYD_LOG_FILE="/var/log/celery/%n.log"
CELERYD_USER="celery"
CELERYD_GROUP="celery"

我正在使用以下版本:

Ubuntu 14.04芹菜3.1.16(Cipater)芹菜3.1.6-1ubuntu1rabbitmq服务器3.2.4-1Python 2.7.6

Ubuntu 14.04 celery 3.1.16 (Cipater) celeryd 3.1.6-1ubuntu1 rabbitmq-server 3.2.4-1 Python 2.7.6

因此,无需守护进程,芹菜就可以初始化自身,但显然守护进程(celeryd)挂在混合步骤上.

So without daemonizing, celery can initialize itself, but with daemon (celeryd) hangs on the mingle-step apparently.

一些论坛建议,这是RabbitMQ达到磁盘空间限制的问题.我有足够的磁盘,RabbitMQ自己的日志没有指示任何问题.

Some forums suggest that this is a problem with RabbitMQ reaching a disk space limit. I have plenty of disk, and RabbitMQ's own logs do not indicate any problem.

推荐答案

如果您使用数据库后端,则将以下选项添加到celery应该可以解决问题:

If you use the Database backend, adding the following options to celery should solve the problem:

    --without-mingle

这篇关于RabbitMQ的芹菜挂在“混合:寻找邻居"上,但是普通芹菜的作品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆