Created
March 18, 2017 08:32
-
-
Save trAve3113r/d58cfa6c5bf738d1a685fcbe482563c0 to your computer and use it in GitHub Desktop.
Barebones rabbitmq setup for working with Celery on debian
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Installation,see:https://www.rabbitmq.com/install-debian.html | |
| # 1:Execute the following command to add the APT repository to your /etc/apt/sources.list.d: | |
| echo 'deb http://www.rabbitmq.com/debian/ testing main' | | |
| sudo tee /etc/apt/sources.list.d/rabbitmq.list | |
| # 2:(optional) To avoid warnings about unsigned packages, add our public key to your trusted key list using apt-key(8): | |
| wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | | |
| sudo apt-key add - | |
| # 3: | |
| apt-get update | |
| # 4: | |
| apt-get install rabbitmq-server | |
| # Settings,see S0 answer: http://stackoverflow.com/questions/25869858/celery-error-in-connecting-to-rabbitmq-server#_=_ | |
| # 1: Create a user different from the default 'guest' admin user | |
| rabbitmqcrl add_user <my_username> <my_password> | |
| # 2: Add a vhost,see explanation : https://www.rabbitmq.com/vhosts.html | |
| rabbitmqctl add_vhost <my_vhost> | |
| # 3: Set permissions for our new user | |
| rabbitmqctl set_permissions -p <my_vhost> <my_username> ".*" ".*" ".*" | |
| # 4: Update the 'celery.py' file <or_whatever_file_you_used_to_configure_celery_app> | |
| app = Celery('<django_project_name>', broker='amqp://<my_username>:<my_passowrd>@localhost/<my_vhost>') | |
| # 5: Cautionary step | |
| # Delete/comment out these settings parameters in your 'celeryconfig.py' file | |
| # - BROKER_TRANSPORT | |
| # - BROKER_URL | |
| # 6: Last step, restart rabbitmq-server | |
| rabbitmq-server restart | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment