Skip to content

Commit 352ed08

Browse files
authored
Fix broker initialization error when using global Zookeeper (#602) (#603)
1 parent a9f2ba7 commit 352ed08

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

charts/pulsar/templates/broker-statefulset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ spec:
143143
{{- include "pulsar.broker.zookeeper.tls.settings" . | nindent 12 }}
144144
export PULSAR_MEM="-Xmx128M";
145145
{{- if .Values.pulsar_metadata.configurationStore }}
146-
until timeout 15 bin/pulsar zookeeper-shell -server {{ template "pulsar.configurationStore.connect" . }} get {{ .Values.configurationStoreMetadataPrefix }}/admin/clusters/{{ template "pulsar.cluster.name" . }}; do
146+
until timeout 15 bin/pulsar zookeeper-shell -server {{ template "pulsar.configurationStore.connect" . }} get {{ .Values.pulsar_metadata.configurationStoreMetadataPrefix }}/admin/clusters/{{ template "pulsar.cluster.name" . }}; do
147147
{{- end }}
148148
{{- if not .Values.pulsar_metadata.configurationStore }}
149149
until timeout 15 bin/pulsar zookeeper-shell -server {{ template "pulsar.zookeeper.connect" . }} get {{ .Values.metadataPrefix }}/admin/clusters/{{ template "pulsar.cluster.name" . }}; do

charts/pulsar/templates/proxy-statefulset.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,14 @@ spec:
126126
{{- if $zk:=.Values.pulsar_metadata.userProvidedZookeepers }}
127127
until timeout 15 bin/pulsar zookeeper-shell -server {{ $zk }} ls {{ or .Values.metadataPrefix "/" }}; do
128128
echo "user provided zookeepers {{ $zk }} are unreachable... check in 3 seconds ..." && sleep 3;
129+
done;
130+
{{- else if .Values.pulsar_metadata.configurationStore }}
131+
until timeout 15 bin/pulsar zookeeper-shell -server {{ template "pulsar.configurationStore.service" . }} get {{ .Values.pulsar_metadata.configurationStoreMetadataPrefix }}/admin/clusters/{{ template "pulsar.cluster.name" . }}; do
132+
echo "pulsar cluster {{ template "pulsar.cluster.name" . }} isn't initialized yet ... check in 3 seconds ..." && sleep 3;
129133
done;
130-
{{ else }}
131-
until timeout 15 bin/pulsar zookeeper-shell -server {{ template "pulsar.configurationStore.service" . }} get {{ .Values.metadataPrefix }}/admin/clusters/{{ template "pulsar.cluster.name" . }}; do
132-
sleep 3;
134+
{{- else }}
135+
until timeout 15 bin/pulsar zookeeper-shell -server {{ template "pulsar.zookeeper.service" . }} get {{ .Values.metadataPrefix }}/admin/clusters/{{ template "pulsar.cluster.name" . }}; do
136+
echo "pulsar cluster {{ template "pulsar.cluster.name" . }} isn't initialized yet ... check in 3 seconds ..." && sleep 3;
133137
done;
134138
{{- end}}
135139
{{- end}}

0 commit comments

Comments
 (0)