I have a problem executing celery on rabbitmq-server. I searched and found a link, but it doesn't help me. My env is ubuntu 14.04, python 2.7.6, celery 3.1.15, Django 1.7. Referencing a link, I installed rabbitmq-server locally. I added user, vhost in rabbitmq-server and set permissions.
$ sudo rabbitmqctl add_user tonyg password
$ sudo rabbitmqctl add_vhost vir_host
$ sudo rabbitmqctl set_permissions -p vir_host tonyg ".*" ".*" ".*"
My celery's setting in django follows.
BROKER_URL = 'amqp://tonyg:password@localhost:5672//vir_host'
CELERY_RESULT_BACKEND = 'amqp://tonyg:password@localhost:5672//vir_host'
CELERY_ACCEPT_CONTENT = [u'application/x-python-serialize', u'image/jpeg', u'image/bmp', u'image/png', u'image/tiff']
CELERY_TIMEZONE = 'Asia/Tokyo'
CELERY_ENABLE_UTC = True
CELERY_IGNORE_RESULT = False
I don't set anything about rabbitmq-server other than default configs.
I executed celery like this.
$ celery -A MyProj worker -l info
-------------- celery@ip-172-31-3-10 v3.1.15 (Cipater)
---- **** -----
--- * *** * -- Linux-3.13.0-36-generic-x86_64-with-Ubuntu-14.04-trusty
-- * - **** ---
- ** ---------- [config]
- ** ---------- .> app: MyProj:0x7f7453328b10
- ** ---------- .> transport: amqp://tonyg:**@localhost:5672//vir_host
- ** ---------- .> results: amqp://tonyg:password@localhost:5672//vir_host
- *** --- * --- .> concurrency: 1 (prefork)
-- ******* ----
--- ***** ----- [queues]
-------------- .> celery exchange=celery(direct) key=celery
[tasks]
. MyProj.tasks. ......
. MyProj.tasks. ......
[2014-10-29 15:07:50,241: ERROR/MainProcess] consumer: Cannot connect to amqp://tonyg:**@127.0.0.1:5672//vir_host: [Errno 104] Connection reset by peer.
Trying again in 2.00 seconds...
[2014-10-29 15:07:55,251: ERROR/MainProcess] consumer: Cannot connect to amqp://tonyg:**@127.0.0.1:5672//vir_host: [Errno 104] Connection reset by peer.
Trying again in 4.00 seconds...
When i set celery using default guest identifier,
BROKER_URL = 'amqp://guest:guest@localhost:5672//'
CELERY_RESULT_BACKEND = 'amqp://guest:guest@localhost:5672//'
it does operate well. I don't know why. Could anyone help me? Thank you.