Troubleshooting Pulsar - sedgewickmm18/microk8s-spark-pulsar-etc GitHub Wiki

Zookeeper

I had to expose my zookeeper service as Loadbalancer instead of an internal ClusterIP. Save the json document of the service to a file with

microk8s kubectl -n pulsar get svc silly-cardinal-pulsar-zookeeper -o json zookeeper.json

Modify the zookeeper.json file

    "spec": {
        "clusterIP": "10.152.183.123",
        "clusterIPs": [
            "10.152.183.123"
        ],
...
        "type": "LoadBalancer"
...

and delete and recreate the service as LoadBalancer

microk8s kubectl -n pulsar delete svc silly-cardinal-pulsar-zookeeper
microk8s kubectl -n pulsar apply -f ../mmfunctions/zookeeper.json

Now you can run the following commands from the pulsar directory.

bin/pulsar zookeeper-shell -server 10.152.183.123:2181 ls -R /managed-ledgers/public/default

to find all known metadata entries in zookeeper. With that info we can look for the ledgers that back up a topic.

../pulsar/bin/pulsar-managed-ledger-admin print-managed-ledger -zk "10.152.183.123:2181" -mlp public/default/persistent/sentences
ledgerInfo {
  ledgerId: 117
  timestamp: 0
}