archenroot commented on issue #11277:
URL: https://github.com/apache/pulsar/issues/11277#issuecomment-877698147


   So found tested connectivity on zookeeper pod itself via service cluster URL:
   ```
   root@pulsar-mini-zookeeper-0:/pulsar# telnet 
pulsar-mini-zookeeper.pulsar.svc.cluster.local 2181
   Trying 10.222.104.7...
   Connected to pulsar-mini-zookeeper.pulsar.svc.cluster.local.
   Escape character is '^]'.
   stats
   Zookeeper version: 3.5.7-f0fdd52973d373ffd9c86b81d99842dc2c7f660e, built on 
02/10/2020 11:30 GMT
   Clients:
    /10.222.104.7:50250[1](queued=0,recved=1,sent=0)
   
   Latency min/avg/max: 0/6/66
   Received: 2254
   Sent: 2253
   Connections: 1
   Outstanding: 0
   Zxid: 0x1000009a1
   Mode: follower
   Node count: 5
   Connection closed by foreign host.
   ```
   
   So it works at least, so the other pod is having issue with connectivity. I 
searched for the command prefix from wait-for-zookeper pod:
   command prefix:
   `[' until bin/bookkeeper org.apache.zookeeper.ZooKeeperMain -server 
pulsar-cs-zookeeper:2181 get /admin/clusters/pulsar-mini; do echo "pulsar 
cluster pulsar-mini isn't initialized yet ... check in 3 seconds ..." && sleep 
3; done;']
   `
   
   I think this is the issue: -server pulsar-cs-zookeeper:2181
   
   Its not reachable even from zookeeper itself: 
root@pulsar-mini-zookeeper-0:/pulsar# ping pulsar-cs-zookeeper
   ping: pulsar-cs-zookeeper: Name or service not known
   
   So I searched where is it coming from
   ```
   zangetsu@andromeda 
~/proj/infrastructure/k8s-vagrant-multi-node_archenroot/k8s/apache-pulsar $ 
grep -R "until bin/bookkeeper"
   pulsar-helm-chart/charts/pulsar/templates/_autorecovery.tpl:until 
bin/bookkeeper shell whatisinstanceid; do
   pulsar-helm-chart/charts/pulsar/templates/pulsar-cluster-initialize.yaml:    
      until bin/bookkeeper shell whatisinstanceid; do
   pulsar-helm-chart/charts/pulsar/templates/_bookkeeper.tpl:until 
bin/bookkeeper shell whatisinstanceid; do
   pulsar-helm-chart/charts/pulsar/templates/_bookkeeper.tpl:until 
bin/bookkeeper shell whatisinstanceid; do
   pulsar-helm-chart/charts/pulsar/templates/broker-statefulset.yaml:           
 until bin/bookkeeper org.apache.zookeeper.ZooKeeperMain -server {{ template 
"pulsar.configurationStore.connect" . }} get {{ 
.Values.configurationStoreMetadataPrefix }}/admin/clusters/{{ template 
"pulsar.cluster.name" . }}; do
   pulsar-helm-chart/charts/pulsar/templates/broker-statefulset.yaml:           
 until bin/bookkeeper org.apache.zookeeper.ZooKeeperMain -server {{ template 
"pulsar.zookeeper.connect" . }} get {{ .Values.metadataPrefix 
}}/admin/clusters/{{ template "pulsar.cluster.name" . }}; do
   pulsar-helm-chart/charts/pulsar/templates/broker-statefulset.yaml:           
 until bin/bookkeeper shell whatisinstanceid; do
   
   ```
   
   Search more:
   ```
   zangetsu@andromeda 
~/proj/infrastructure/k8s-vagrant-multi-node_archenroot/k8s/apache-pulsar $ 
grep -R "pulsar.zookeeper.connect"
   pulsar-helm-chart/charts/pulsar/templates/_zookeeper.tpl:{{- define 
"pulsar.zookeeper.connect" -}}
   
   ```
   So in the template file its defined as:
   ```
   {{/*
   Define the pulsar zookeeper
   */}}
   {{- define "pulsar.zookeeper.connect" -}}
   {{$zk:=.Values.pulsar_metadata.userProvidedZookeepers}}
   {{- if and (not .Values.components.zookeeper) $zk }}
   {{- $zk -}}
   {{ else }}
   {{- if not (and .Values.tls.enabled .Values.tls.zookeeper.enabled) -}}
   {{ template "pulsar.zookeeper.service" . }}:{{ 
.Values.zookeeper.ports.client }}
   {{- end -}}
   {{- if and .Values.tls.enabled .Values.tls.zookeeper.enabled -}}
   {{ template "pulsar.zookeeper.service" . }}:{{ 
.Values.zookeeper.ports.clientTls }}
   {{- end -}}
   {{- end -}}
   {{- end -}}
   ```
   
   So I try to set userProvidedZookeepers
   ```
   pulsar_metadata:
     configurationStore: pulsar-cs-zookeeper
     configurationStoreMetadataPrefix: "/configuration-store"
     userProvidedZookeepers: 
"pulsar-mini-zookeeper.pulsar.svc.cluster.local:2181"
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to