1 # The number of milliseconds of each tick
2 tickTime=<%= node['zookeeper']['tickTime'] %>
3 # The number of ticks that the initial
4 # synchronization phase can take
5 initLimit=<%= node['zookeeper']['initLimit'] %>
6 # The number of ticks that can pass between
7 # sending a request and getting an acknowledgement
8 syncLimit=<%= node['zookeeper']['syncLimit'] %>
9 # the directory where the snapshot is stored.
10 # do not use /tmp for storage, /tmp here is just
12 #dataDir=/tmp/zookeeper
13 dataDir=<%= node['zookeeper']['dataDirPrefix'] %><%= @node_id == '' ? '' : "/#{@node_id}"%>
15 dataLogDir = node['zookeeper']['dataLogDir']
16 if dataLogDir != nil && dataLogDir != '' then
18 dataLogDir=<%= dataLogDir %>
20 # the port at which the clients will connect
21 clientPort=<%= @clientPort %>
23 if node['zookeeper']['with_security'] then
24 node['zookeeper']['authProvider'].each do |id, class_name|
26 authProvider.<%= id %>=<%= class_name %>
30 jaasLoginRenew=<%= node['zookeeper']['jaasLoginRenew'] %>
31 kerberos.removeHostFromPrincipal=<%= node['zookeeper']['kerberos.removeHostFromPrincipal'] %>
32 kerberos.removeRealmFromPrincipal=<%= node['zookeeper']['kerberos.removeRealmFromPrincipal'] %>
34 #requireClientAuthScheme=sasl
35 #allowSaslFailedClients=false
36 #maintain_connection_despite_sasl_failure=false
39 # Be sure to read the maintenance section of the
40 # administrator guide before turning on autopurge.
42 # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
44 # The number of snapshots to retain in dataDir
45 #autopurge.snapRetainCount=3
46 # Purge task interval in hours
47 # Set to "0" to disable auto purge feature
48 #autopurge.purgeInterval=1
52 if defined? node['zookeeper']['extra_configs'][this_file] \
53 && node['zookeeper']['extra_configs'][this_file] != nil then
54 node['zookeeper']['extra_configs'][this_file].each do |key, value|
56 <%= key %>=<%= value %>
63 case node['zookeeper']['run_mode']
64 when 'pseudo-replicated'
66 # Pseudo ensemble mode on single host
67 server.0=localhost:2888:3888
68 server.1=localhost:2889:3889
69 server.2=localhost:2890:3890
71 when 'full-replicated'
72 node['zookeeper']['ensemble'].each do |id, server|
74 server.<%= id %>=<%= server[:hostname] %>:<%= server[:leader_port] %>:<%= server[:election_port] %>