[rabbitmq-discuss] Failure to Connect RabbitMQ/Celery across two EC2 instances
jpd750 at gmail.com
Tue Apr 29 23:57:35 BST 2014
> I keep getting:`*ERROR/MainProcess] consumer: Cannot connect to
> amqp://ec2celeryuser*` when I run `celery -A tasks worker` on terminal.
Basically what I'm trying to do is get celery/rabbitmq working properly
across (2) ec2 instances. To pass a silly task in `tasks.py` for processing
* 1. Instance 1* - Houses rabbitMQ
This currently runs RabbitMQ fine. If I run `sudo rabbitmqctl status` it
Status of node 'rabbit at ip-xx-xxx-xxx-xx' ...
*2. Instance 2* - Houses Celery
I'm trying to run celery on `instance 2` against Instance 1 using the
following in terminal:
celery -A tasks worker
I have a file `*celeryconfig.py*`:
> #CELERY SETTINGS
> CELERY_IMPORTS = ("tasks",)
> CELERY_RESULT_BACKEND = "amqp"
I have a file `*client.py*`:
from tasks import add
> result = add.delay(4, 4) # call task
> result_sum = result.get(timeout=5) # wait to get result for a maximum
> of 5 seconds
I have a file `*tasks.py*`:
from celery import Celery
> app = Celery('tasks',
> def add(x, y):
> return x + y
I've properly setup a `vhost`, a user `ec2celeryuser`, and gave this user
sudo rabbitmqctl set_permissions -p /celeryserver1 ec2celeryuser ".*"
> ".*" ".*"
if I do: `sudo rabbitmqctl list_users` on RabbitMQ (instance 1) it shows:
> guest [administrator
I've tried *both usernames* with their passwords, but no change.
What am I doing wrong here? Clearly there is a connection issue, but what
am I doing wrong?
*I've been following these without much luck.*
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss