nl2go.zookeeper

Ansible Role: ZooKeeper

This is an Ansible role for installing and setting up Apache ZooKeeper.

Role Variables

Here are the available settings (with default values) you can change in the defaults/main.yml file:

  • zookeeper_version: 3.6.2
    Version of the ZooKeeper application.

  • zookeeper_dir: /opt/zookeeper
    Directory for storing application files.

  • zookeeper_data_dir: /var/zookeeper
    Directory for server data.

  • zookeeper_conf_dir: /etc/zookeeper
    Directory for server configuration.

  • zookeeper_log_dir: /var/log/zookeeper
    Directory for server logs.

  • zookeeper_log_file: zookeeper.log
    Name of the log file.

  • zookeeper_log_level: INFO
    Level of logging.

  • zookeeper_log_max_file_size: 265MB
    Maximum size of the log file before it rotates.

  • zookeeper_log_max_backup_index: 20
    Maximum number of log files to keep.

  • zookeeper_client_port: 2181
    Port for client connections.

  • zookeeper_init_limit: 5

  • zookeeper_sync_limit: 2

  • zookeeper_tick_time: 2000
    For more information, check the official ZooKeeper documentation.

  • zookeeper_members: "{{ groups['all'] | map('extract', hostvars, 'ansible_default_ipv4') | map(attribute='address') | list }}"
    Members of the ZooKeeper cluster. You can use a list of hostnames, fully qualified domain names (FQDN), or IP addresses.

  • zookeeper_member_id: "{{ ansible_default_ipv4.address }}"
    ID for the current cluster member (its position in the zookeeper_members list).

  • zookeeper_server_username: foo

  • zookeeper_server_password: foz
    Credentials for the cluster member's communication.

  • zookeeper_clients:

    • username: bar
      password: baz
      Credentials for client access.
  • zookeeper_jmx_host: 127.0.0.1
    JMX will be accessible on this hostname/IP.

  • zookeeper_jmx_port: 9181
    Port for the JMX remote agent.

  • zookeeper_jmx_rmi_port: 9182
    Port for the RMI connector.

  • zookeeper_jmx_username: foz

  • zookeeper_jmx_password: baz
    Credentials for JMX access.

  • zookeeper_jmx_role: readonly
    Role for the JMX user.

  • zookeeper_4lw_commands_whitelist: srvr,stat,mntr
    List of allowed ZooKeeper 4lw commands.

  • zookeeper_global_outstanding_limit: 1000
    Reference: [ZooKeeper Administrator's Guide].

  • zookeeper_prealloc_size: 64M
    Reference: [ZooKeeper Administrator's Guide].

  • zookeeper_snap_count: 100000
    Reference: [ZooKeeper Administrator's Guide].

  • zookeeper_max_client_cnxns: 10
    Reference: [ZooKeeper Administrator's Guide].

  • zookeeper_min_session_timeout: "{{ 2 * zookeeper_tick_time }}"
    Reference: [ZooKeeper Administrator's Guide].

  • zookeeper_max_session_timeout: "{{ 20 * zookeeper_tick_time }}"
    Reference: [ZooKeeper Administrator's Guide].

  • zookeeper_autopurge_snapretain_count: 10
    Reference: [Clickhouse Usage Recommendations for ZooKeeper].

  • zookeeper_purge_interval: 1
    Reference: [Clickhouse Usage Recommendations for ZooKeeper].

  • zookeeper_fsync_warning_threshold_ms: 1000
    Reference: [ZooKeeper Administrator's Guide].

  • zookeeper_heap_size: 1024
    The JVM heap size in MB.

Dependencies

Requires nl2go.openjdk.

Example Playbook

- hosts: all
  roles:
    - nl2go.zookeeper

Development

Use docker-molecule as per the instructions to run Molecule, or you can install Molecule locally (note: this may lead to version conflicts).

Set your Hetzner Cloud token:

export HCLOUD_TOKEN=123abc456efg

To run tests, use:

molecule test --all

Maintainers

License

Please refer to the LICENSE.md file for details.

Author Information

This role was created in 2020 by Newsletter2Go GmbH.

For more information, check the ZooKeeper Administrator's Guide and Clickhouse Usage Recommendations for Zoookeper.

Informazioni sul progetto

An Ansible Role that manages installation and configuration of Apache ZooKeeper

Installa
ansible-galaxy install nl2go.zookeeper
Licenza
mit
Download
8.5k
Proprietario