diff --git a/kafka/10broker-config.yml b/kafka/10broker-config.yml index e5e8f0ea..49fc74c4 100644 --- a/kafka/10broker-config.yml +++ b/kafka/10broker-config.yml @@ -167,7 +167,7 @@ data: zookeeper.connect=zookeeper:2181 # Timeout in ms for connecting to zookeeper - #zookeeper.connection.timeout.ms=6000 + #zookeeper.connection.timeout.ms=18000 ############################# Group Coordinator Settings ############################# diff --git a/nonroot/nonroot-image-zookeeper.yaml b/nonroot/nonroot-image-zookeeper.yaml index be9e0ad2..8db695a9 100644 --- a/nonroot/nonroot-image-zookeeper.yaml +++ b/nonroot/nonroot-image-zookeeper.yaml @@ -10,7 +10,7 @@ spec: image: solsson/kafka:initutils-nonroot@sha256:87f6bb39fd47a6f382018a2dc55a484d1b71eee48a58019c7e65a9bc53e8dca2 containers: - name: zookeeper - image: solsson/kafka:2.5.0-zookeeper-server-start@sha256:4f9c68ff762c1419270dd72d38450f58cf130aa0c66f8359441075b4fe04de85 + image: solsson/kafka:zookeeper-server-start@sha256:c34a9928fcc5ac15b2243ee2994cf09f5a3608b6090de378f39f89ad12320276 args: - /etc/kafka/zookeeper.properties.scale-$(REPLICAS).$(POD_NAME) --- @@ -26,6 +26,6 @@ spec: image: solsson/kafka:initutils-nonroot@sha256:87f6bb39fd47a6f382018a2dc55a484d1b71eee48a58019c7e65a9bc53e8dca2 containers: - name: zookeeper - image: solsson/kafka:2.5.0-zookeeper-server-start@sha256:4f9c68ff762c1419270dd72d38450f58cf130aa0c66f8359441075b4fe04de85 + image: solsson/kafka:zookeeper-server-start@sha256:c34a9928fcc5ac15b2243ee2994cf09f5a3608b6090de378f39f89ad12320276 args: - /etc/kafka/zookeeper.properties.scale-$(REPLICAS).$(POD_NAME) diff --git a/zookeeper/10zookeeper-config.yml b/zookeeper/10zookeeper-config.yml index 39fc9804..a4684c86 100644 --- a/zookeeper/10zookeeper-config.yml +++ b/zookeeper/10zookeeper-config.yml @@ -16,10 +16,9 @@ data: cp -Lur /etc/kafka-configmap/* /etc/kafka/ [ ! -z "$PZOO_REPLICAS" ] && [ ! -z "$REPLICAS" ] && { sed -i "s/^server\\./#server./" /etc/kafka/zookeeper.properties - for N in $(seq $PZOO_REPLICAS); do echo "server.$N=pzoo-$(( $N - 1 )).pzoo:2888:3888:participant" >> /etc/kafka/zookeeper.properties; done - for N in $(seq $(( $REPLICAS - $PZOO_REPLICAS ))); do echo "server.$(( $PZOO_REPLICAS + $N ))=zoo-$(( $N - 1 )).zoo:2888:3888:participant" >> /etc/kafka/zookeeper.properties; done + for N in $(seq $PZOO_REPLICAS); do echo "server.$N=pzoo-$(( $N - 1 )).pzoo.$POD_NAMESPACE.svc.cluster.local:2888:3888:participant" >> /etc/kafka/zookeeper.properties; done + for N in $(seq $(( $REPLICAS - $PZOO_REPLICAS ))); do echo "server.$(( $PZOO_REPLICAS + $N ))=zoo-$(( $N - 1 )).$POD_NAMESPACE.svc.cluster.local:2888:3888:participant" >> /etc/kafka/zookeeper.properties; done } - sed -i "s/server\.$ZOOKEEPER_SERVER_ID\=[a-z0-9.-]*/server.$ZOOKEEPER_SERVER_ID=0.0.0.0/" /etc/kafka/zookeeper.properties ln -s /etc/kafka/zookeeper.properties /etc/kafka/zookeeper.properties.scale-$REPLICAS.$POD_NAME zookeeper.properties: | @@ -28,7 +27,7 @@ data: dataDir=/var/lib/zookeeper/data dataLogDir=/var/lib/zookeeper/log clientPort=2181 - maxClientCnxns=2 + maxClientCnxns=3 initLimit=5 syncLimit=2 tcpKeepAlive=true diff --git a/zookeeper/50pzoo.yml b/zookeeper/50pzoo.yml index 6cac0577..c4dfdcc7 100644 --- a/zookeeper/50pzoo.yml +++ b/zookeeper/50pzoo.yml @@ -30,6 +30,10 @@ spec: valueFrom: fieldRef: fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace volumeMounts: - name: configmap mountPath: /etc/kafka-configmap diff --git a/zookeeper/51zoo.yml b/zookeeper/51zoo.yml index e8974e66..8abe8b40 100644 --- a/zookeeper/51zoo.yml +++ b/zookeeper/51zoo.yml @@ -30,6 +30,10 @@ spec: valueFrom: fieldRef: fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace - name: ID_OFFSET value: "4" volumeMounts: