Skip to content

Instantly share code, notes, and snippets.

@smuthali
Last active November 9, 2016 01:35
Show Gist options
  • Save smuthali/d267efdc67f269efefeebf7668618a69 to your computer and use it in GitHub Desktop.
Save smuthali/d267efdc67f269efefeebf7668618a69 to your computer and use it in GitHub Desktop.
Zookeeper Consul Template
# 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=/data
# the port at which the clients will connect
clientPort=2181
# 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=4
{{ $myid_counter := key "zk/zkcounter" | parseInt }}
{{ range $i, $services := service "zookeeper" }}
{{ with node }}
{{- if eq $services.Node .Node.Node -}}
server.{{ $myid_counter | add $i }}=0.0.0.0:2888:3888
{{- else -}}
server.{{ $myid_counter | add $i }}={{$services.Address}}:2888:3888
{{- end -}}
{{- end -}}
{{ end }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment