mongodb.rst 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. .. _broker-mongodb:
  2. ===============
  3. Using MongoDB
  4. ===============
  5. .. admonition:: Experimental Status
  6. The MongoDB transport is in need of improvements in many areas and there
  7. are several open bugs. Unfortunately we don't have the resources or funds
  8. required to improve the situation, so we're looking for contributors
  9. and partners willing to help.
  10. .. _broker-mongodb-installation:
  11. Installation
  12. ============
  13. For the MongoDB support you have to install additional dependencies.
  14. You can install both Celery and these dependencies in one go using
  15. the ``celery[mongodb]`` :ref:`bundle <bundles>`:
  16. .. code-block:: console
  17. $ pip install -U celery[mongodb]
  18. .. _broker-mongodb-configuration:
  19. Configuration
  20. =============
  21. Configuration is easy, set the transport, and configure the location of
  22. your MongoDB database:
  23. .. code-block:: python
  24. broker_url = 'mongodb://localhost:27017/database_name'
  25. Where the URL is in the format of:
  26. .. code-block:: text
  27. mongodb://userid:password@hostname:port/database_name
  28. The host name will default to ``localhost`` and the port to 27017,
  29. and so they are optional. ``userid`` and ``password`` are also optional,
  30. but needed if your MongoDB server requires authentication.
  31. .. _mongodb-results-configuration:
  32. Results
  33. -------
  34. If you also want to store the state and return values of tasks in MongoDB,
  35. you should see :ref:`conf-mongodb-result-backend`.