{ "info": { "author": "Sidnei da Silva", "author_email": "sidnei at enfoldsystems dot com", "bugtrack_url": null, "classifiers": [ "Framework :: Buildout", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": ".. contents::\n\n- Code repository: http://svn.plone.org/svn/collective/buildout/collective.buildout.cluster\n- Questions and comments to plone-developers [at] lists.sourceforge.net\n- Report bugs at https://bugs.launchpad.net/collective.buildout.cluster\n\n\nDetailed Documentation\n**********************\n\nExample usage\n=============\n\nWe'll start by creating a buildout that contains a base ZEO Client, a\n'cluster' ZEO Client and two ZEO Servers::\n\n >>> write('buildout.cfg',\n ... r\"\"\"\n ... [buildout]\n ... parts = \n ... instance-1\n ... instance-2\n ... server-1\n ... server-2\n ...\n ... [instance-1]\n ... http-address = 8080\n ... recipe = plone.recipe.zope2instance\n ... zeo-address = 8100\n ... zeo-client = on\n ...\n ... [instance-2]\n ... recipe = collective.recipe.zope2cluster\n ... http-address = 8081\n ... instance-clone = instance-1\n ... \n ... [server-1]\n ... recipe = plone.recipe.zope2zeoserver\n ... zeo-address = 8100\n ... \n ... [server-2]\n ... recipe = plone.recipe.zope2zeoserver\n ... zeo-address = 8101\n ... \"\"\")\n\n >>> write('.installed.cfg',\n ... r\"\"\"\n ... [instance-1]\n ... bin-directory = C:\\src\\server-buildout\\5.0\\bin\n ... http-address = 8080\n ... location = C:\\src\\server-buildout\\5.0\\parts\\instance-1\n ... recipe = plone.recipe.zope2instance\n ... zeo-address = 8100\n ... zeo-client = on\n ... zope2-location = C:\\src\\server-buildout\\5.0\\parts\\zope2\n ...\n ... [instance-2]\n ... http-address = 8081\n ... location = C:\\src\\server-buildout\\5.0\\parts\\instance-2\n ... recipe = collective.recipe.zope2cluster\n ... instance-clone = instance-1\n ... zope2-location = C:\\src\\server-buildout\\5.0\\parts\\zope2\n ... \n ... [server-1]\n ... location = C:\\src\\server-buildout\\5.0\\parts\\server-1\n ... bin-directory = C:\\src\\server-buildout\\5.0\\bin\n ... recipe = plone.recipe.zope2zeoserver\n ... zeo-address = 8100\n ... zope2-location = C:\\src\\server-buildout\\5.0\\parts\\zope2\n ... \n ... [server-2]\n ... location = C:\\src\\server-buildout\\5.0\\parts\\server-2\n ... bin-directory = C:\\src\\server-buildout\\5.0\\bin\n ... recipe = plone.recipe.zope2zeoserver\n ... zeo-address = 8101\n ... zope2-location = C:\\src\\server-buildout\\5.0\\parts\\zope2\n ... \"\"\")\n\nReading the cluster configuration from those files should list two\nservers and two client instances::\n\n >>> import os\n >>> from collective.buildout.cluster.cluster import Cluster\n\n >>> cluster = Cluster(os.getcwd(), 'buildout.cfg', '.installed.cfg')\n cwd: ...\n\n >>> for server in cluster.getServers():\n ... print server.getInstanceName()\n ... print server.getInstanceCtl()\n ... print server.getPort('zeo')\n ... print\n server-1\n C:\\src\\server-buildout\\5.0\\bin\\server-1\n 8100\n \n server-2\n C:\\src\\server-buildout\\5.0\\bin\\server-2\n 8101\n \n\n >>> for client in cluster.getClients():\n ... print client.getInstanceName()\n ... print client.getInstanceCtl()\n ... print client.getPort('http')\n ... print\n instance-1\n C:\\src\\server-buildout\\5.0\\bin\\instance-1\n 8080\n \n instance-2\n C:\\src\\server-buildout\\5.0\\bin\\instance-2\n 8081\n \n\nNow, let's add a third client and make sure the ``buildout.cfg`` file\nwas changed accordingly::\n\n >>> settings = {'instance-clone': 'instance-1',\n ... 'http-address': '8082'}\n\n >>> client = cluster.addNewClient('instance-3', settings=settings)\n\n >>> cat('buildout.cfg')\n \n ...\n parts =\n instance-1\n instance-2\n instance-3\n server-1\n ...\n [instance-3]\n recipe = collective.recipe.zope2cluster\n http-address = 8082\n instance-clone = instance-1\n\n >>> client['http-address']\n '8082'\n\n >>> client['instance-clone']\n 'instance-1'\n\n >>> client['name']\n 'instance-3'\n\nTrying to add another client by the same name should fail::\n\n >>> cluster.addNewClient('instance-3', settings=settings)\n Traceback (most recent call last):\n ...\n ValueError: A section named 'instance-3' already exists!\n\nChanging a port number, or even enabling a port should be possible::\n\n >>> i2 = cluster.getClient('instance-2')\n >>> i2.setPort('http', '8091')\n\n >>> i2['http-address']\n '8091'\n\n >>> i2.setPort('webdav', '8092')\n\n >>> i2['webdav-address']\n '8092'\n\n >>> cat('buildout.cfg')\n \n ...\n [instance-2]\n recipe = collective.recipe.zope2cluster\n http-address = 8091\n instance-clone = instance-1\n webdav-address = 8092\n ...\n\nSo should disabling a port (by setting it to ``None``)::\n\n >>> i2.setPort('webdav', None)\n\n >>> cat('buildout.cfg')\n \n ...\n [instance-2]\n recipe = collective.recipe.zope2cluster\n http-address = 8091\n instance-clone = instance-1\n ...\n\n >>> i2['webdav-address']\n Traceback (most recent call last):\n ...\n KeyError: 'webdav-address'\n\nFinally, deleting a client should be possible as well::\n\n >>> for client in cluster.getClients():\n ... print client.getInstanceName()\n instance-1\n instance-2\n instance-3\n\n >>> cluster.removeClient('instance-3')\n\n >>> cat('buildout.cfg')\n \n ...\n parts =\n instance-1\n instance-2\n server-1\n ...\n\n >>> for client in cluster.getClients():\n ... print client.getInstanceName()\n instance-1\n instance-2\n\nContributors\n************\n\nSidnei da Silva, Author\n\n\nChange history\n**************\n\n0.6 (2010-07-30)\n================\n\n- Service name of the Windows service now consistent with the inner function\n get_service_name() in Zope2.Startup.zopectl.ZopeCmd.do_start(),\n that is \"Zope19906508\" instead of \"Zope_19906508\".\n [kleist]\n\n- The Windows Service no longer starts Zope in debug mode.\n [kleist]\n\n0.5 (2010-04-05)\n================\n\n- Fix silly typo.\n\n0.4 (2010-04-05)\n================\n\n- Support for latest zope2instance recipe, which doesn't install\n zopeservice.py anymore. [sidnei]\n\n0.3 (2009-07-11)\n================\n\n- Implemented support for selecting startup type on Windows (available\n options are \"manual\" or \"auto\") [sidnei]\n\n0.2 (2009-04-03)\n================\n\n- Implemented support for install/remove/start/stop of all possible\n services found in a configuration file, specially for Windows. [sidnei]\n\n0.1 (2009-03-04)\n================\n \n - Implemented support for reading cluster configuration from a\n buildout.cfg [sidnei]\n\n - Implemented support for starting/stopping instances [sidnei]\n\n - Implemented support for creating new instances [sidnei]\n\n - Created recipe with ZopeSkel [sidnei]\n\nDownload\n********", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": "buildout cluster management introspection configuration", "license": "LGPL", "maintainer": null, "maintainer_email": null, "name": "collective.buildout.cluster", "package_url": "https://pypi.org/project/collective.buildout.cluster/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/collective.buildout.cluster/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/collective.buildout.cluster/0.6/", "requires_dist": null, "requires_python": null, "summary": "A package to introspect and manage a buildout-based cluster configuration in an object-oriented way", "version": "0.6" }, "last_serial": 787671, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "bb40db31bf866c17259e9009f604c543", "sha256": "9ab62f7967eb4c99b8cadf3546e824b56b9a5856db89c0b8e057ae6e38852bf2" }, "downloads": -1, "filename": "collective.buildout.cluster-0.1.tar.gz", "has_sig": false, "md5_digest": "bb40db31bf866c17259e9009f604c543", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12098, "upload_time": "2009-03-04T18:00:15", "url": "https://files.pythonhosted.org/packages/b0/13/dc22c45caa1131711e90f6b939c5f59b81379e15457f141d0fde0cba9400/collective.buildout.cluster-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "a54e2295770da2b65693db55db08f6a8", "sha256": "ee4bf86721bfa0d080e3f66b4da79cd445c19c194b83d3cf9696a1fdb2993c07" }, "downloads": -1, "filename": "collective.buildout.cluster-0.2-py2.4.egg", "has_sig": false, "md5_digest": "a54e2295770da2b65693db55db08f6a8", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 31531, "upload_time": "2009-04-03T17:12:54", "url": "https://files.pythonhosted.org/packages/8e/17/9815a7ed86136306c9dbb70d09f369bc57ec130744ab20eebfb31a03819a/collective.buildout.cluster-0.2-py2.4.egg" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "cbe30d6c0396fd86a38f6d1489509cd4", "sha256": "d57e6aae7ee39bbae8e0fd425b388f2af0826a6bc3182a97c69be58f7678a61d" }, "downloads": -1, "filename": "collective.buildout.cluster-0.3.tar.gz", "has_sig": false, "md5_digest": "cbe30d6c0396fd86a38f6d1489509cd4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13354, "upload_time": "2009-07-11T05:30:57", "url": "https://files.pythonhosted.org/packages/5d/e3/cd63eae566c9e6d737b667fdb83e6c6a4510e95f9b0525ab86a1a731995e/collective.buildout.cluster-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "8e369b4e67e7011caadb8e7a6b2b6cd5", "sha256": "ea8d1dc5b6c510062b516826c3910bfa9cde5394a29892e6a8e4ba65d8c25912" }, "downloads": -1, "filename": "collective.buildout.cluster-0.4.zip", "has_sig": false, "md5_digest": "8e369b4e67e7011caadb8e7a6b2b6cd5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23570, "upload_time": "2010-04-05T20:15:27", "url": "https://files.pythonhosted.org/packages/94/36/cff4c92bc8a3958f874b4a855e864bf9c283958278a41358de9b8b36b982/collective.buildout.cluster-0.4.zip" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "d9e78f9b1265f994b0b1f63f79124431", "sha256": "40fd547315883821d70f162d1c0ff65a7e0df4d0e182284c190953135e2045af" }, "downloads": -1, "filename": "collective.buildout.cluster-0.5.zip", "has_sig": false, "md5_digest": "d9e78f9b1265f994b0b1f63f79124431", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23620, "upload_time": "2010-04-05T20:51:59", "url": "https://files.pythonhosted.org/packages/fe/17/28ad1221aa40339f3259e6e261d3918655d020afa0b478f17dd4b8f1dbf1/collective.buildout.cluster-0.5.zip" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "0fd4d7e0df84de8ba63a906a5de08004", "sha256": "b85fd10ee611accebb71e316262741b7f4fe893fde00bae5249d32382c3cdc64" }, "downloads": -1, "filename": "collective.buildout.cluster-0.6.tar.gz", "has_sig": false, "md5_digest": "0fd4d7e0df84de8ba63a906a5de08004", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14467, "upload_time": "2010-07-31T04:20:04", "url": "https://files.pythonhosted.org/packages/07/c2/36aea9d997dc34399c07f1f8e2355d4c9a72d726c68b87e843e600a7ee92/collective.buildout.cluster-0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0fd4d7e0df84de8ba63a906a5de08004", "sha256": "b85fd10ee611accebb71e316262741b7f4fe893fde00bae5249d32382c3cdc64" }, "downloads": -1, "filename": "collective.buildout.cluster-0.6.tar.gz", "has_sig": false, "md5_digest": "0fd4d7e0df84de8ba63a906a5de08004", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14467, "upload_time": "2010-07-31T04:20:04", "url": "https://files.pythonhosted.org/packages/07/c2/36aea9d997dc34399c07f1f8e2355d4c9a72d726c68b87e843e600a7ee92/collective.buildout.cluster-0.6.tar.gz" } ] }