python - django celery and rabbitmq access refused error -
i have installed rabbitmq server , followed these steps:
sudo touch ~/.procfile sudo vi ~/.procfile
and added export path=$path:/usr/local/sbin
after added user , permission
sudo rabbitmq-server -detached sudo rabbitmqctl add_user myuser mypassword sudo rabbitmqctl add_vhost myvhost sudo rabbitmqctl set_permissions -p myvhost myuser “.*” “.*” “.*”
and in settings file did :
broker_url = “amqp://myuser:mypassword@localhost:5672/myvhost”
it working fine in local. trying send multiple emails @ once.
to start celery using supervisor in production.
sudo aptitude install supervisor
in production have created my-project.config inside /etc/supervisor/conf.d/my-project.conf
my config file looks like:
[program:celery] command=/var/www/html/myproject/venv/bin/python /var/www/html/myproject/manage.py celeryd --loglevel=info environment=pythonpath=/var/www/html/myproject directory=/var/www/html/myproject user=www-data numprocs=1 stdout_logfile=/var/log/celeryd.log stderr_logfile=/var/log/celeryd.log autostart=true autorestart=true startsecs=10 stopwaitsecs = 600 priority=998
it works fine in local in production when try send email steps gives me error saying
exchange.declare: (403) access_refused - access exchange 'celery' in vhost 'myvhost' refused user 'myuser'
why getting error ? wrong here. works fine in local step while sending email in production gives me error
i need suggestion
Comments
Post a Comment