title: Celery - errno 111 connection refused
body: <p>My celery tasks stops getting executed in between. My rabbitmq stops in between and then I need to restart it manually. Last time(15-16 hours back), similar problem occurred, I did the following (manually), and it started working again.</p>
  
  <p>I reinstalled the rabbitmq and then it started working again.</p>
  
  <p><code>sudo apt-get --purge remove raabitmq-server</code></p>
  
  <p><code>sudo apt-get install raabitmq-server</code></p>
  
  <p>Now it is again showing `</p>
  
  <pre><code>Celery - errno 111 connection refused
  </code></pre>
  
  <p>Following is my config.</p>
  
  <pre><code>BROKER_URL = 'amqp://'
  CELERY_RESULT_BACKEND = 'amqp://'
  
  CELERY_TASK_SERIALIZER = 'json'
  CELERY_RESULT_SERIALIZER = 'json'
  CELERY_ACCEPT_CONTENT=['json']
  CELERY_TIMEZONE = 'Europe/Oslo'
  CELERY_ENABLE_UTC = True
  
  CELERY_CREATE_MISSING_QUEUES = True
  </code></pre>
  
  <p>Please let me know where I'm going wrong?</p>
  
  <p>How should I rectify it?</p>
  
  <p><strong>Part2</strong></p>
  
  <p>Also, I've multiple queues. I can run it within the project directory, but when demonizing, the workers dont take task. I still need to start the celery workers manually. How can I demozize it?</p>
  
  <p>Here is my celerd conf.</p>
  
  <pre><code># Name of nodes to start, here we have a single node
  CELERYD_NODES="w1 w2 w3 w4"
  
  
  CELERY_BIN="/usr/local/bin/celery"
  
  # Where to chdir at start.
  CELERYD_CHDIR="/var/www/fractal/parser-quicklook/"
  
  # Python interpreter from environment, if using virtualenv
  #ENV_PYTHON="/somewhere/.virtualenvs/MyProject/bin/python"
  
  # How to call "manage.py celeryd_multi"
  #CELERYD_MULTI="/usr/local/bin/celeryd-multi"
  
  # How to call "manage.py celeryctl"
  #CELERYCTL="/usr/local/bin/celeryctl"
  
  #CELERYBEAT="/usr/local/bin/celerybeat"
  
  # Extra arguments to celeryd
  CELERYD_OPTS="--time-limit=300 --concurrency=8  -Q BBC,BGR,FASTCOMPANY,Firstpost,Guardian,IBNLIVE,LIVEMINT,Mashable,NDTV,Pandodaily,Reuters,TNW,TheHindu,ZEENEWS "
  
  # Name of the celery config module, don't change this.
  CELERY_CONFIG_MODULE="celeryconfig"
  
  # %n will be replaced with the nodename.
  CELERYD_LOG_FILE="/var/log/celery/%n.log"
  CELERYD_PID_FILE="/var/run/celery/%n.pid"
  
  # Workers should run as an unprivileged user.
  #CELERYD_USER="nobody"
  #CELERYD_GROUP="nobody"
  
  # Set any other env vars here too!
  PROJET_ENV="PRODUCTION"
  
  # Name of the projects settings module.
  # in this case is just settings and not the full path because it will change the dir to
  # the project folder first.
  CELERY_CREATE_DIRS=1
  </code></pre>
  
  <p>Celeryconfig is already provided in part1.</p>
  
  <p>Here is my proj directory structure.</p>
  
  <pre><code>project
  |-- main.py
  |-- project
  |   |-- celeryconfig.py
  |   |-- __init__.py
  |-- tasks.py
  </code></pre>
  
  <p><strong>How can I demonize with the Queues?</strong> I have provided the queues in <code>CELERYD_OPTS</code> as well. </p>
  
  <p>Is there a way in which we can dynamically demonize the number of queues in the celery? For eg:- we have <code>CELERY_CREATE_MISSING_QUEUES = True</code> for creating the missing queues. Is there something similar to daemonize the celery queues?</p>