Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

RSS

zookeeper-platform (7) Versions 1.0.0

Installs/Configures a Zookeeper cluster using systemd

Berkshelf/Librarian
Policyfile
Knife
cookbook 'zookeeper-platform', '= 1.0.0'
cookbook 'zookeeper-platform', '= 1.0.0', :supermarket
knife cookbook site install zookeeper-platform
knife cookbook site download zookeeper-platform
README
Dependencies
Quality 100%

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 on systemd managed distributions.

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]].

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, docker and some monkey-patching.

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.IPAddress}}' zookeeper-kitchen-01)

Changes

1.0.0:

  • Initial version with Centos 7 support

Requirements

Cookbooks

Declared in metadata.rb.

Gems

Declared in Gemfile.

Platforms

A systemd managed distribution: - RHEL Family 7, tested on Centos

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.

Attributes

Configuration is done by overriding default attributes. All configuration keys have a default defined in 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.

Contributing

You are more than welcome to submit issues and merge requests to this project. Note however that this cookbook will probably not support another supervisor than systemd.

Commits

Your commits must pass git log --check and messages should be formated like this (based on this excellent post):

Summarize change in 50 characters or less

Provide more detail after the first line. Leave one blank line below the
summary and wrap all lines at 72 characters or less.

If the change fixes an issue, leave another blank line after the final
paragraph and indicate which issue is fixed in the specific format
below.

Fix #42

Also do your best to factor commits appropriately, ie not too large with unrelated things in the same commit, and not too small with the same small change applied N times in N different commits. If there was some accidental reformatting or whitespace changes during the course of your commits, please rebase them away before submitting the PR.

Files

All files must be 80 columns width formatted (actually 79), exception when it is not possible.

License and Author

Copyright:: 2015, Sam4Mobile

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

cluster-search >= 0.0.0
ark >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Foodcritic Metric
            

1.0.0 passed this metric