evertrue / zookeeper-cookbook

Chef cookbook for installing and managing Zookeeper.
https://supermarket.chef.io/cookbooks/zookeeper
Apache License 2.0
81 stars 119 forks source link
chef chef-cookbook zookeeper

zookeeper cookbook

ci Cookbook Version

Table of Contents

Apache ZooKeeper

Apache ZooKeeper is a coordination and discovery service maintained by the Apache Software Foundation.

This cookbook focuses on deploying ZooKeeper via Chef.

It should be noted that ZooKeeper’s configuration and startup systems are complicated. To elaborate, the service scripts supplied by this cookbook use bin/zkServer.sh inside the ZooKeeper directory, which sources a variety of shell scripts as part of its initialization process.

Please be mindful if you decide to install ZooKeeper to a different location that the path to the config directory should remain pointed to the one within the install directory, unless you instead to completely rewire how ZooKeeper runs in your wrapper cookbook.

Resources

zookeeper

The zookeeper resource is responsible for installing and (eventually) uninstalling Zookeeper from a node.

Actions: :install, :uninstall

Parameters:

Example:

zookeeper 'zookeeper' do
  version  '3.4.8'
  username 'zookeeper'
  mirror   'http://www.poolsaboveground.com/apache/zookeeper'
  checksum 'f10a0b51f45c4f64c1fe69ef713abf9eb9571bc7385a82da892e83bb6c965e90'
  action   :install
end

zookeeper_config

This resource renders a ZooKeeper configuration file.

Actions: :create, :delete

Parameters:

Example:

config_hash = {
  clientPort: 2181,
  dataDir: '/mnt/zk',
  tickTime: 2000,
  'autopurge.snapRetainCount' => 1,
  'autopurge.purgeInterval' => 1
  }
}

zookeeper_config 'zoo.cfg' do
  config config_hash
  username 'zookeeper'
  action :create
end

zookeeper_service

This resource manages a system service for ZooKeeper. Confusingly, it has only one action, and the resources within are controlled via a property.

This will change in a future release, but is “good enough” for now.

Actions: :create

Properties:

Example:

zookeeper_service 'zookeeper' do
  service_style 'systemd'
  install_dir   '/opt/zookeeper'
  username      'zookeeper'
end

Errata

Author and License

Apache License, Version 2.0