{"id":15517037,"url":"https://github.com/deric/puppet-zookeeper","last_synced_at":"2025-05-15T07:03:21.246Z","repository":{"id":7331048,"uuid":"8652432","full_name":"deric/puppet-zookeeper","owner":"deric","description":"Puppet module for managing Apache ZooKeeper","archived":false,"fork":false,"pushed_at":"2025-03-20T19:53:45.000Z","size":752,"stargazers_count":22,"open_issues_count":18,"forks_count":116,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-03T02:48:19.275Z","etag":null,"topics":["puppet","zookeeper"],"latest_commit_sha":null,"homepage":"https://forge.puppetlabs.com/deric/zookeeper","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deric.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-03-08T14:28:33.000Z","updated_at":"2025-01-22T11:26:03.000Z","dependencies_parsed_at":"2024-06-18T13:32:54.855Z","dependency_job_id":"09060031-3c7c-4c4f-80b9-222eaad25bd2","html_url":"https://github.com/deric/puppet-zookeeper","commit_stats":{"total_commits":539,"total_committers":73,"mean_commits":7.383561643835616,"dds":0.2578849721706865,"last_synced_commit":"7b4443b55fb7a6a3756e4185993d51da9d36c48a"},"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deric%2Fpuppet-zookeeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deric%2Fpuppet-zookeeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deric%2Fpuppet-zookeeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deric%2Fpuppet-zookeeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deric","download_url":"https://codeload.github.com/deric/puppet-zookeeper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254046708,"owners_count":22005643,"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":["puppet","zookeeper"],"created_at":"2024-10-02T10:10:59.732Z","updated_at":"2025-05-15T07:03:21.184Z","avatar_url":"https://github.com/deric.png","language":"Ruby","readme":"# puppet-zookeeper\n\n[![Puppet\nForge](http://img.shields.io/puppetforge/v/deric/zookeeper.svg)](https://forge.puppetlabs.com/deric/zookeeper) [![Static \u0026 Spec Tests](https://github.com/deric/puppet-zookeeper/actions/workflows/spec.yml/badge.svg)](https://github.com/deric/puppet-zookeeper/actions/workflows/spec.yml) [![Puppet Forge\nDownloads](http://img.shields.io/puppetforge/dt/deric/zookeeper.svg)](https://forge.puppetlabs.com/deric/zookeeper/scores)\n\nA puppet receipt for [Apache Zookeeper](http://zookeeper.apache.org/). ZooKeeper is a high-performance coordination service for maintaining configuration information, naming, providing distributed synchronization, and providing group services.\n\n## Requirements\n\n  * Puppet\n  * Binary or ZooKeeper source code archive\n\n## Basic Usage:\n\n```puppet\nclass { 'zookeeper': }\n```\n\n## Cluster setup\n\nWhen running ZooKeeper in the distributed mode each node must have unique ID (`1-255`). The easiest way how to setup multiple ZooKeepers, is by using Hiera.\n\n`hiera/host/zk1.example.com.yaml`:\n```yaml\nzookeeper::id: '1'\n```\n`hiera/host/zk2.example.com.yaml`:\n```yaml\nzookeeper::id: '2'\n```\n`hiera/host/zk3.example.com.yaml`:\n```yaml\nzookeeper::id: '3'\n```\nA ZooKeeper quorum should consist of odd number of nodes (usually `3` or `5`).\nFor defining a quorum it is enough to list all IP addresses of all its members.\n\n```puppet\nclass { 'zookeeper':\n  servers =\u003e {\n    1 =\u003e '192.168.1.1',\n    2 =\u003e '192.168.1.2',\n    3 =\u003e '192.168.1.3',\n  },\n}\n```\nIn case that an array is passed as `servers`, first ZooKeeper will be assigned `ID = 1`. This would produce following configuration:\n```\nserver.1=192.168.1.1:2888:3888\nserver.2=192.168.1.2:2888:3888\nserver.3=192.168.1.3:2888:3888\n```\nwhere first port is `election_port` and second one `leader_port`. Both ports could be customized for each ZooKeeper instance.\n\n```puppet\nclass { 'zookeeper':\n  election_port =\u003e 2889,\n  leader_port   =\u003e 3889,\n  servers       =\u003e {\n    1 =\u003e '192.168.1.1',\n    2 =\u003e '192.168.1.2',\n    3 =\u003e '192.168.1.3',\n  }\n}\n```\n\n### Observers\n\n[Observers](http://zookeeper.apache.org/doc/r3.3.0/zookeeperObservers.html) were introduced in ZooKeeper 3.3.0. To enable this feature simply state which of ZooKeeper servers are observing:\n\n```puppet\nclass { 'zookeeper':\n  servers   =\u003e ['192.168.1.1', '192.168.1.2', '192.168.1.3', '192.168.1.4', '192.168.1.5'],\n  observers =\u003e ['192.168.1.4', '192.168.1.5']\n}\n```\n**Note**: Currently observer server needs to be listed between standard servers (this behavior might change in feature).\n\n### Set binding interface\n\nBy default ZooKeeper should bind to all interfaces. When you specify `client_ip` only single interface\nwill be used. If `$::ipaddress` is not your public IP (e.g. you are using Docker) make sure to setup correct IP:\n\n```puppet\nclass { 'zookeeper':\n  client_ip =\u003e $::ipaddress_eth0\n}\n```\n\nor in Hiera:\n\n```yaml\nzookeeper::client_ip: \"%{::ipaddress_eth0}\"\n```\n\nThis is a workaround for a a [Facter issue](https://tickets.puppetlabs.com/browse/FACT-380).\n\n### ZooKeeper service\n\nUse `service_provider` to override Puppet detection for starting service.\n\n```puppet\nclass { 'zookeeper':\n  service_provider    =\u003e 'init',\n  manage_service_file =\u003e false,\n}\n```\n\nSome reasonable values are:\n\n  * `init`\n  * `systemd`\n  * `runit`\n  * `exhibitor` - zookeeper process and config will be managed by exhibitor (https://github.com/soabase/exhibitor). Exhibitor is not managed by this module.\n  * `none` - service won't be installed\n\nParameter `manage_service_file` controls whether service definition should be managed by Puppet (default: `false`). Currently supported for `systemd` and `init`.\n\n\n### Systemd Unit 'After' and 'Want' control\nBy default the module will create the following Unit section in /etc/systemd/system/multi-user.target.wants/zookeeper.service\n````\n[Unit]\nDescription=Apache ZooKeeper\nAfter=network.target\n````\n\nBoth After and Want (omitted when using the module defaults) can be controled using this module.\n\nE.g on CentOS 7 those might have to be configured for 'netwrok-online.target' using the following syntax:\n\n```puppet\nclass { 'zookeeper':\n   systemd_unit_after =\u003e 'network-online.target',\n   systemd_unit_want =\u003e 'network-online.target',\n}\n```\n\nWhich will modify the Unit section to look like:\n\n````\n[Unit]\nDescription=Apache ZooKeeper\nWant=network-online.target\nAfter=network-online.target\n````\n\n##  Parameters\n\n   - `id` - cluster-unique zookeeper's instance id (1-255)\n   - `datastore`\n   - `datalogstore` - Defining `dataLogDir` allows ZooKeeper transaction logs to be stored in a different location, might improve I/O performance (e.g. if path is mounted on dedicated disk)\n   - `log_dir`\n   - `purge_interval` - automatically will delete ZooKeeper logs (available since ZooKeeper 3.4.0)\n   - `snap_retain_count` - number of snapshots that will be kept after purging (since ZooKeeper 3.4.0)\n   - `min_session_timeout` - the minimum session timeout in milliseconds that the server will allow the client to negotiate. Defaults to 2 times the **tickTime** (since ZooKeeper 3.3.0)\n   - `max_session_timeout` - the maximum session timeout in milliseconds that the server will allow the client to negotiate. Defaults to 20 times the **tickTime** (since ZooKeeper 3.3.0)\n   - `global_outstanding_limit` - ZooKeeper will throttle clients so that there is no more than `global_outstanding_limit` outstanding requests in the system.\n   - `manage_service` (default: `true`) whether Puppet should ensure running service\n   - `manage_service_file` when enabled on RHEL 7.0 a systemd config will be managed\n   - `ensure_account` controls whether `zookeeper` user and group will be ensured (set to `false` to disable this feature)\n   - `install_method` controls whether ZooKeeper is installed from binary (`package`) or source (`archive`) packages\n   - `archive_version` allows to specify an arbitrary version of ZooKeeper when using source packages\n   - `archive_install_dir` controls the installation directory when using source packages (defaults to `/opt`)\n   - `archive_symlink` controls the name of a version-independent symlink when using source packages\n   - `archive_dl_url` allows to change the download URL for source packages (defaults to apache.org)\n   - `systemd_path` where to put `systemd` service files (applies only if `manage_service_file` and `service_provider == 'systemd'`)\n   - `restart_on_change` whether ZooKeeper service should be restarted on configuration files change (default: `true`)\n   - `remove_host_principal` whether to remove host from Kerberos principal (default: `false`)\n   - `remove_realm_principal` whether to remove relam from Kerberos principal (default: `false`)\n   - `whitelist_4lw` Fine grained control over the set of commands ZooKeeper can execute (an array e.g. `whitelist_4lw = ['*']`)\n\nand many others, see the `params.pp` file for more details.\n\nIf your distribution has multiple packages for ZooKeeper, you can provide all package names\nas an array.\n\n```puppet\nclass { 'zookeeper':\n  packages =\u003e ['zookeeper', 'zookeeper-java']\n}\n```\n## Logging\n\nZooKeeper uses log4j, following variables can be configured:\n\n```puppet\nclass { 'zookeeper':\n  console_threshold     =\u003e 'INFO',\n  rollingfile_threshold =\u003e 'INFO',\n  tracefile_threshold   =\u003e 'TRACE',\n  maxfilesize           =\u003e '256MB',\n  maxbackupindex        =\u003e 20,\n}\n```\nThreshold supported values are: `ALL`, `DEBUG`, `ERROR`, `FATAL`, `INFO`, `OFF`, `TRACE` and `WARN`.\n\n[Maxfilesize](https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/RollingFileAppender.html#maxFileSize)\n\n[MaxBackupIndex](https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/RollingFileAppender.html#maxBackupIndex)\n\nBy default console, rolling file and trace logging can be configured. Additional log appenders (vulgo log methods) can be configured\nby adding a hash `extra_appenders`. The following sets up syslog logging and points the root logger towards syslog (note that you must\nhave syslog listening on port 514/udp for this to work):\n\n```puppet\nclass { 'zookeeper':\n  log4j_prop      =\u003e 'INFO,SYSLOG',\n  extra_appenders =\u003e {\n    'Syslog' =\u003e {\n      'class'                    =\u003e 'org.apache.log4j.net.SyslogAppender',\n      'layout'                   =\u003e 'org.apache.log4j.PatternLayout',\n      'layout.conversionPattern' =\u003e \"${hostname} zookeeper[id:%X{myid}] - %-5p [%t:%C{1}@%L][%x] - %m%n\",\n      'syslogHost'               =\u003e 'localhost',\n      'facility'                 =\u003e 'user',\n    },\n  },\n}\n```\n\n\n## Hiera Support\n\nAll parameters could be defined in hiera files, e.g. `common.yaml`, `Debian.yaml` or `zookeeper.yaml`:\n\n```yaml\nzookeeper::id: 1\nzookeeper::client_port: 2181\nzookeeper::datastore: '/var/lib/zookeeper'\nzookeeper::datalogstore: '/disk2/zookeeper'\n```\n\n### Custom RPM repository\n\nOptionally you can specify a custom repository, using a hash configuration.\n\n```puppet\nclass { 'zookeeper':\n  repo       =\u003e  {\n    name      =\u003e 'myrepo',\n    url       =\u003e 'http://custom.url',\n    descr     =\u003e 'description'\n    sslverify =\u003e 1,\n    gpgcheck  =\u003e true,\n  }\n}\n```\n\n## Source package\n\nSource packages provide the ability to install arbitrary versions of ZooKeeper on any platform. Note that you'll likely have to use the `manage_service_file` in order to be able to control the ZooKeeper service (because source packages do not install service files).\n\n```puppet\nclass { 'zookeeper':\n  install_method  =\u003e 'archive',\n  archive_version =\u003e '3.4.8',\n}\n```\n\nOptionally you can specify a `proxy_server`:\n\n```puppet\nclass { 'zookeeper':\n  install_method  =\u003e 'archive',\n  archive_version =\u003e '3.4.8',\n  proxy_server    =\u003e 'http://10.0.0.1:8080'\n}\n```\n\n## Java installation\n\nDefault: `false`\n\nBy changing these two parameters you can ensure, that given Java package will be installed before ZooKeeper packages.\n\n```puppet\nclass { 'zookeeper':\n  install_java =\u003e true,\n  java_package =\u003e 'openjdk-7-jre-headless'\n}\n```\n\n## Install\n\n### Librarian (recommended)\n\nFor [puppet-librarian](https://github.com/rodjek/librarian-puppet) just add to `Puppetfile`\n\nfrom Forge:\n```ruby\nmod 'deric-zookeeper'\n```\n\nlatest (development) version from GitHub\n```ruby\nmod 'deric-zookeeper', git: 'git://github.com/deric/puppet-zookeeper.git'\n```\n\n### submodules\n\nIf you are versioning your puppet conf with git just add it as submodule, from your repository root:\n\n    git submodule add git://github.com/deric/puppet-zookeeper.git modules/zookeeper\n\n## Dependencies\n\n  * stdlib `\u003e 2.3.3` - function `ensure_resources` is required\n  * puppet-archive `\u003e 0.4.4` - provides capabilities to use archives instead of binary packages\n\n\n## Acceptance testing\n\nFastest way is to run tests on prepared Docker images:\n```\nBEAKER_set=debian9-6.3 bundle exec rake acceptance\n```\nFor examining system state set Beaker's ENV variable `BEAKER_destroy=no`:\n\n```\nBEAKER_destroy=no BEAKER_set=default bundle exec rake acceptance\n```\nand after finishing tests connect to container:\n```\ndocker exec -it adoring_shirley bash\n```\n\nWhen host machine is NOT provisioned (puppet installed, etc.):\n```\nPUPPET_install=yes BEAKER_set=debian-8 bundle exec rake acceptance\n```\n\nRun on specific OS (see `spec/acceptance/nodesets`), to see available sets:\n```\nrake beaker:sets\n```\n\n## Supported platforms\n\n  * Debian/Ubuntu\n  * RedHat/CentOS/Fedora/Rocky\n\n### Tested on:\n\n  * Debian (8, 9, 10)\n  * Ubuntu (16.04, 18.04)\n  * RHEL (6, 7)\n  * CentOS (6, 7)\n  * SLES (12)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderic%2Fpuppet-zookeeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderic%2Fpuppet-zookeeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderic%2Fpuppet-zookeeper/lists"}