Fix the zk peer listing to match myid values

We were using a loop index which meant for our cluster size of three we
would always assign server.1 through server.3. Unfortunately, as we
replace servers we may add notes with a myid value >3 which breaks when
we try to assign serverids in this way.

Fix it by using the calculation for myid in the peer listing.

Change-Id: Icf770c75cf3a84420116f47ad691d9f06191fb65
This commit is contained in:
Clark Boylan 2021-04-27 10:16:08 -07:00
parent 82435b279a
commit 71b0526a44

View File

@ -28,7 +28,7 @@ secureClientPort=2281
ssl.keyStore.location=/tls/keys/keystore.pem ssl.keyStore.location=/tls/keys/keystore.pem
ssl.trustStore.location=/tls/certs/cacert.pem ssl.trustStore.location=/tls/certs/cacert.pem
{% for host in groups['zookeeper'] %} {% for host in groups['zookeeper'] %}
server.{{ loop.index }}={{ (hostvars[host].public_v4) }}:2888:3888 server.{{ host | regex_replace('^zk(\\d+)\\.open.*\\.org$', '\\1') | int }}={{ (hostvars[host].public_v4) }}:2888:3888
{% endfor %} {% endfor %}
sslQuorum=true sslQuorum=true
serverCnxnFactory=org.apache.zookeeper.server.NettyServerCnxnFactory serverCnxnFactory=org.apache.zookeeper.server.NettyServerCnxnFactory