{"id":15331301,"url":"https://github.com/wohali/couchdb-cookbook","last_synced_at":"2025-04-15T03:00:22.024Z","repository":{"id":2725869,"uuid":"3720795","full_name":"wohali/couchdb-cookbook","owner":"wohali","description":"Development repository for Chef Cookbook couchdb","archived":false,"fork":false,"pushed_at":"2020-10-13T15:05:12.000Z","size":188,"stargazers_count":37,"open_issues_count":4,"forks_count":46,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-28T14:43:09.737Z","etag":null,"topics":["chef-cookbook","cookbooks","couchdb","couchdb-configuration","couchdb-cookbook","couchdb-service"],"latest_commit_sha":null,"homepage":"https://supermarket.chef.io/cookbooks/couchdb","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wohali.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-14T18:28:53.000Z","updated_at":"2023-10-28T09:11:38.000Z","dependencies_parsed_at":"2022-09-10T00:31:31.158Z","dependency_job_id":null,"html_url":"https://github.com/wohali/couchdb-cookbook","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wohali%2Fcouchdb-cookbook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wohali%2Fcouchdb-cookbook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wohali%2Fcouchdb-cookbook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wohali%2Fcouchdb-cookbook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wohali","download_url":"https://codeload.github.com/wohali/couchdb-cookbook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248997095,"owners_count":21195798,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chef-cookbook","cookbooks","couchdb","couchdb-configuration","couchdb-cookbook","couchdb-service"],"created_at":"2024-10-01T09:55:13.591Z","updated_at":"2025-04-15T03:00:21.993Z","avatar_url":"https://github.com/wohali.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Description\n\n[![Build Status](https://travis-ci.org/wohali/couchdb-cookbook.svg?branch=master)](https://travis-ci.org/wohali/couchdb-cookbook)\n\nThe CouchDB Cookbook is a library cookbook that provides custom resources for\nuse in recipes, designed to install and configure Apache CouchDB 2.x from\nsource, optionally enabling full-text search capabilities.\n\nIt includes reference examples illustrating how to install and configure a\nstandalone CouchDB server, or a full cluster of joined CouchDB server nodes.\n\n# Platform Support\n\nThe following platforms have been tested with Test Kitchen:\n\n* CentOS 7.3\n* Debian 7.11 (wheezy), 8.7 (jessie)\n* Ubuntu 14.04 (trusty), 16.04 (xenial)\n\nPartial support is provided for the following platforms:\n\n* Debian 9.x (stretch) - search not yet supported\n* Ubuntu 17.10 (artful) - search not yet supported\n\nPull requests to add support for other platforms are most welcome.\n\n*NOTE*: This recipe cannot automatically install JDK 6 for Debian 8 and\nUbuntu 16. Please ensure this prerequisite is managed by roles preceeding\nthis one for your nodes if you wish to enable fulltext search ability.\n\n# Examples\n\nThe test cookbooks under `test/cookbooks/couchdb-wrapper-test/recipes/` include\nworked examples of how to include the CouchDB resources in your own cookbooks.\nHere are a few excerpts.\n\n## Standalone (single-node) CouchDB\n\nFor a single CouchDB server, use the `couchdb_node` resource once:\n\n```ruby\ncouchdb_node 'couchdb' do\n  admin_username 'admin'\n  admin_password 'password'\n  type 'standalone'\nend\n```\n\nThe `fulltext true` attribute can be added to enable full-text search\nfunctionality.\n\n## Clustered CouchDB nodes\n\nAll nodes in the cluster must have the same `uuid`, `cookie`, `admin_username`\nand `admin_password`.\n\nIt is recommended to pre-generate the UUID and place it in\nyour cookbook. The following one-liner will generate a CouchDB UUID:\n\n```bash\npython -c \"import uuid;print(uuid.uuid4().hex)\"\n```\n\nFurther, if you want session cookies from one node to work on another (for\ninstance, when putting a load balancer in front of CouchDB) the _hashed_ admin\npassword must match on every machine as well. There are many ways to\npre-generate a hashed password. One way is by downloading and extracting\nCouchDB's source code, changing into the `dev/` directory, and running the\nfollowing one-liner, replacing `MYPASSWORD` with your desired password:\n\n```bash\nsudo pip install simple-pbkdf2\npython -c 'import uuid;from pbkdf2 import pbkdf2_hex;password=\"MYPASSWORD\";salt=uuid.uuid4().hex;iterations=10;print(\"-pbkdf2-{},{},{}\".format(pbkdf2_hex(password,salt,iterations,20),salt,iterations))'\n```\n\nPlace this hashed password in your recipe, cookbook, data bag, encrypted data\nbag, vault, etc.\n\nFor each machine to run a CouchDB clustered node, use a block of the form:\n\n```ruby\nuuid = \u003cuuid_goes_here\u003e\n\ncouchdb_node 'couchdb' do\n  type 'clustered'\n  uuid uuid\n  cookie 'henriettapussycat'\n  admin_username 'admin'\n  admin_password 'password'\nend\n```\n\nA _single node_ in the cluster must also include the `couchdb_setup_cluster`\nresource. *DO NOT run this resource on all nodes in the cluster.*\n\nThe `couchdb_setup_cluster` resource uses Chef Search to determine which nodes\nto include in the cluster. By default, it searches for nodes with the role\nspecified in the `role` attribute. If desired, the search string can be\ncompletely overridden with the `search_string` attribute.\n\nAdditionally, the number of nodes expected to be retrieved from Chef Search must\nbe specified in the `num_nodes` attribute. This prevents prematurely finalising\ncluster setup before all nodes have been converged by Chef.\n\nThis example joins exactly 3 nodes with the role `my_couchdb_role` into a\ncluster:\n\n```ruby\ncouchdb_setup_cluster 'doit' do\n  admin_username 'admin'\n  admin_password 'password'\n  role 'my_couchdb_role'\n  num_nodes 3\nend\n```\n\n## Development \"3-in-1\" server\n\nFor development purposes, it is often useful to run a 3-node cluster on a single\nmachine to ensure that applications correctly respond to cluster-like CouchDB\nbehaviour. The recipe\n`test/cookbooks/couchdb-wrapper-test/recipes/three-nodes-from-source.rb` is a\nfull example of how this can be done, and is used by Test Kitchen in the\nverification of this cookbook.\n\n# Requirements\n\n* Chef 12 or higher\n* Network-accessible package repositories\n* EPEL repositories on RHEL platforms\n\n## Platform:\n\n* ubuntu (\u003e= 14.04)\n* debian (\u003e= 7.0)\n* amazon (\u003e= 7.0)\n* centos (\u003e= 7.0)\n* oracle (\u003e= 7.0)\n* redhat (\u003e= 7.0)\n* scientific (\u003e= 7.0)\n* zlinux (\u003e= 7.0)\n\n## Cookbooks:\n\n* build-essential\n* compat_resource\n* erlang\n* poise-python\n* yum-epel\n* java\n* maven\n\n# Attributes\n\n* `node['couch_db']['src_version']` - Apache CouchDB version to download. Defaults to `2.1.1`.\n* `node['couch_db']['src_mirror']` - Apache CouchDB download link. Defaults to `https://archive.apache.org/dist/couchdb/source/#{node['couch_db']['src_version']}/apache-couchdb-#{node['couch_db']['src_version']}.tar.gz`.\n* `node['couch_db']['src_checksum']` - sha256 checksum of Apache CouchDB tarball. Defaults to `d5f255abc871ac44f30517e68c7b30d1503ec0f6453267d641e00452c04e7bcc`.\n* `node['couch_db']['install_erlang']` - Whether CouchDB installation will install Erlang or not. Defaults to `true`.\n* `node['couch_db']['configure_flags']` - CouchDB configure options. Defaults to `-c`.\n* `node['couch_db']['dreyfus']['repo_url']` - Full-text search: dreyfus repository URL. Defaults to `https://github.com/cloudant-labs/dreyfus`.\n* `node['couch_db']['dreyfus']['repo_tag']` - Full-text search: dreyfus repository tag or hash. Defaults to `d83888154be546b2826b3346a987089a64728ee5`.\n* `node['couch_db']['clouseau']['repo_url']` - Full-text search: clouseau repository URL. Defaults to `https://github.com/cloudant-labs/clouseau`.\n* `node['couch_db']['clouseau']['repo_tag']` - Full-text search: clouseau repository tag or hash. Defaults to `32b2294d40c5e738b52b3d57d2fb006456bc18cd`.\n* `node['maven']['version']` - Full-text search: Maven version for CouchDB full-text search. 3.2.5 or earlier REQUIRED. Defaults to `3.2.5`.\n* `node['maven']['url']` - Full-text search: URL to Apache Maven download. Defaults to `https://dist.apache.org/repos/dist/release/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.tar.gz`.\n* `node['maven']['checksum']` - Full-text search: Apache Maven tarball sha256 checksum. Defaults to `8c190264bdf591ff9f1268dc0ad940a2726f9e958e367716a09b8aaa7e74a755`.\n* `node['maven']['m2_home']` - Full-text search: Location of m2 home. Defaults to `/opt/maven`.\n* `node['couch_db']['enable_search']` - INTERNAL: Set to true by resource provider if search is enabled. Defaults to `false`.\n\n# Recipes\n\n* [couchdb::compile](#couchdbcompile) - INTERNAL USE ONLY.\n* [couchdb::prereq](#couchdbprereq) - INTERNAL USE ONLY.\n\n## couchdb::compile\n\nINTERNAL USE ONLY. Downloads and compiles CouchDB from source.\n\n## couchdb::prereq\n\nINTERNAL USE ONLY. Creates directories, users, and installs runtime and build\nprerequisites for CouchDB when installing from source.\n\n# Resources\n\n* [couchdb_clouseau](#couchdb_clouseau) - This creates and destroys a CouchDB Clouseau (search) node, and is automatically invoked by the `couchdb_node` resource.\n* [couchdb_node](#couchdb_node) - This creates a CouchDB node, either standalone or as part of a cluster.\n* [couchdb_setup_cluster](#couchdb_setup_cluster) - Optional role to join all nodes in the cluster together.\n\n## couchdb_clouseau\n\nThis creates and destroys a CouchDB Clouseau (search) node, and is automatically\ninvoked by the `couchdb_node` resource. There is *no need* to include this resource\ndirectly in your wrapper cookbook.\n\n### Actions\n\n- create: Create the CouchDB Clouseau node. Default action.\n\n### Attribute Parameters\n\n- bind_address: The address on which the clouseau service will bind. Defaults to \u003ccode\u003e\"127.0.0.1\"\u003c/code\u003e.\n- index_dir: The directory in which the clouseau service will store its indexes. Defaults to \u003ccode\u003e\"default\"\u003c/code\u003e.\n- cookie: The Erlang cookie with which the clouseau service will join the cluster. Defaults to \u003ccode\u003e\"monster\"\u003c/code\u003e.\n\n## couchdb_node\n\nThis creates a CouchDB node, either standalone or as part of a cluster.\n\n### Actions\n\n- create: Create the CouchDB node. Default action.\n\n### Attribute Parameters\n\n- bind_address: The address to which CouchDB will bind. Defaults to \u003ccode\u003e\"0.0.0.0\"\u003c/code\u003e.\n- port: The port to which CouchDB will bind the main interface. Defaults to \u003ccode\u003e5984\u003c/code\u003e.\n- local_port: The port to which CouchDB will bind the node-local (backdoor) interface. Defaults to \u003ccode\u003e5986\u003c/code\u003e.\n- admin_username: The administrator username for CouchDB. In a cluster, all nodes should have the same administrator.\n- admin_password: The administrator password for CouchDB. In a cluster, all nodes should have the same administrator.\n- uuid: The UUID for the node. In a cluster, all node UUIDs must match. Auto-generated if not specified.\n- cookie: The cookie for the node. In a cluster, all node cookies must match. Defaults to \u003ccode\u003e\"monster\"\u003c/code\u003e.\n- type: The type of the node - `standalone` or `clustered`. Defaults to \u003ccode\u003e\"clustered\"\u003c/code\u003e.\n- loglevel: The logging level of the node. Defaults to \u003ccode\u003e\"info\"\u003c/code\u003e.\n- config: A hash specifying additional settings for the CouchDB configuration ini files. The first level of the hash represents section headings. The second level contains key-pair values to place in the ini file. See `test/cookbooks/couchdb-wrapper-test/recipes/one-node-from-source.rb` for more detail. Defaults to \u003ccode\u003e{}\u003c/code\u003e.\n- fulltext: Whether to enable full-text search functionality or ont. Defaults to \u003ccode\u003efalse\u003c/code\u003e.\n- extra_vm_args: Additional Erlang launch arguments to place in the `vm.args` file. Can be used to specify `inet_dist_listen_min`, `inet_dist_listen_max` and `inet_dist_use_interface` options, for example.\n\n### Examples\n\n    # Standalone node with full-text search enabled.\n    couchdb_node 'couchdb' do\n      admin_username 'admin'\n      admin_password 'password'\n      fulltext true\n      type 'standalone'\n    end\n\n## couchdb_setup_cluster\n\nOptional role to join all nodes in the cluster together.\n\nNOTE: Intended to be run on a SINGLE NODE IN THE CLUSTER. Adding this to\nthe run list of more than one node in the cluster will result in undefined,\nprobably WRONG behaviour.\n\nThrough the use of the `address` and `port` options, this resource can be\nrun on any Chef-managed machine. It does not have to run on a CouchDB node.\n\nOperators can also avoid this role and manage cluster membership and\nfinalisation outside of Chef.\n\n### Actions\n\n- create:  Default action.\n\n### Attribute Parameters\n\n- address: The CouchDB address through which cluster management is performed. Defaults to \u003ccode\u003e\"127.0.0.1\"\u003c/code\u003e.\n- port: The port for the CouchDB address through which cluster management is performed. Defaults to \u003ccode\u003e5984\u003c/code\u003e.\n- admin_username: The administrator username for CouchDB. In a cluster, all nodes should have the same administrator.\n- admin_password: The administrator password for CouchDB. In a cluster, all nodes should have the same administrator.\n- role: The role to which all nodes in the cluster should belong. Used with Chef Search to retrieve a current list of node addresses and ports. Defaults to \u003ccode\u003e\"couchdb\"\u003c/code\u003e.\n- search_string: Override of the default `roles:\u003crole\u003e` Chef Search expression. Modify this if you need to build a list of nodes in the cluster via different search terms. Defaults to \u003ccode\u003e\"default\"\u003c/code\u003e.\n- num_nodes: Required. Number of nodes the Chef Search should return. Ensures that all nodes have been provisioned prior to joining them into a cluster.\n- node_list: Optional array of [address, port] pairs representing all nodes in the cluster. If a static list is specified here, it will override the Chef Search. Only these nodes will be joined into the cluster. Only use this as a last resort. Example: `[['127.0.0.1', 15984], ['127.0.0.1', 25984], ['127.0.0.1', 35984]]`. Defaults to \u003ccode\u003e[]\u003c/code\u003e.\n\n# License and Maintainer\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License.  You may obtain a copy of the\nLicense at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed\nunder the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\nCONDITIONS OF ANY KIND, either express or implied.  See the License for the\nspecific language governing permissions and limitations under the License.\n\n* Author: Joan Touzet (\u003cwohali@apache.org\u003e)\n* Previous Authors:\n  * Joshua Timberman (\u003cjoshua@opscode.com\u003e)\n  * Matthieu Vachon (\u003cmatthieu.o.vachon@gmail.com\u003e)\n\nCopyright 2014-2017, Joan Touzet; Copyright 2009-2014, Opscode, Inc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwohali%2Fcouchdb-cookbook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwohali%2Fcouchdb-cookbook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwohali%2Fcouchdb-cookbook/lists"}