pvc-ansible/roles/pvc/templates/zookeeper/zoo.cfg.j2

35 lines
1.1 KiB
Django/Jinja

# PVC Zookeeper configuration
# {{ ansible_managed }}
# Put all data in /var/lib/zookeeper
dataDir=/var/lib/zookeeper
# Set our tick time to 1 second
tickTime=1000
# Initialization can take up to 30 ticks
initLimit=30
# Syncing can take up to 15 ticks
syncLimit=15
# Lower snapshot count from 100k to 10k
snapCount=10000
# Halve the snapshot size to 2GB
snapSizeLimitInKb=2097152
# Configure a max of 200 client connections
maxClientCnxns=200
# Auto purge: keep 3 snapshots and evaluate every hour
autopurge.snapRetainCount=3
autopurge.purgeInterval=1
# Enable Prometheus metrics (someday, but not today under Debian 12 or less)
#metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
#metricsProvider.httpPort=9181
#metricsProvider.exportJvmInfo=true
# Listen on port 2181 on the cluster IP
clientPort=2181
clientPortAddress={% for node in pvc_nodes if node.hostname == this_node %}{{ node.cluster_ip }}{% endfor %}
# Node list - all coordinators
{% for node in pvc_nodes if node.is_coordinator %}
server.{{ node.node_id }}={{ node.cluster_ip }}:2888:3888
{% endfor %}