OSDN Git Service

add user limits recipe.
[metasearch/grid-chef-repo.git] / cookbooks / zookeeper / templates / default / conf / zoo.cfg
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 
11 # example sakes.
12 #dataDir=/tmp/zookeeper
13 dataDir=<%= node['zookeeper']['dataDirPrefix'] %><%= @node_id == '' ? '' : "/#{@node_id}"%>
14 <%
15 dataLogDir = node['zookeeper']['dataLogDir']
16 if dataLogDir != nil && dataLogDir != '' then
17 %>
18 dataLogDir=<%= dataLogDir %>
19 <% end %>
20 # the port at which the clients will connect
21 clientPort=<%= @clientPort %>
22 <%
23 if node['zookeeper']['with_security'] then
24   node['zookeeper']['authProvider'].each do |id, class_name|
25 %>
26 authProvider.<%= id %>=<%= class_name %>
27 <%
28   end
29 %>
30 jaasLoginRenew=<%= node['zookeeper']['jaasLoginRenew'] %>
31 kerberos.removeHostFromPrincipal=<%= node['zookeeper']['kerberos.removeHostFromPrincipal'] %>
32 kerberos.removeRealmFromPrincipal=<%= node['zookeeper']['kerberos.removeRealmFromPrincipal'] %>
33 # available?!
34 #requireClientAuthScheme=sasl
35 #allowSaslFailedClients=false
36 #maintain_connection_despite_sasl_failure=false
37 <% end %>
38 #
39 # Be sure to read the maintenance section of the 
40 # administrator guide before turning on autopurge.
41 #
42 # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
43 #
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
49
50 <%
51 this_file = 'zoo.cfg'
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|
55 %>
56 <%= key %>=<%= value %>
57 <%
58   end
59 end
60 %>
61
62 <%
63 case node['zookeeper']['run_mode']
64   when 'pseudo-replicated'
65 %>
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
70 <%
71   when 'full-replicated'
72     node['zookeeper']['ensemble'].each do |id, server|
73 %>
74 server.<%= id %>=<%= server[:hostname] %>:<%= server[:leader_port] %>:<%= server[:election_port] %>
75 <%
76     end
77 end
78 %>
79