You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently pulsar in standalone mode expects an advertised address to be passed to use localhost this is unnecessarily complicated , for cases such as docker images it's even more complicated in say osx environments where docker runs inside a linux vm.
Suggestion is to enable default pulsar proxy type configuration for standalone mode so it becomes easier to use.
We should make the Standalone service to behave like the Proxy.
Currently, the Pulsar standalone service is a very regular Pulsar deployment, with 1 broker / 1 bookie / 1 ZK all running in the same JVM.
The normal lookup and redirection for service discovery applies to standalone.
If the "hostname" of the machine where the Standalone service is running is not set, or set to a name that is not in DNS or anyway reachable from other machines, the client will fail.
The user can specify --advertised-address 1.2.3.4 but that sometimes is difficult to diagnose, and it other cases (like dynamic container envs) difficult to set.
If we make the Standalone to force the "proxy" flag in the Connected response, it will make all clients to always connect through the same address they used for the initial connection, removing the need to fix the broker advertised address.
I wonder if an alternative fix would have been to force the proxy flag when no advertised address is configured. This would improve support for advanced configurations in standalone mode, and avoid treating standalone mode as a special case.
That would pose a problem in a typical bare-metal deployment where the advertisedAddress is left empty and it's derived from hostname, but you still don't want to act like a proxy, for efficiency reasons
Here's another possibility, force the proxy flag when in standalone mode and the advertised address is localhost. I observe that PulsarStandaloneStarter does the following:
This would allow standalone mode to support advertised listeners when configured. At the moment, standalone is not really compatible with multiple listeners. I am working on a PR for that.
Activity
merlimat commentedon Feb 7, 2018
We should make the Standalone service to behave like the Proxy.
Currently, the Pulsar standalone service is a very regular Pulsar deployment, with 1 broker / 1 bookie / 1 ZK all running in the same JVM.
The normal lookup and redirection for service discovery applies to standalone.
If the "hostname" of the machine where the Standalone service is running is not set, or set to a name that is not in DNS or anyway reachable from other machines, the client will fail.
The user can specify
--advertised-address 1.2.3.4but that sometimes is difficult to diagnose, and it other cases (like dynamic container envs) difficult to set.If we make the Standalone to force the "proxy" flag in the
Connectedresponse, it will make all clients to always connect through the same address they used for the initial connection, removing the need to fix the broker advertised address.EronWright commentedon Sep 15, 2021
I wonder if an alternative fix would have been to force the proxy flag when no advertised address is configured. This would improve support for advanced configurations in standalone mode, and avoid treating standalone mode as a special case.
merlimat commentedon Sep 15, 2021
That would pose a problem in a typical bare-metal deployment where the
advertisedAddressis left empty and it's derived from hostname, but you still don't want to act like a proxy, for efficiency reasonsEronWright commentedon Sep 15, 2021
Good point.
Here's another possibility, force the proxy flag when in standalone mode and the advertised address is
localhost. I observe thatPulsarStandaloneStarterdoes the following:pulsar/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandaloneStarter.java
Lines 78 to 80 in 5ad4059
This would allow standalone mode to support advertised listeners when configured. At the moment, standalone is not really compatible with multiple listeners. I am working on a PR for that.