kevincoakley.zookeeper
Ansible Role: Zookeeper
This Ansible role installs Apache Zookeeper, which can operate in either a standalone mode or a replicated setup. It is tested with Zookeeper version 3.6.1.
Requirements
You need to have a Linux operating system that has systemd available by default. Supported versions include CentOS 7, CentOS 8, Ubuntu 18.04, and Ubuntu 20.04.
Role Variables
Host Group Name: Define the system host group in
/etc/ansible/hoststo set up the replicated environment automatically:zookeeper_ansible_host_group: zookeeperServer Variable: The Ansible fact to be used in the
conf/zoo.conffile to indicate the servers in the cluster:zookeeper_server_variable: ansible_ssh_hostZookeeper Version: Specify the version of Zookeeper to be installed:
zookeeper_version: 3.4.7Configuration Variables: Include important settings for Zookeeper:
zookeeper_tick_time: 2000 zookeeper_init_limit: 10 zookeeper_sync_limit: 5Data Directory: The location where Zookeeper data will be stored:
zookeeper_data_dir: /tmp/zookeeper/Client Port: The port for Zookeeper clients:
zookeeper_client_port: 2181Max Clients: Limit for maximum client connections:
zookeeper_max_client_cnxns: 60Log Directory: The location for Zookeeper logs:
zookeeper_log_dir: /tmp/
Dependencies
None
Example Playbook
An example playbook for Zookeeper (zookeeper_playbook.yml):
- hosts: zookeeper
sudo: yes
vars:
zookeeper_version: 3.6.1
roles:
- zookeeper
Example /etc/ansible/hosts file:
[zookeeper]
zookeeper-0 zookeeper_id=0
zookeeper-1 zookeeper_id=1
zookeeper-2 zookeeper_id=2
License
This role is licensed under the BSD License.
Author Information
Kevin Coakley (GitHub Profile)
ansible-galaxy install kevincoakley.zookeeper