cookbook 'apache_zookeeper', '~> 1.7.0'
apache_zookeeper
(22) Versions
1.7.0
-
Follow17
Installs/Configures Apache Zookeeper
cookbook 'apache_zookeeper', '~> 1.7.0', :supermarket
knife supermarket install apache_zookeeper
knife supermarket download apache_zookeeper
Apache Zookeeper Cookbook
Installs and configures Apache Zookeeper.
View the Change Log to see what has changed.
Supports
- CentOS
- Ubuntu
Usage
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["apache_zookeeper"]["servers"] like this,
node["apache_zookeeper"]["servers"] = ["myzkhost1.com", "myzkhost2.com", myzkhost3.com"]
The array should include a value per server and can be any of the following values,
- FQDN -
node['fqdn'] - Host Name -
node['hostname'] - Machine Name -
node['machinename'] - Any network interface -
node["network"]["interfaces"][..] - EC2 Host Name -
node['ec2']['public_hostname'] - EC2 IP Address -
node['ec2']['public_ipv4']
This array is used to configure/calculate the server ids for each zookeeper.
You can also provide the server ids yourself by including values for the attributes
node["apache_zookeeper"]["zoo.cfg"]["server.[ID]"]. If this is done you don't have to provide the
node["apache_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/current/* - All of Zookeeper's files (config, binaries, logs...)
/var/opt/zookeeper/logs - Zookeeper log information
/var/opt/zookeeper/data - Zookeeper data
/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 in a few different ways.
node["apache_zookeeper"]["servers"] = ["host1", "host2", "host3"]
node["apache_zookeeper"]["follower_port"] = 2888
node["apache_zookeeper"]["election_port"] = 3888
OR
node["apache_zookeeper"]["servers"] = ["host1:2888:3888", "host2:2888:3888", "host3:2888:3888"]
OR
node["apache_zookeeper"]["zoo.cfg"]["server.1"] = "host1:2888:3888"
node["apache_zookeeper"]["zoo.cfg"]["server.2"] = "host2:2888:3888"
node["apache_zookeeper"]["zoo.cfg"]["server.3"] = "host3:2888:3888"
Environment Variables
Should note that the zkServer.sh and other various scripts provided by zookeeper use various environment variables to tweak
runtime settings. Here are some,
-
ZOO_LOG_DIR: Overwrites log4jzookeeper.log.file. Defaults to.if not set which is why we provide a default value for it to thenode["apache_zookeeper"]["log_dir"]value. -
ZOO_LOG4J_PROP: Overwrites log4jzookeeper.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
Recipes
-
default: Installs, configures and runs zookeeper as a service -
install: Installs zookeeper -
configure: Configures zookeeper -
service: Runs zookeeper
Attributes
-
node["apache_zookeeper"]["install_java"]: If you want to use thejavacookbook to install java (default=true) -
node["apache_zookeeper"]["user"]: The user that owns the Zookeeper installation (default="zookeeper") -
node["apache_zookeeper"]["group"]: The group that owns the Zookeeper installation (default="zookeeper") -
node["apache_zookeeper"]["env_vars"]: The environment variables set for the zookeeper user (default={"ZOO_LOG_DIR" =>node["apache_zookeeper"]["log_dir"], "ZOO_LOG4J_PROP" => "'INFO, CONSOLE, ROLLINGFILE'"}) -
node["apache_zookeeper"]["servers"]: The array of fqdn/hostnames/ips for the zookeeper servers in the cluster (default=[]) -
node["apache_zookeeper"]["follower_port"]: The port used by zookeeper followers (default=2888) -
node["apache_zookeeper"]["election_port"]: The port used for zookeeper elections (default=3888) -
node["apache_zookeeper"]["version"]: The version of Zookeeper to install (default="3.4.6") -
node["apache_zookeeper"]["mirror"]: The URL to the mirror that hosts the zookeeper binary (default=http://archive.apache.org/dist/zookeeper) -
node["apache_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 fornode["apache_zookeeper"]["version"](default=File.join node["apache_zookeeper"]["mirror"], "zookeeper-#{node["apache_zookeeper"]["version"]}", "zookeeper-#{node["apache_zookeeper"]["version"]}.tar.gz") -
node["apache_zookeeper"]["init_style"]: The style of script to use for running the zookeeper service. Currently only supportsinit. (default =init) -
node["apache_zookeeper"]["install_dir"]: The base directory Zookeeper should be installed into (default="/opt/zookeeper") -
node["apache_zookeeper"]["local_state_dir"]: The base directory for all of Zookeepers local state (data, logs) -
node["apache_zookeeper"]["data_dir"]: The data directory for Zookeeper (default="#{node["apache_zookeeper"]["local_state_dir"]}/data") -
node["apache_zookeeper"]["log_dir"]: The log directory for Zookeeper (default="#{node["apache_zookeeper"]["local_state_dir"]}/logs") -
node["apache_zookeeper"]["bin_dir"]: The bind directory for Zookeeper (default="#{node["apache_zookeeper"]["install_dir"]}/current/bin") -
node["apache_zookeeper"]["config_dir"]: The config directory for Zookeeper (default="#{node["apache_zookeeper"]["install_dir"]}/current/config") -
node["apache_zookeeper"]["zoo.cfg"][*]: The key/values set for thezoo.cfgconfig file (see attributes file for defaults) -
node["apache_zookeeper"]["log4j.properties"][*]: The key/values set for thelog4j.propertiesconfig file (see attributes file for defaults) -
node['apache_zookeeper']['install']['type']: Type of zookeeper installation. Can besourceorpackage -
node['apache_zookeeper']['package']['version']: Defaultnil. Set if you need not the latest version.
Dependent cookbooks
| java >= 0.0.0 |
| ulimit >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Change Log
1.7.0 - 02-11-2020
- [Enhancement] Issue-57 : Fixed systemd deployment via ulimits and timeout
1.6.0 - 06-11-2018
- [Enhancement] Issue-54 : Fix init.d/systemd to read configuration from
config_dir
1.5.0 - 06-08-2018
- [Enhancement] Issue-56 : Fix LSB init block to allow use of init script with systemd
1.4.0 - 01-02-2018
- [Enhancement] Issue-52 : Fix for CentOS 7 while executing "apache_zookeeper::service_systemd" recipe.
1.3.0 - 08-25-2017
- [Enhancement] Issue-50 : Correct README about log_dir and fix systemd
1.2.0 - 08-04-2017
- [Feature] Issue-48 : Package installation support
1.1.1 - 05-24-2017
- [Bug] Issue-47 : binary_url doesn't adhere to version or mirror
1.1.0 - 05-24-2017
- [Enhancement] Issue-45 : Running service status with the correct user
- [Bug] Issue-40 : init.d scripts have the CONFIG path hardcoded.
1.0.1 - 09-23-2016
- [Bug] Issue-43 : Readme references "binary_url", but the cookbook doesn't seem to actually have that
1.0.0 - 12-11-2015
- [Feature] Issue-38 : Provide recipes for install/configure/service
- [Feature] Issue-37 : Support different init styles
- [Enhancement] Issue-36 : Remove xml-simple
- [Bug] Issue-27 : Package
daemonis missing - [Enhancement] Issue-25 : zookeeper as system user
0.5.0 - 06-23-2015
- [Enhancement] Issue-24 : Fix up tests
- [Enhancement] Issue-23 : Recipe downgrades java to 1.6
- [Enhancement] Issue-20 : Add test zkcli works
- [Enhancement] Issue-13 : Use ulimit cookbook
0.4.0 - 10-20-2014
- [Enhancement] Issue-19 : Documentation update for default ports
- [Enhancement] Issue-18 : Match any IP address, not just the default
0.3.2 - 09-09-2014
- [Bug] Issue-16 : Version fix
0.3.1 - 09-09-2014
- [Bug] Issue-14 :
attributes?not a method -- affects ec2 provisioning
0.3.0 - 08-21-2014
- [Enhancement] Issue-10 : Additional attribute tweaks
0.2.2 - 08-21-2014
- [Bug] Issue-11 : Release without PaxHeaders
0.2.1 - 07-24-2014
- [Enhancement] Issue-9 : Set zookeeper log directory by default
- [Bug] Issue-8 : Client port is always appended to hosts
- [Enhancement] Issue-2 : Add tests
0.2.0 - 07-15-2014
- [Feature] Issue-7 : Additional attributes
0.1.3 - 07-12-2014
- [Bug] Issue-6 : Create myid file
0.1.2 - 06-30-2014
- [Bug] Issue-5 : Init script does not support chkconfig
0.1.1 - 06-21-2014
- [Bug] Issue-4 : Metadata does not include java depends
0.1.0 - 06-21-2014
- [Feature] Issue-1 : Initial Cookbook
Collaborator Number Metric
1.7.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass 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 passed this metric
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 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 passed this metric
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 passed this metric
1.7.0 failed this metric
1.7.0 passed this metric