forked from sleighzy/ansible-zookeeper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzoo.cfg.j2
52 lines (42 loc) · 1.72 KB
/
zoo.cfg.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# {{ ansible_managed }}
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir={{ zookeeper_data_dir }}
# Directory to write the transaction log to the dataLogDir rather than the dataDir.
# This allows a dedicated log device to be used, and helps avoid competition between logging and snaphots.
dataLogDir={{ zookeeper_data_log_dir }}
# the port at which the clients will connect
clientPort={{ zookeeper_client_port }}
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
# List of clustered ZooKeeper nodes.
# Port 2888 is the default quorum port and 3888 is the default
# leader election port. These must be unique per server.
# Each server also needs a /var/lib/zookeeper/myid file created containing
# a single unique number, e.g. 1, 2, etc.
#server.1=hostname1:2888:3888
#server.2=hostname2:2888:3888
{% for host in zookeeper_servers %}
server.{{ hostvars[host].zookeeper_id | default(zookeeper_id) }}={{ hostvars[host]['ansible_nodename'] }}:{{ zookeeper_leader_port }}:{{ zookeeper_election_port }}
{% endfor %}