rabbitmq를 브로커로 사용하여 EC2에서 django / celery를 실행하고 있습니다. 사용중인 머신이 실패하여 다른 인스턴스를 시작했습니다. 그러나 새로운 기계로 전환 한 후 셀러리를 작동시킬 수 없었습니다.
편집 : 문제를 잘못 진단하는 경우를 대비하여 아래에 많은 로그를 포함 시켰습니다. 그러나 문제는 rabbitmq-server가 "데이터베이스 시작"단계에서 시작되지 않는다는 것입니다.
node : rabbit@ip-10-212-66-181
app descriptor: /usr/lib/rabbitmq/lib/rabbitmq_server-1.7.2/sbin/../ebin/rabbit.app
home dir : /var/lib/rabbitmq
cookie hash : 5+uQ077En5bpvle3HJCQMg==
log : /var/log/rabbitmq/rabbit.log
sasl log : /var/log/rabbitmq/rabbit-sasl.log
database dir : /var/lib/rabbitmq/mnesia/rabbit
starting internal event notification system ...done
starting logging server ...done
starting database ...Erlang has closed
이 문제를 더 진단 / 해결하는 방법에 대한 아이디어가 있습니까?
셀러리를 실행하려고하면 다음과 같이됩니다.
$ python manage.py celeryd -l info
/opt/bitnami/python/lib/python2.6/site-packages/django_celery-2.4.2-py2.6.egg/djcelery/loaders.py:86: UserWarning: Using settings.DEBUG leads to a memory leak, never use this setting in production environments!
warnings.warn("Using settings.DEBUG leads to a memory leak, never "
[2011-12-05 19:40:13,545: WARNING/MainProcess]
-------------- celery@ip-10-212-66-181 v2.4.3
---- **** -----
--- * *** * -- [Configuration]
-- * - **** --- . broker: amqp://guest@localhost:5672//
- ** ---------- . loader: djcelery.loaders.DjangoLoader
- ** ---------- . logfile: [stderr]@INFO
- ** ---------- . concurrency: 1
- ** ---------- . events: OFF
- *** --- * --- . beat: OFF
-- ******* ----
--- ***** ----- [Queues]
-------------- . celery: exchange:celery (direct) binding:celery
[Tasks]
. tbAnalytics.models.processAnalysis
. tbCollections.models.processCollection
[2011-12-05 19:40:13,558: INFO/PoolWorker-1] child process calling self.run()
[2011-12-05 19:40:13,562: WARNING/MainProcess] celery@ip-10-212-66-181 has started.
[2011-12-05 19:40:13,564: ERROR/MainProcess] Consumer: Connection Error: [Errno 111] Connection refused. Trying again in 2 seconds...
[2011-12-05 19:40:15,574: ERROR/MainProcess] Consumer: Connection Error: [Errno 111] Connection refused. Trying again in 4 seconds...
다시 추적하면 rabbitmq 서버가 문제인 것처럼 보이며 특히 데이터베이스가 다음과 같습니다.
$ sudo rabbitmqctl status
Status of node 'rabbit@ip-10-212-66-181' ...
Error: unable to connect to node 'rabbit@ip-10-212-66-181': nodedown
diagnostics:
- nodes and their ports on ip-10-212-66-181: [{rabbitmqctl14448,38289}]
- current node: 'rabbitmqctl14448@ip-10-212-66-181'
- current node home dir: /var/lib/rabbitmq
- current node cookie hash: 5+uQ077En5bpvle3HJCQMg==
그러나 서버를 다시 시작하는 방법을 알 수 없었습니다.
bitnami@ip-10-212-66-181:/var/log/rabbitmq$ sudo rabbitmq-server start_app
+---+ +---+
| | | |
| | | |
| | | |
| +---+ +-------+
| |
| RabbitMQ +---+ |
| | | |
| v1.7.2 +---+ |
| |
+-------------------+
AMQP 8-0
Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial Technologies LLC., and Rabbit Technologies Ltd.
Licensed under the MPL. See http://www.rabbitmq.com/
node : rabbit@ip-10-212-66-181
app descriptor: /usr/lib/rabbitmq/lib/rabbitmq_server-1.7.2/sbin/../ebin/rabbit.app
home dir : /var/lib/rabbitmq
cookie hash : 5+uQ077En5bpvle3HJCQMg==
log : /var/log/rabbitmq/rabbit.log
sasl log : /var/log/rabbitmq/rabbit-sasl.log
database dir : /var/lib/rabbitmq/mnesia/rabbit
starting internal event notification system ...done
starting logging server ...done
starting database ...Erlang has closed
{"init terminating in do_boot",{{nocatch,{error,{cannot_start_application,rabbit,{bad_return,{{rabbit,start,[normal,[]]},{'EXIT',{{case_clause,{error,{timeout_waiting_for_tables,[rabbit_user,rabbit_user_permission,rabbit_vhost,rabbit_config,rabbit_listener,rabbit_durable_route,rabbit_route,rabbit_reverse_route,rabbit_durable_exchange,rabbit_exchange,rabbit_durable_queue,rabbit_queue]}}},[{rabbit,'-run_boot_step/1-lc$^1/1-1-',1},{rabbit,run_boot_step,1},{rabbit,'-start/2-lc$^0/1-0-',1},{rabbit,start,2},{application_master,start_it_old,4}]}}}}}}},[{init,start_it,1},{init,start_em,1}]}}
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
또한 관련성이 있는지 모르지만이 프로세스는 백그라운드에서 실행 중입니다.
$ ps aux | grep rabbit
rabbitmq 714 0.0 0.0 1980 408 ? S Dec04 0:00 /usr/lib/erlang/erts-5.7.4/bin/epmd -daemon
이런 종류의 실패에 대한 문서를 찾지 못했습니다. 어떤 제안?