pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

[Bug] Pulsar standalone does not read the Zookeeper port form zookeeper.conf

Open lk-1984 opened this issue 3 years ago • 3 comments

Search before asking

  • [X] I searched in the issues and found nothing similar.

Version

Docker version 20.10.23, build 7155243 Docker Compose version v2.15.1 Apache Pulsar 2.9.3 Ubuntu 22.04

Minimal reproduce step

Change the port for Zookeeper in zookeeper.conf

https://github.com/apache/pulsar/blob/master/conf/zookeeper.conf#L31

and then start up the Pulsar in standalone mode:

entrypoint: ["bin/pulsar", "standalone"]

What did you expect to see?

Zookeeper listening at port 2182.

What did you see instead?

Zookeeper still listening at port 2181.

The zookeeper.conf in the docker container did have the new port, 2182.

Anything else?

No response

Are you willing to submit a PR?

  • [X] I'm willing to submit a PR!

lk-1984 avatar Mar 13 '23 17:03 lk-1984

In Pulsar standalone you can configure the zookeeper port by passing the arg --zookeeper-port:

PULSAR_STANDALONE_USE_ZOOKEEPER=1 bin/pulsar standalone --zookeeper-port 2182

nicoloboschi avatar Mar 13 '23 18:03 nicoloboschi

In Pulsar standalone you can configure the zookeeper port by passing the arg --zookeeper-port:

PULSAR_STANDALONE_USE_ZOOKEEPER=1 bin/pulsar standalone --zookeeper-port 2182

Sure, but this is not about that argument. It's about the configuration file.

lk-1984 avatar Mar 14 '23 07:03 lk-1984

@lk-1984 It's by design. Standalone server doesn't act as prod server.

It reads only conf/standalone.conf and for configuring zookeeper's port, the priority is:

https://github.com/apache/pulsar/blob/cda2827acbe62ba6c5a4dd98dbee7c9a82548339/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandaloneStarter.java#L94-L110

tisonkun avatar Mar 27 '23 14:03 tisonkun