芹菜给同行重置连接 [英] Celery gives connection reset by peer

查看:269
本文介绍了芹菜给同行重置连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置了rabbitmqserver并使用以下步骤添加了用户:

  uruddarraju @ *******: /usr/lib/rabbitmq/lib/rabbitmq_server-3.2.3$ sudo rabbitmqctl list_users 
列出用户...
guest [管理员]
phantom [管理员]
phantom1 []
$ b $ sudo rabbitmqctl set_permissions -p phantom phantom1。*。*。*

uruddarraju @ ******:/ usr / lib / rabbitmq /lib/rabbitmq_server-3.2.3$ sudo netstat -tulpn | grep:5672
tcp6 0 0 ::: 5672 ::: * LISTEN 31341 / beam.smp



$ p
$ b

  BROKER_URL ='amqp:// phantom:phantom1@10.98.85.92/phantom' 

我的代码如下:

<$ p $ c芹菜
进口时间
进口celeryconfig

应用= Celery('任务')
app.config_from_object(celeryconfig)

$ b @ app.task
def add(x,y):
print'sleeping'
time.sleep(20)
print'akeke'
return x + y

当我尝试运行时

 芹菜 - 芹菜工人--loglevel = info 


我得到

$ $ p $ [2014 -07-08 23:30:05,028:ERROR / MainProcess] consumer:无法连接到amqp:// phantom:**@10.98.85.92:5672 /幻像:
[Errno 5 4]通过对等方重置连接。
在2.00秒内再次尝试...
[2014-07-08 23:30:07,101:ERROR / MainProcess] consumer:无法连接到amqp:// phantom:**@10.98.85.92: 5672 /幻像:
[Errno 54]由对等重置连接。
在4.00秒内再次尝试...

一切看起来都很完美!有人可以帮我解决我在这里失踪的问题吗?解决方案

解决方案

一旦我将代码部署到生产环境中,芹菜至3.1.12。我初步使用3.0.19,但后来升级,没有发现任何问题。感谢您的支持。


I setup the rabbitmqserver and added the users using the following steps:

uruddarraju@*******:/usr/lib/rabbitmq/lib/rabbitmq_server-3.2.3$ sudo rabbitmqctl list_users 
Listing users ...
guest   [administrator]
phantom [administrator]
phantom1    []

sudo rabbitmqctl set_permissions -p phantom phantom1 ".*" ".*" ".*"

uruddarraju@******:/usr/lib/rabbitmq/lib/rabbitmq_server-3.2.3$ sudo netstat -tulpn | grep :5672
tcp6       0      0 :::5672                 :::*                    LISTEN      31341/beam.smp  

My celery config is like:

BROKER_URL = 'amqp://phantom:phantom1@10.98.85.92/phantom'

My code is like:

__author__ = 'uruddarraju'

from celery import Celery
import time
import celeryconfig

app = Celery('tasks')
app.config_from_object(celeryconfig)


@app.task
def add(x, y):
    print 'sleeping'
    time.sleep(20)
    print 'awoke'
    return x + y

When I try to run

celery -A celery worker --loglevel=info 

I get

[2014-07-08 23:30:05,028: ERROR/MainProcess] consumer: Cannot connect to amqp://phantom:**@10.98.85.92:5672/phantom:
[Errno 54] Connection reset by peer.
Trying again in 2.00 seconds...
[2014-07-08 23:30:07,101: ERROR/MainProcess] consumer: Cannot connect to amqp://phantom:**@10.98.85.92:5672/phantom:
[Errno 54] Connection reset by peer.
Trying again in 4.00 seconds...

Everything looks just perfect !! Can someone help me what I am missing here ?

解决方案

The problem was solved once I deployed my code to production, and upgrading the celery to 3.1.12. I inititally used 3.0.19 but later upgraded and did not find any issues. Thanks for the support.

这篇关于芹菜给同行重置连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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