cookbook 'zookeeper-platform', '~> 1.7.0'
zookeeper-platform (8) Versions 1.7.0 Follow2
Installs/Configures a Zookeeper cluster using systemd
cookbook 'zookeeper-platform', '~> 1.7.0', :supermarket
knife supermarket install zookeeper-platform
knife supermarket download zookeeper-platform
Zookeeper Platform
Description
Apache ZooKeeper is an effort to develop and maintain an open-source server
which enables highly reliable distributed coordination. Learn more about
ZooKeeper on http://zookeeper.apache.org.
This cookbook focuses on deploying a Zookeeper cluster via Chef.
Requirements
Cookbooks and gems
Declared in [metadata.rb](metadata.rb) and in [Gemfile](Gemfile).
Platforms
A systemd managed distribution:
- RHEL Family 7, tested on Centos 7.2
Note: it should work fine on Debian 8 but the official docker image does not
allow systemd to work easily, so it could not be tested.
Usage
Easy Setup
Create a role zookeeper-platform
having recipe['zookeeper-platform']
in its
runlist and setting node['zookeeper-platform']['role']
to itself. Add this
role in the runlists of the nodes you want to use for your cluster. By default,
you need exactly 3 nodes.
By default, this cookbook installs openjdk from the official repositories
(openjdk 8 on centos 7) in systemd_service recipe, just before
launching the service. You can deactivate this behavior by setting
node['zookeeper-platform']['java']
to ""
, or choose your package by setting
the package name in node['zookeeper-platform']['java'][node[:platform]]
.
Search
By default, the config recipe use a search to find the members of a cluster.
The search is parametrized by a role name, defined in attribute
node['zookeeper-platform']['role']
which default to zookeeper-platform.
Node having this role in their expanded runlist will be considered in the same
zookeeper cluster. For safety reason, if search is used, you need to define
node['zookeeper-platform']['size']
(3 by default). The cookbook will return
(with success) until the search return size nodes. This ensures the
stability of the configuration during the initial startup of a cluster.
If you do not want to use search, it is possible to define
node['zookeeper-platform']['hosts']
with an array containing the hostnames of
the nodes of a zookeeper cluster. In this case, size attribute is ignored
and search deactivated.
Test
This cookbook is fully tested through the installation of a working 3-nodes
cluster in docker hosts. This uses kitchen (>= 1.5.0), docker (>= 1.10) and
a small monkey-patch.
For more information, see .kitchen.yml and test directory.
Local cluster
You can also use this cookbook to install a zookeeper cluster locally. By
running kitchen converge
, you will have a 3-nodes cluster available on your
workstation, each in its own docker host. You can then access it with:
zkCli.sh -server $(docker inspect \
--format '{{.NetworkSettings.Networks.kitchen.IPAddress}}' \
zookeeper-kitchen-01)
Attributes
Configuration is done by overriding default attributes. All configuration keys
have a default defined in [attributes/default.rb](attributes/default.rb).
Please read it to have a comprehensive view of what and how you can configure
this cookbook behavior.
Recipes
default
Run install, create_user, config and systemd_service recipes, in that
order.
install
Install zookeeper with ark cookbook.
create_user
Create zookeeper system user and group.
config
Generate nodes list by search or by using hosts attribute. Merge it with base
configuration, then install myid and zoo.cfg files. Create work
directories: for data and logs.
systemd_service
Install zookeeper service for systemd, enable and start it. Install java
package by default.
Resources/Providers
None.
Changelog
Available in [CHANGELOG](CHANGELOG).
Contributing
Please read carefully [CONTRIBUTING.md](CONTRIBUTING.md) before making a merge
request.
License and Author
- Author:: Samuel Bernard (samuel.bernard@gmail.com)
Copyright (c) 2015-2016 Sam4Mobile, 2017-2018 Make.org Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Dependent cookbooks
ark >= 0.0.0 |
cluster-search >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Changelog
1.7.0
Main:
- feat: change default log4j logger to CONSOLE
- feat: use zookeeper 3.4.12 by default
Tests:
- test: replace deprecated require_chef_omnibus
- test: include .gitlab-ci.yml from test-cookbook
Misc:
- chore: add 2018 to copyright notice
- style(rubocop): fix UnneededCopDisableDirective
- style(rubocop): fix heredoc & log4j config
- chore: rm molinillo constraint in Gemfile
1.6.0
Main:
- fix: allow to not install java package
- fix: setting java attr to "" works as expected
- fix: do not set retries if package_retries is nil
Tests:
- use .gitlab-ci.yml template [20170731]
- force molinillo version to fix berkshelf
Misc:
- set new contributing guide
1.5.0
Main:
- Handover maintainance to Make.org
- Switch zookeeper version to 3.4.10 by default
Tests:
- Fix destroying in kitchen_command, stop forcing converge when verify
- Set always_update and build_pull in kitchen config
- Use latest template for .gitlab-ci.yml [20170405]
Misc:
- Use cookbook_name alias everywhere
- Fix recent rubocop offenses
- Fix metadata: license and chef_version
- Fix nologin shell for zookeeper user
1.4.0
Main:
- Make Systemd unit path configurable, change default to "/etc/systemd/system" as recommended by official documentation
Test:
- Start Continuous Integration with gitlab-ci, use templated config
- Add retry on package installations
- Use skip_preparation: true (image works without modification)
- security_opt: seccomp=unconfined (enable systemd on recent version)
- Use instance_host_name which change node hostnames, adapt tests
- Set package retries to 1 in tests
- Abort cleanly if config is not ok (not enough node found)
Misc:
- Rewrite changelog in markdown
1.3.0
Main:
- Update default zookeeper version to 3.4.8
Tests:
- Use a special docker image, switch to docker_cli
- Switch kitchen driver from docker to docker_cli
- Use sbernard/centos-systemd-kitchen image instead of bare centos
- Remove privileged mode :)
- Remove some now useless monkey patching
- Clean .kitchen.yml
- No need for dnsdock anymore! (need docker 1.10)
- Create kitchen network if missing
- Fix cases when cluster is temporarily not connected by trying multiple times
- Fix case "creation of /kitchen" when done twice
- Remove dependency on zookeeper gem
Misc:
- Fix rubocop offenses in kitchen_command
- Give a specific name to resource to avoid cloning
1.2.0
- Update default zookeeper version to 3.4.7
- Use Apache archive as mirror (to allow all versions)
- Change jmx port to 2191 (2181+10) & force hostname
- Rationalize docker provision to limit number of images
- Unify the provision command of centos 7 and dnsdock images among the different projects so that they can share the docker cache and limit the number of images
- Fix docker image for centos 7.2.1511 (add iproute)
- Fix rubocop offences except for monkey patches
- Potential breaking change (minor effect), rename:
- recipes/create-user.rb -> recipes/create_user.rb
- recipes/systemd-service.rb -> recipes/systemd_service.rb
- Use a shorter expression in zookeeper.service
1.1.0
- Make JVM options and Log4j properties configurable
- Fix a typo breaking the auto-restart when zoo.cfg is modified
- Reorganize README:
- Move changelog from README to CHANGELOG
- Move contribution guide to CONTRIBUTING.md
- Reorder README
- Add Apache 2 license file
1.0.0
- Initial version with Centos 7 support
Collaborator Number Metric
1.7.0 passed this metric
Contributing File Metric
1.7.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
1.7.0 passed this metric
No Binaries Metric
1.7.0 passed this metric
Testing File Metric
1.7.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.7.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.7.0 passed this metric
1.7.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
1.7.0 passed this metric
No Binaries Metric
1.7.0 passed this metric
Testing File Metric
1.7.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.7.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.7.0 passed this metric
1.7.0 passed this metric
Testing File Metric
1.7.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.7.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.7.0 failed this metric
1.7.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number