Преглед изворни кода

added documentation for mongodb backend settings.

abecciu пре 15 година
родитељ
комит
8cecd9f62d
1 измењених фајлова са 36 додато и 15 уклоњено
  1. 36 15
      docs/configuration.rst

+ 36 - 15
docs/configuration.rst

@@ -45,7 +45,7 @@ Concurrency settings
 * CELERYD_CONCURRENCY
 * CELERYD_CONCURRENCY
     The number of concurrent worker processes, executing tasks simultaneously.
     The number of concurrent worker processes, executing tasks simultaneously.
 
 
-    Defaults to the number of CPUs in the system. 
+    Defaults to the number of CPUs in the system.
 
 
 
 
 Task result backend settings
 Task result backend settings
@@ -158,34 +158,55 @@ Example configuration
 MongoDB backend settings
 MongoDB backend settings
 ========================
 ========================
 
 
+**NOTE** The MongoDB backend requires the :mod:`pymongo` library:
+    http://github.com/mongodb/mongo-python-driver/tree/master
+
 * CELERY_MONGODB_BACKEND_SETTINGS
 * CELERY_MONGODB_BACKEND_SETTINGS
-    This is a dict supporting the following keys
+
+    This is a dict supporting the following keys:
 
 
     * host
     * host
-        Hostname of the MongoDB server.
+        Hostname of the MongoDB server. Defaults to "localhost".
 
 
     * port
     * port
-        The port the MongoDB server is listening to.
+        The port the MongoDB server is listening to. Defaults to 27017.
 
 
     * user
     * user
-        Username to authenticate to the MongoDB server as.
+        Username to authenticate to the MongoDB server as (optional).
 
 
     * password
     * password
+        Password to authenticate to the MongoDB server (optional).
 
 
     * database
     * database
-        The database name to connect to.
+        The database name to connect to. Defaults to "celery".
 
 
     * taskmeta_collection
     * taskmeta_collection
-        FIXME
+        The collection name to store task metadata.
+        Defaults to "celery_taskmeta".
 
 
     * periodictaskmeta_collection
     * periodictaskmeta_collection
-        FIXME
+        The collection name to store periodic task metadata.
+        Defaults to "celery_periodictaskmeta".
+
+
+Example configuration
+---------------------
+
+.. code-block:: python
+
+    CELERY_MONGODB_BACKEND_SETTINGS = {
+        "host": "192.168.1.100",
+        "port": 30000,
+        "database": "mydb",
+        "taskmeta_collection": "my_taskmeta_collection",
+    }
+
 
 
 Broker settings
 Broker settings
 ===============
 ===============
 
 
 * CELERY_AMQP_EXCHANGE
 * CELERY_AMQP_EXCHANGE
-    
+
     Name of the AMQP exchange.
     Name of the AMQP exchange.
 
 
 * CELERY_AMQP_EXCHANGE_TYPE
 * CELERY_AMQP_EXCHANGE_TYPE
@@ -216,7 +237,7 @@ Broker settings
 * CELERY_AMQP_CONNECTION_RETRY
 * CELERY_AMQP_CONNECTION_RETRY
     Automatically try to re-establish the connection to the AMQP broker if
     Automatically try to re-establish the connection to the AMQP broker if
     it's lost.
     it's lost.
-    
+
     The time between retries is increased for each retry, and is
     The time between retries is increased for each retry, and is
     not exhausted before ``CELERY_AMQP_CONNECTION_MAX_RETRIES`` is exceeded.
     not exhausted before ``CELERY_AMQP_CONNECTION_MAX_RETRIES`` is exceeded.
 
 
@@ -249,16 +270,16 @@ Task execution settings
 * CELERY_TASK_RESULT_EXPIRES
 * CELERY_TASK_RESULT_EXPIRES
     Time (in seconds, or a :class:`datetime.timedelta` object) for when after
     Time (in seconds, or a :class:`datetime.timedelta` object) for when after
     stored task tombstones are deleted.
     stored task tombstones are deleted.
-    
+
     **NOTE**: For the moment this only works for the database and MongoDB
     **NOTE**: For the moment this only works for the database and MongoDB
     backends.
     backends.
-  
+
 * CELERY_TASK_SERIALIZER
 * CELERY_TASK_SERIALIZER
     A string identifying the default serialization
     A string identifying the default serialization
     method to use. Can be ``pickle`` (default),
     method to use. Can be ``pickle`` (default),
     ``json``, ``yaml``, or any custom serialization methods that have
     ``json``, ``yaml``, or any custom serialization methods that have
     been registered with :mod:`carrot.serialization.registry`.
     been registered with :mod:`carrot.serialization.registry`.
-    
+
     Default is ``pickle``.
     Default is ``pickle``.
 
 
 Logging settings
 Logging settings
@@ -267,7 +288,7 @@ Logging settings
 * CELERYD_LOG_FILE
 * CELERYD_LOG_FILE
     The default filename the worker daemon logs messages to, can be
     The default filename the worker daemon logs messages to, can be
     overridden using the `--logfile`` option to ``celeryd``.
     overridden using the `--logfile`` option to ``celeryd``.
-    
+
     The default is to log using ``stderr`` if running in the foreground,
     The default is to log using ``stderr`` if running in the foreground,
     when running in the background, detached as a daemon, the default
     when running in the background, detached as a daemon, the default
     logfile is ``celeryd.log``.
     logfile is ``celeryd.log``.
@@ -275,7 +296,7 @@ Logging settings
 * CELERYD_DAEMON_LOG_LEVEL
 * CELERYD_DAEMON_LOG_LEVEL
     Worker log level, can be any of ``DEBUG``, ``INFO``, ``WARNING``,
     Worker log level, can be any of ``DEBUG``, ``INFO``, ``WARNING``,
     ``ERROR``, ``CRITICAL``, or ``FATAL``.
     ``ERROR``, ``CRITICAL``, or ``FATAL``.
-    
+
     See the :mod:`logging` module for more information.
     See the :mod:`logging` module for more information.
 
 
 * CELERYD_DAEMON_LOG_FORMAT
 * CELERYD_DAEMON_LOG_FORMAT