2017-10-21 4 views
0

나는 레디 스의 모든 활성/예약/예약 된 작업을 얻기 위해 노력 :오류 (파이썬, 셀러리, 레디 스)는

from celery.task.control import inspect 
inspect_obj = inspect() 
inspect_obj.active() 
inspect_obj.scheduled() 
inspect_obj.reserved() 

을하지만, 다음과 같은 오류 목록과 함께 인사를했다 : 내 가상 환경 ==> HubblerAPI. 다음과 같이

Traceback (most recent call last): 
File "<stdin>", line 1, in <module> 
File "/home/ec2-user/HubblerAPI/local/lib/python3.4/site- 
packages/celery/app/control.py", line 81, in active 
return self._request('dump_active', safe=safe) 
File "/home/ec2-user/HubblerAPI/local/lib/python3.4/site- 
packages/celery/app/control.py", line 71, in _request 
timeout=self.timeout, reply=True, 
File "/home/ec2-user/HubblerAPI/local/lib/python3.4/site- 
packages/celery/app/control.py", line 316, in broadcast 
limit, callback, channel=channel, 
File "/home/ec2-user/HubblerAPI/local/lib/python3.4/site- 
packages/kombu/pidbox.py", line 283, in _broadcast 
chan = channel or self.connection.default_channel 
File "/home/ec2-user/HubblerAPI/local/lib/python3.4/site- 
packages/kombu/connection.py", line 771, in default_channel 
self.connection 
File "/home/ec2-user/HubblerAPI/local/lib/python3.4/site- 
packages/kombu/connection.py", line 756, in connection 
self._connection = self._establish_connection() 
File "/home/ec2-user/HubblerAPI/local/lib/python3.4/site- 
packages/kombu/connection.py", line 711, in _establish_connection 
conn = self.transport.establish_connection() 
File "/home/ec2-user/HubblerAPI/local/lib/python3.4/site- 
packages/kombu/transport/pyamqp.py", line 116, in establish_connection 
conn = self.Connection(**opts) 
File "/home/ec2-user/HubblerAPI/local/lib/python3.4/site- 
packages/amqp/connection.py", line 165, in __init__ 
self.transport = self.Transport(host, connect_timeout, ssl) 
File "/home/ec2-user/HubblerAPI/local/lib/python3.4/site- 
packages/amqp/connection.py", line 186, in Transport 
return create_transport(host, connect_timeout, ssl) 
File "/home/ec2-user/HubblerAPI/local/lib/python3.4/site- 
packages/amqp/transport.py", line 299, in create_transport 
return TCPTransport(host, connect_timeout) 
File "/home/ec2-user/HubblerAPI/local/lib/python3.4/site- 
packages/amqp/transport.py", line 95, in __init__ 
raise socket.error(last_err) 
**OSError: [Errno 111] Connection refused** 

내 셀러리 설정 파일 인 EC2 콘솔에서이를 사용하여 스피 :

BROKER_TRANSPORT = 'redis' 
BROKER_TRANSPORT_OPTIONS = { 
    'queue_name_prefix': 'dev-', 
    'wait_time_seconds': 10, 
    'polling_interval': 30, 
    # The polling interval decides the number of seconds to sleep 
     between unsuccessful polls 
    'visibility_timeout': 3600 * 5, 
    # If a task is not acknowledged within the visibility_timeout, the 
     task will be redelivered to another worker and executed. 
} 
CELERY_MESSAGES_DB = 6 
BROKER_URL = "redis://%s:%s/%s" % (AWS_REDIS_ENDPOINT, AWS_REDIS_PORT, 
       CELERY_MESSAGES_DB) 

내가 잘못 여기에 오류 로그와 같은 일을하고 무엇은이 레디 스 브로커를 사용하지 않는 것이 좋습니다.

답변

0

구성된 브로커 대신 RabbitMQ의 ampq 프로토콜을 사용하려고하므로 파이썬 코드가 configs를 인식하지 못하는 것처럼 보입니다.

나는 다음과 같은

http://docs.celeryproject.org/en/latest/getting-started/brokers/redis.html

귀하의 CONFIGS 아직 당신이 장고와 셀러리를 사용하지 않는 것 셀러리에 대한 장고 CONFIGS 유사 좋습니다.

http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html#using-celery-with-django

관련 문제