pulsar-helm-chart icon indicating copy to clipboard operation
pulsar-helm-chart copied to clipboard

Deploy apache pulsar with external zookeeper

Open spesalvi opened this issue 11 months ago • 3 comments

Hi All,

I have a zookeeper instance configured in a different namespace. I want to deploy the apache pulsar and use the zookeeper instance that I have in the other namespace.

In the values.yaml file i see an option to disable zookeeper. When I disable that, zookeeper instance is not created.

I also provided externalZookeeperServerList with my external zookeeper endpoints.

Now I notice that externalZookeeperServerList is used when zookeeper component is enabled. So, my zookeeper endpoints are not use by the helm chart and bookie and broker are always trying to connect to 127.0.0.1:2181.

Is there a way to configure pulsar to use external zookeeper instead.

Thanks, Robert

spesalvi avatar Jan 28 '25 13:01 spesalvi

@spesalvi Yes, that's possible. Just don't specify externalZookeeperServerList since there's a different purpose for that setting. Instead, use userProvidedZookeepers.

https://github.com/apache/pulsar-helm-chart/blob/afca5aaf08c02d011f7f8eaadfb19634eab6f6bb/charts/pulsar/values.yaml#L898-L901

lhotari avatar Feb 28 '25 18:02 lhotari

Reopening this since there seems to be changed which cause userProvidedZookeepers not to work as expected.

lhotari avatar Feb 28 '25 18:02 lhotari

It looks like the gap is about initializing the cluster metadata automatically. That only happens if you deploy the Zookeeper component. You will need to initialize the cluster metadata manually. Essentially handling this command manually: https://github.com/apache/pulsar-helm-chart/blob/afca5aaf08c02d011f7f8eaadfb19634eab6f6bb/charts/pulsar/templates/pulsar-cluster-initialize.yaml#L123-L139 . by running ./bin/pulsar initialize-cluster-metadata from a machine that can access the target Zookeeper.

lhotari avatar Feb 28 '25 18:02 lhotari