Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default pulsar stanalone behavior #1152

Closed
aahmed-se opened this issue Jan 30, 2018 · 4 comments
Closed

Change default pulsar stanalone behavior #1152

aahmed-se opened this issue Jan 30, 2018 · 4 comments
Labels
type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages

Comments

@aahmed-se
Copy link
Contributor

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.

@merlimat merlimat added the type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages label Feb 7, 2018
@merlimat
Copy link
Contributor

merlimat commented 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.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.

@EronWright
Copy link
Contributor

EronWright commented 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
Copy link
Contributor

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

@EronWright
Copy link
Contributor

EronWright commented 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 that PulsarStandaloneStarter does the following:

} else if (isBlank(config.getAdvertisedAddress()) && isBlank(config.getAdvertisedListeners())) {
// Use advertised address as local hostname
config.setAdvertisedAddress("localhost");

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

No branches or pull requests

3 participants