{ "info": { "author": "Gavin M. Roy", "author_email": "gavinmroy@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Utilities" ], "description": "rmq-cluster-rebalance\n=====================\n\nCLI application for rebalancing queues in a RabbitMQ cluster\n\n|Version| |Status| |Coverage| |License|\n\nInstallation\n------------\n\n.. code-block:: bash\n\n pip install rmq-cluster-rebalance\n\nWhy?\n----\nWhen you specify the `queue master location`_ in RabbitMQ\nwith value of ``min-masters``, RabbitMQ will attempt to balance the distribution\nof the master locations for queues across the cluster. However, when you restart\na RabbitMQ node in a cluster with HA queues, the master location for a queue on that\nnode will move to a different node. Given enough such events and depending on your HA\npolicies, you can end up with an uneven distribution of queues with a master location\non a minority of nodes. In this scenario, the nodes in cluster may not be utilized\nas evenly, with higher CPU, memory, disk, and network utilization on nodes that\ncarry the larger quantity of master nodes.\n\nRebalancing queues across nodes can also be useful when adding nodes to a cluster\nwith no ``queue_master_locator`` configuration set (which uses the default value of\n``client-local``), regardless of whether you use HA queues or not.\n\nMethodology\n-----------\nThe application use the RabbitMQ management UI to iterate through each queue\nin the cluster. The queue is inspected and a policy named ``rmq-cluster-rebalance``\nis created using the existing policy configuration used by the queue with the\naddition or replacement of ``ha-mode``, setting it to ``all`` and removing ``ha-params``\nand ``queue-master-locator`` if they are set. Once the queue has fully replicated\nacross all nodes in the cluster, the ``rmq-cluster-rebalance`` policy is replaced\nwith a new policy that setting ``ha-mode`` to ``nodes`` and specifying only the\nnew master node in ``ha-params``. When the queue has fully moved, the policy will\nthen removed and the application will move on to the next queue.\n\nNodes are assigned in a simple round-robin ordering. If a queue is already living\non the node where it would be assigned to, it will be skipped and no work is\nperformed on that queue.\n\nWarning\n-------\nThis approach should be safe for production use without interruption of publishers\nor consumers. While it has worked for me without issue, your mileage may vary.\n\nThis application requires a relatively current version of RabbitMQ and was only\ntested with ``3.7.16``.\n\nCLI Usage\n---------\n\n.. code-block::\n\n usage: rmq-cluster-rebalance [-h] [-u USERNAME] [-p PASSWORD] [--vhost VHOST]\n [-L LOG_FILE] [-v] [--debug] [--version]\n [URL]\n\n Rebalances the queues in a RabbitMQ cluster\n\n positional arguments:\n URL The RabbitMQ Management API base URL (default:\n http://localhost:15672)\n\n optional arguments:\n -h, --help show this help message and exit\n -u USERNAME, --username USERNAME\n The RabbitMQ Management API username (default: guest)\n -p PASSWORD, --password PASSWORD\n The RabbitMQ Management API password (default: guest)\n --vhost VHOST The RabbitMQ VHost to use (default: /)\n --version output version information, then exit\n\n Logging options:\n -L LOG_FILE, --log-file LOG_FILE\n Log to the specified filename (default: STDOUT)\n -v, --verbose Increase output verbosity (default: False)\n --debug Extra verbose debug logging (default: False)\n\n\n.. _queue master location: https://www.rabbitmq.com/ha.html#master-migration-data-locality\n\n.. |Version| image:: https://img.shields.io/pypi/v/rmq-cluster-rebalance.svg?\n :target: https://pypi.python.org/pypi/rmq-cluster-rebalance\n :alt: Package Version\n\n.. |Status| image:: https://img.shields.io/circleci/build/gh/gmr/rmq-cluster-rebalance/master.svg?token=0865efa9d8c942005bda4e68caaca26eb13acaf5\n :target: https://circleci.com/gh/gmr/rmq-cluster-rebalance/tree/master\n :alt: Build Status\n\n.. |Coverage| image:: https://codecov.io/gh/gmr/rmq-cluster-rebalance/branch/master/graph/badge.svg\n :target: https://codecov.io/github/gmr/rmq-cluster-rebalance?branch=master\n :alt: Code Coverage\n\n.. |License| image:: https://img.shields.io/pypi/l/rmq-cluster-rebalance.svg?\n :target: https://github.com/gmr/rmq-cluster-rebalance/blob/master/LICENSE\n :alt: BSD", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/gmr/rmq_cluster_rebalance", "keywords": "", "license": "BSD 3-Clause License", "maintainer": "", "maintainer_email": "", "name": "rmq-cluster-rebalance", "package_url": "https://pypi.org/project/rmq-cluster-rebalance/", "platform": "", "project_url": "https://pypi.org/project/rmq-cluster-rebalance/", "project_urls": { "Homepage": "https://github.com/gmr/rmq_cluster_rebalance" }, "release_url": "https://pypi.org/project/rmq-cluster-rebalance/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "A Postgres SQL Formatter", "version": "1.0.0" }, "last_serial": 5520175, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "c268f2213889196d429de7a0d2b028ba", "sha256": "fabe3e65fe0826077e597ab67a2bb5aa7b2c1899dd7f89cd68f094893624ca24" }, "downloads": -1, "filename": "rmq-cluster-rebalance-1.0.0.tar.gz", "has_sig": false, "md5_digest": "c268f2213889196d429de7a0d2b028ba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7563, "upload_time": "2019-07-11T20:53:57", "url": "https://files.pythonhosted.org/packages/5a/88/0344a86d5c7b922503ab8098d8ad12ab70997c2d4fce2105753085dbd033/rmq-cluster-rebalance-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c268f2213889196d429de7a0d2b028ba", "sha256": "fabe3e65fe0826077e597ab67a2bb5aa7b2c1899dd7f89cd68f094893624ca24" }, "downloads": -1, "filename": "rmq-cluster-rebalance-1.0.0.tar.gz", "has_sig": false, "md5_digest": "c268f2213889196d429de7a0d2b028ba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7563, "upload_time": "2019-07-11T20:53:57", "url": "https://files.pythonhosted.org/packages/5a/88/0344a86d5c7b922503ab8098d8ad12ab70997c2d4fce2105753085dbd033/rmq-cluster-rebalance-1.0.0.tar.gz" } ] }