2017-08-14 1463 views
4

我不断收到此错误,我不知道为什么。我在Windows 10上使用Ubuntu,芹菜用于正常工作。然后发生了一些事情,我不断收到这个错误。我使用芹菜文档来学习。芹菜:消费者:无法连接到amqp:// guest:**@127.0.0.1:5672 //:[Errno 92]协议不可用

这里是task.py:

from celery import Celery 

app = Celery('tasks', broker='pyamqp://[email protected]//') 

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

这里的错误我得到:

[2017-08-14 17:34:04,436: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 92] Protocol not available. 
Trying again in 2.00 seconds... 

[2017-08-14 17:34:06,453: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 92] Protocol not available. 
Trying again in 4.00 seconds... 

[2017-08-14 17:34:10,465: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 92] Protocol not available. 
Trying again in 6.00 seconds... 

[2017-08-14 17:34:16,480: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 92] Protocol not available. 
Trying again in 8.00 seconds... 

为了启动芹菜I型:

celery -A tasks worker --loglevel=info 

回答

1

难道你最近更新amqp?

似乎从Linux子系统连接到RabbitMQ实例是不可能的,因为从2.1.2版本到插座巫师的版本不再可能。

https://github.com/celery/py-amqp/issues/145

我建议尝试芹菜可能支持其他后端,我要去尝试Redis的。降级到至少RabbitMQ 2.1.2也可能解决问题。

+0

更新:由于RMQ 2.1.2相当陈旧,我终于切换到了redis。现在一切正常。 –

+0

感谢您的回答。我试图找到最后一个小时的解决方案。你的回答终于救了我。荣誉。 –

相关问题