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


apache_zookeeper (17) Versions 0.2.1

Installs/Configures Apache Zookeeper

cookbook 'apache_zookeeper', '= 0.2.1'
cookbook 'apache_zookeeper', '= 0.2.1', :supermarket
knife cookbook site install apache_zookeeper
knife cookbook site download apache_zookeeper

Apache Zookeeper Cookbook

Cookbook Version

Installs and configures Apache Zookeeper.

View the Change Log to see what has changed.


  • CentOS
  • Ubuntu


Using the default attributes will setup a single Zookeeper server in standalone mode.

If you are wanting to setup Zookeeper in a multi-server cluster make sure to fill out the node["zookeeper"]["servers"] attribute with an array of fqdn/hostnames/ips of your zookeeper servers. This array is used to calculate the server ids for each zookeeper.

You can also provide the server ids yourself by including values for the attributes node["zookeeper"]["zoo.cfg"]["server.[ID]"]. If this is done you don't have to provide the node["zookeeper"]["servers"] attribute.

What does the installation look like

By default the installation will look like,

zkCli | /usr/bin/zkCli  - The Zookeeper cli binary command
/opt/zookeeper/*        - All of Zookeeper's files (config, binaries, event handlers, logs...)
/etc/init.d/zookeeper   - An init.d script to start/stop zookeeper. You can use service 
                        zookeeper [start|stop|restart|status] instead

Unique Quorum and Leader Election Ports

It is possible to provide unique quorum and leader election ports via node["zookeeper"]["servers"] attribute or node["zookeeper"]["zoo.cfg"]["server.[ID]"] by specifying the hostname followed by the quorum and leader election ports like this,

node["zookeeper"]["servers"] = ["host1:2188:3188", "host2:2188:3188", "host3:2188:3188"]


node["zookeeper"]["zoo.cfg"]["server.1"] = "host1:2188:3188"

Environment Variables

Should note that the and other various scripts provided by zookeeper taken in various environment variables to tweak runtime settings. Here are some,

  • ZOO_LOG_DIR : Overwrites log4j zookeeper.log.file. Defaults to . if not set which is why we provide a default value for it to the node["zookeeper"]["log_directory"] value.
  • ZOO_LOG4J_PROP : Overwrites log4j zookeeper.root.logger. Defaults to 'INFO, CONSOLE' if not set which is why we provide a default value for it 'INFO,CONSOLE,ROLLINGFILE'
  • JMXDISABLE : Disables jmx. Defaults to enabling JMX. To disable set to any value
  • SERVER_JVMFLAGS : JVM flags for the server process


  • node["zookeeper"]["user"] : The user that owns the Zookeeper installation (default="zookeeper")
  • node["zookeeper"]["group"] : The group that owns the Zookeeper installation (default="zookeeper")
  • node["zookeeper"]["open_file_limit"] : The open file limit for the zookeeper user (default=32768)
  • node["zookeeper"]["max_processes"] : The max processes limit for the zookeeper user (default=1024)
  • node["zookeeper"]["env_vars"] : The environment variables set for the zookeeper user (default={"ZOO_LOG_DIR" => node["zookeeper"]["log_directory"], "ZOO_LOG4J_PROP" => "'INFO, CONSOLE, ROLLINGFILE'"})
  • node["zookeeper"]["servers"] : The array of fqdn/hostnames/ips for the zookeeper servers in the cluster (default=[])
  • node["zookeeper"]["follower_port"] : The port used by zookeeper followers (default=2888)
  • node["zookeeper"]["election_port"] : The port used for zookeeper elections (default=3888)
  • node["zookeeper"]["version"] : The version of the Serf agent to install (default="3.4.5")
  • node["zookeeper"]["binary_url"] : The full binary url of Zookeeper. If you override this value make sure to provide a valid and up to date value for node["zookeeper"]["version"] (default=File.join node["zookeeper"]["mirror"], "zookeeper-#{node["zookeeper"]["version"]}", "zookeeper-#{node["zookeeper"]["version"]}.tar.gz")
  • node["zookeeper"]["base_directory"] : The base directory Zookeeper should be installed into (default="/opt/zookeeper")
  • node["zookeeper"]["log_directory"] : The log directory for Zookeeper (default="#{node["zookeeper"]["base_directory"]}/logs")
  • node["zookeeper"]["zoo.cfg"][*] : The key/values set for the zoo.cfg config file (see attributes file for defaults)
  • node["zookeeper"][""][*] : The key/values set for the config file (see attributes file for defaults)

Dependent cookbooks

java >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

No quality metric results found