{ "info": { "author": "Miroslav Shubernetskiy", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "=====================\nCelery Redis Sentinel\n=====================\n\n.. image:: https://badge.fury.io/py/celery-redis-sentinel.svg\n :target: http://badge.fury.io/py/celery-redis-sentinel\n\n.. image:: https://travis-ci.org/dealertrack/celery-redis-sentinel.svg?branch=master\n :target: https://travis-ci.org/dealertrack/celery-redis-sentinel\n\n.. image:: https://coveralls.io/repos/dealertrack/celery-redis-sentinel/badge.svg?branch=master&service=github\n :target: https://coveralls.io/github/dealertrack/celery-redis-sentinel?branch=master\n\n\nCelery broker and results backend implementation for\n`Redis Sentinel `_\n\n* Free software: MIT license\n* GitHub: https://github.com/dealertrack/celery-redis-sentinel\n* Documentation: https://celery-redis-sentinel.readthedocs.org.\n\nWhy?\n----\n\n`Redis `_ is a pretty awesome in-memory key-value data-store.\nBeing in-memory makes it wickedly fast however at a cost of no-persistence.\nIn business-critical applications (you know, which make company money) that makes\nstand-alone redis deployment non-practical. This is where\n`Redis Sentinel `_ comes in.\nIt provides scalability and high availability to Redis 2.X\n(Redis 3.X comes with native-clustering which is different from Sentinel).\nAs a result, Redis becomes a viable solution for solving some of business needs.\nAs you can imagine from the project title, one use-case is using Redis Sentinel with\n`celery `_.\nUnfortunately celery does not support Redis Sentinel by default hence this\nlibrary which aims to provide non-official Redis Sentinel support as **both**\ncelery broker and results backend.\n\nInstalling\n----------\n\nInstallation is super easy with ``pip``::\n\n $ pip install celery-redis-sentinel\n\nUsage\n-----\n\nUsing this library is pretty simple. All you need to do is configure celery\nto use Redis Sentinel for broker and/or results backend. That is done\nwith a couple of settings::\n\n # celeryconfig.py\n BROKER_URL = 'redis-sentinel://redis-sentinel:26379/0'\n BROKER_TRANSPORT_OPTIONS = {\n 'sentinels': [('192.168.1.1', 26379),\n ('192.168.1.2', 26379),\n ('192.168.1.3', 26379)],\n 'service_name': 'master',\n 'socket_timeout': 0.1,\n }\n\n CELERY_RESULT_BACKEND = 'redis-sentinel://redis-sentinel:26379/1'\n CELERY_RESULT_BACKEND_TRANSPORT_OPTIONS = BROKER_TRANSPORT_OPTIONS\n\nSome notes about the configuration:\n\n* note the use of ``redis-sentinel`` schema within the URL for broker and results\n backend. In order to use that schema, which is not shipped with celery, where you create\n your celery application you **must** first need to register sentinel support::\n\n # tasks.py\n from celery_redis_sentinel import register\n\n # has to be called before creating celery app\n register()\n\n app = Celery('tasks')\n* hostname and port are ignored within the actual URL. Sentinel uses transport options\n ``sentinels`` setting to create a ``Sentinel()`` instead of configuration URL.\n\nScheduling During Failover\n--------------------------\n\nSome considerations while using Redis Sentinel as a celery broker. While the failover\nis in progress, no tasks can be scheduled. Trying to schedule a task will either\nraise ``Timeout`` or ``ConnectionError``. That is because other sentinel nodes\nwithin the cluster, depending on the configuration, have a timeout until they elect\na new master. During that time, trying to schedule a task will attempt to store\nit in now-invalid master node hence the exception. If that is unacceptable within\nyour application, this library comes with a small wrapper which allows to trigger\ntasks which will block the scheduling until new master will be elected::\n\n from celery_redis_sentinel.redis_sentinel import ensure_redis_call\n from tasks import add\n\n # this will blow up during failover\n add.delay(1, 2)\n # this will keep retrying until it succeeds\n ensure_redis_call(add.delay, 1, 2)\n\nAlternatively you can use a supplied abstract celery task subclass which provides\nsame retrying behavior in the task definition itself::\n\n # tasks.py\n from celery_redis_sentinel.task import EnsuredRedisTask\n\n @app.task(base=EnsuredRedisTask)\n def add(a, b):\n return a + b\n\n\n\n\nHistory\n-------\n\n0.3 (2016-05-03)\n~~~~~~~~~~~~~~~~\n\n* **New**: Addition of ``ShortLivedStrictRedis`` and ``ShortLivedSentinel``.\n Both of them use short-lived connections which disconnect from redis\n as soon as the query to redis is complete.\n* **Fixed**: All sentinel connections are now created via ``ShortLivedSentinel``.\n This fixes an issue when sentinel would reach its max connections limit\n since all celery workers would always be connected to sentinel.\n That is not necessary since sentinel is queried very rarely for the current\n master connection details.\n In addition this is useful when Redis Sentinel is used behind a firewall\n since sentinel would not notice when firewall would close the connections\n and so would not release them.\n\n0.2 (2016-01-14)\n~~~~~~~~~~~~~~~~\n\n* **New**: Added ``EnsuredRedisTask`` which allows to ensure tasks are scheduled\n via an abstract base task class in task definition rather then explicitly using\n ``ensure_redis_call`` while calling the task::\n\n @app.task(base=EnsuredRedisTask)\n def foo(): pass\n\n0.1 (2016-01-13)\n~~~~~~~~~~~~~~~~\n\n* First release\n\n\nCredits\n-------\n\nThis utility was created at `dealertrack technologies`_\n(`dealertrack GitHub`_) for our internal use so thank you\ndealertrack for allowing to contribute the utility\nto the open-source community.\n\nDevelopment Lead\n~~~~~~~~~~~~~~~~\n\n* Miroslav Shubernetskiy - https://github.com/miki725\n\nContributors\n~~~~~~~~~~~~\n\nNone yet. Why not be the first?\n\n.. _dealertrack GitHub: https://github.com/Dealertrack\n.. _dealertrack technologies: https://www.dealertrack.com\n\n\nLicense\n-------\n\nThe MIT License (MIT)\n\nCopyright \u00a9 2015-2016, dealertrack technologies\n\n::\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dealertrack/celery-redis-sentinel", "keywords": "celery redis sentinel broker results", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "celery-redis-sentinel", "package_url": "https://pypi.org/project/celery-redis-sentinel/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/celery-redis-sentinel/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/dealertrack/celery-redis-sentinel" }, "release_url": "https://pypi.org/project/celery-redis-sentinel/0.3.0/", "requires_dist": null, "requires_python": null, "summary": "Celery broker and results backend implementation for Redis Sentinel", "version": "0.3.0" }, "last_serial": 2097853, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "124cc64d29f0ac3771f65a1f466bee1c", "sha256": "ec2deac769aeee5e71c3ffd05443fc5bfb478ff4ca81f088df4c15008e874ff1" }, "downloads": -1, "filename": "celery-redis-sentinel-0.1.0.tar.gz", "has_sig": false, "md5_digest": "124cc64d29f0ac3771f65a1f466bee1c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18656, "upload_time": "2016-01-13T19:48:24", "url": "https://files.pythonhosted.org/packages/49/e1/8809534b1f3f51027d528fa84672e7a88a57a8801dbaf9ff82ed848f10eb/celery-redis-sentinel-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "207806e4987696f0230467ae44f4dcca", "sha256": "d07cf8b31caaa20d1c71e4954059c7c19f5f8666ecaae6e657d73fbc21fc7c08" }, "downloads": -1, "filename": "celery-redis-sentinel-0.2.0.tar.gz", "has_sig": false, "md5_digest": "207806e4987696f0230467ae44f4dcca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19650, "upload_time": "2016-01-15T15:49:08", "url": "https://files.pythonhosted.org/packages/f9/6b/098e918253ffdacd18d25c9f79249697b57e949e4740b543244431cefa65/celery-redis-sentinel-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "698816160d869eacabfe9e21b019208c", "sha256": "0527d74ccfc6b0183565ac54b08f0e51a9ebc135fc67cb35a6f99ffa19b392a9" }, "downloads": -1, "filename": "celery-redis-sentinel-0.3.0.tar.gz", "has_sig": false, "md5_digest": "698816160d869eacabfe9e21b019208c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21059, "upload_time": "2016-05-03T21:57:29", "url": "https://files.pythonhosted.org/packages/22/ec/53826b4b631c535d47716123ad9bfe949d699f0a6d0d6fd7928d95ae7219/celery-redis-sentinel-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "698816160d869eacabfe9e21b019208c", "sha256": "0527d74ccfc6b0183565ac54b08f0e51a9ebc135fc67cb35a6f99ffa19b392a9" }, "downloads": -1, "filename": "celery-redis-sentinel-0.3.0.tar.gz", "has_sig": false, "md5_digest": "698816160d869eacabfe9e21b019208c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21059, "upload_time": "2016-05-03T21:57:29", "url": "https://files.pythonhosted.org/packages/22/ec/53826b4b631c535d47716123ad9bfe949d699f0a6d0d6fd7928d95ae7219/celery-redis-sentinel-0.3.0.tar.gz" } ] }