{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# couchdb-cluster-admin\nutility for managing multi-node couchdb 2.x clusters\n\n# First, put together a config file for your setup\n\nThis will make the rest of the commands simpler to run. Copy the example\n\n```\ncp config/conf.example.yml config/mycluster.yml\n```\n\nand then edit it with the details of your cluster.\n\n# Setting up a local cluster to test on\n\nIf you have docker installed you can just run\n\n```bash\ndocker build -t couchdb-cluster - < docker-couchdb-cluster/Dockerfile\n```\n\nto build the cluster image (based on klaemo/couchdb:2.0-dev) and then run\n\n```bash\ndocker run --name couchdb-cluster \\\n -p 15984:15984 \\\n -p 15986:15986 \\\n -p 25984:25984 \\\n -p 25986:25986 \\\n -p 35984:35984 \\\n -p 35986:35986 \\\n -p 45984:45984 \\\n -p 45986:45986 \\\n -v $(pwd)/data:/usr/src/couchdb/dev/lib/ \\\n -t couchdb-cluster \\\n --with-admin-party-please \\\n -n 4\n```\n\nto start a cluster with 4 nodes. The nodes' data will be persisted to `./data`.\n\nTo run the tests (which require this docker setup), download and install https://github.com/sstephenson/bats\n\n```bash\ngit clone https://github.com/sstephenson/bats.git\ncd bats\n./install.sh /usr/local # or wherever on your PATH you want to install this\n```\n\nand then\n\n```bash\ndocker start couchdb-cluster # make sure this is running and localhost:15984 is receiving pings\nbats test/\n```\n\n# Optional: Set password in environment\n\nIf you do not wish to specify your password every time you run a command,\nyou may put its value in the `COUCHDB_CLUSTER_ADMIN_PASSWORD` environment variable like so:\n\n```\nread -sp Password: PW\n```\n\nThen, for all commands below prefex the command with `COUCHDB_CLUSTER_ADMIN_PASSWORD=$PW`, e.g.\n\n```\nCOUCHDB_CLUSTER_ADMIN_PASSWORD=$PW python couchdb-admin-cluster/describe.py --conf mycluster.yml\n```\n\n# Get a quick overview of your cluster\n\nNow you can run\n\n```\npython couchdb_cluster_admin/describe.py --conf config/mycluster.yml\n```\n\nto see an overview of your cluster nodes and shard allocation.\nFor example, in the following output:\n\n```\nMembership\n\tcluster_nodes:\tcouch3\tcouch1\tcouch4\tcouch2\n\tall_nodes:\tcouch3\tcouch1\tcouch4\tcouch2\nShards\n\t 00000000-1fffffff 20000000-3fffffff 40000000-5fffffff 60000000-7fffffff 80000000-9fffffff a0000000-bfffffff c0000000-dfffffff e0000000-ffffffff\n\tmydb couch1 couch1 couch1 couch1 couch1 couch1 couch1 couch1\n\tmy_second_database couch1 couch1 couch1 couch1 couch1 couch1 couch1 couch1\n```\n\nyou can see that while there are four nodes,\nall shards are currently assigned only to the first node.\n\n# Help estimating shard allocation\n\nIn order to plan out a shard reallocation, you can run the following command:\n\n```bash\npython couchdb_cluster_admin/suggest_shard_allocation.py --conf config/mycluster.yml --allocate couch1:1 couch2,couch3,couch4:2\n```\n\nThe values for the `--allocate` arg in the example above should be interpreted as\n\"Put 1 copy on couch1, and put 2 copies spread across couch2, couch3, and couch4\".\n\nThe output looks like this:\n\n```\ncouch1\t57.57 GB\ncouch2\t42.15 GB\ncouch3\t36.5 GB\ncouch4\t36.5 GB\n 00000000-1fffffff 20000000-3fffffff 40000000-5fffffff 60000000-7fffffff 80000000-9fffffff a0000000-bfffffff c0000000-dfffffff e0000000-ffffffff\nmydb couch1,couch2,couch4 couch1,couch2,couch3 couch1,couch3,couch4 couch1,couch2,couch4 couch1,couch2,couch3 couch1,couch3,couch4 couch1,couch2,couch4 couch1,couch2,couch3\nmy_second_database couch1,couch3,couch4 couch1,couch3,couch4 couch1,couch3,couch4 couch1,couch3,couch4 couch1,couch3,couch4 couch1,couch3,couch4 couch1,couch3,couch4 couch1,couch3,couch4\n```\n\nNote, the reallocation does not take into account the current location of shards,\nso it is much more useful in the situation that you're moving from a single-node cluster\nto a multi-node cluster than it is in the situation where you're adding one more node to a multi-node cluster.\nIn the example above, couch1 would be the single-node cluster and couch2, couch3, and couch4\nform are the multi-node cluster\u2013to-be. You can imagine that after implementing\nthe shard allocation suggested here, we might remove all shards from couch1 and remove it from the cluster.\n\nNote also that there is no guarantee that the \"same\" shard of different databases will go to the same node;\neach (db, shard)-pair is treated as an independent unit when making computing an even shard allocation.\nIn this example there are only a few dbs and shards; when shards * dbs is high,\nthis process can be quite good at evenly balancing your data across nodes.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dimagi/couchdb-cluster-admin", "keywords": "", "license": "BSD License", "maintainer": "Dimagi", "maintainer_email": "dev@dimagi.com", "name": "couchdb-cluster-admin", "package_url": "https://pypi.org/project/couchdb-cluster-admin/", "platform": "", "project_url": "https://pypi.org/project/couchdb-cluster-admin/", "project_urls": { "Homepage": "https://github.com/dimagi/couchdb-cluster-admin" }, "release_url": "https://pypi.org/project/couchdb-cluster-admin/0.5.0/", "requires_dist": [ "argparse (>=1.4)", "gevent", "jsonobject (>=0.8.0)", "PyYAML", "requests", "dimagi-memoized" ], "requires_python": "", "summary": "Utility for managing multi-node couchdb 2.x clusters", "version": "0.5.0" }, "last_serial": 5279444, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "e72067979979a7f359633483e78759e7", "sha256": "4a0613c7cfd458cd61cb24897e4b09ebedade186474e314b2e03075615115d62" }, "downloads": -1, "filename": "couchdb-cluster-admin-0.1.0.tar.gz", "has_sig": false, "md5_digest": "e72067979979a7f359633483e78759e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14610, "upload_time": "2018-04-15T07:59:22", "url": "https://files.pythonhosted.org/packages/bd/54/59ff62cd7c2ee9c5a3a17d7300b54f0c3b285b551e32685e52ee26422b9a/couchdb-cluster-admin-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "07963c23582c7d6a1296504e0651807d", "sha256": "7580c70661abc979a35c5a8500e6f9350e6a06dad59b0455df6ddd28c97ff6e1" }, "downloads": -1, "filename": "couchdb-cluster-admin-0.2.0.tar.gz", "has_sig": false, "md5_digest": "07963c23582c7d6a1296504e0651807d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14856, "upload_time": "2018-04-17T08:16:12", "url": "https://files.pythonhosted.org/packages/11/af/ad6bb6975c6ac86f66c23363838853c937f62457adedb76121916f7d90a2/couchdb-cluster-admin-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "e2e7e77bbc0c8197322f3335d6c363fc", "sha256": "552bbf80001278794d1f526fceb2db25c055d8a6df6ad34044b2e79d8f3aadda" }, "downloads": -1, "filename": "couchdb-cluster-admin-0.2.1.tar.gz", "has_sig": false, "md5_digest": "e2e7e77bbc0c8197322f3335d6c363fc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14850, "upload_time": "2018-04-17T08:39:02", "url": "https://files.pythonhosted.org/packages/d7/f9/98f9f7849769219b5c07f91c1de8b750a62b84eb3a57336a8c72af23012d/couchdb-cluster-admin-0.2.1.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "7f981890b5cd9ef578093ee0800b87e8", "sha256": "083c1dc844524f459bb10a104fde5c4ca2fd6868e749288c449e2a4ca01dc4bd" }, "downloads": -1, "filename": "couchdb-cluster-admin-0.4.0.tar.gz", "has_sig": false, "md5_digest": "7f981890b5cd9ef578093ee0800b87e8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15510, "upload_time": "2018-05-29T10:32:14", "url": "https://files.pythonhosted.org/packages/9e/d1/5902bf3874a310506322b1ea3a18536c6b58f387678845d8840509b5341b/couchdb-cluster-admin-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "95a800529a83aa5a5555da6cfa3b4881", "sha256": "fa6cc629df804ad7bd02d0926f4ca5be2470b6a979044dd30db448ca059c1bf8" }, "downloads": -1, "filename": "couchdb-cluster-admin-0.4.1.tar.gz", "has_sig": false, "md5_digest": "95a800529a83aa5a5555da6cfa3b4881", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15566, "upload_time": "2018-05-29T11:16:10", "url": "https://files.pythonhosted.org/packages/f8/bd/6d927dce448d087c8ae83b60a72a71d40074eeb3003b6b7e37d06510bc92/couchdb-cluster-admin-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "f493082451fafe3649582b2a01396671", "sha256": "41e75e953d408bcb3a9012ece1d7f42e4eae25dbeadbdf6f2f8a60eea6f87d3e" }, "downloads": -1, "filename": "couchdb_cluster_admin-0.4.2-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "f493082451fafe3649582b2a01396671", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17857, "upload_time": "2018-06-27T23:01:00", "url": "https://files.pythonhosted.org/packages/80/df/7f8889783759afb0783b1d5adbc6aaefee44892021c7cc03e3dcc58f10da/couchdb_cluster_admin-0.4.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "989802d356a77b6c6d75f1a07695b0c9", "sha256": "db7e96e5921b08a98e3b9680dad889ab2e32d32f0387ab37b6158e81bfd9290a" }, "downloads": -1, "filename": "couchdb-cluster-admin-0.4.2.tar.gz", "has_sig": true, "md5_digest": "989802d356a77b6c6d75f1a07695b0c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13542, "upload_time": "2018-06-27T23:01:03", "url": "https://files.pythonhosted.org/packages/b9/bc/47422a2f52b26048d6dc2dd3df628a422e33f9d511a8b1bdc1d78b0fe7b3/couchdb-cluster-admin-0.4.2.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "6880acb3ea9518ddf257720cfbde4382", "sha256": "24bbd099a5ec53ebc69aba320d1da42eb9ed3a8ef79847e0acccc04a792a1af3" }, "downloads": -1, "filename": "couchdb_cluster_admin-0.5.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "6880acb3ea9518ddf257720cfbde4382", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 20678, "upload_time": "2019-05-16T21:53:18", "url": "https://files.pythonhosted.org/packages/36/8c/82ec4283f714229928ccf5d1c9c2d734fe50e6ca9129289ff3a8db6e9820/couchdb_cluster_admin-0.5.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5dee128bcd4af0d91863648cb6b6808c", "sha256": "607ebd657f482c45adc45822c2d8db606418e50c66569d24ff756799fe00fcbe" }, "downloads": -1, "filename": "couchdb-cluster-admin-0.5.0.tar.gz", "has_sig": true, "md5_digest": "5dee128bcd4af0d91863648cb6b6808c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17295, "upload_time": "2019-05-16T21:53:20", "url": "https://files.pythonhosted.org/packages/db/a0/6b5f4939fb711f0141e2073af9dcd7eba1f142a507d2bb959544b1936269/couchdb-cluster-admin-0.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6880acb3ea9518ddf257720cfbde4382", "sha256": "24bbd099a5ec53ebc69aba320d1da42eb9ed3a8ef79847e0acccc04a792a1af3" }, "downloads": -1, "filename": "couchdb_cluster_admin-0.5.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "6880acb3ea9518ddf257720cfbde4382", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 20678, "upload_time": "2019-05-16T21:53:18", "url": "https://files.pythonhosted.org/packages/36/8c/82ec4283f714229928ccf5d1c9c2d734fe50e6ca9129289ff3a8db6e9820/couchdb_cluster_admin-0.5.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5dee128bcd4af0d91863648cb6b6808c", "sha256": "607ebd657f482c45adc45822c2d8db606418e50c66569d24ff756799fe00fcbe" }, "downloads": -1, "filename": "couchdb-cluster-admin-0.5.0.tar.gz", "has_sig": true, "md5_digest": "5dee128bcd4af0d91863648cb6b6808c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17295, "upload_time": "2019-05-16T21:53:20", "url": "https://files.pythonhosted.org/packages/db/a0/6b5f4939fb711f0141e2073af9dcd7eba1f142a507d2bb959544b1936269/couchdb-cluster-admin-0.5.0.tar.gz" } ] }