Skip to content

Change default pulsar stanalone behavior #1152

Closed

Description

@aahmed-se

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.

Activity

  1. added
    type/enhancement
    on Feb 7, 2018
  2. merlimat commented on Feb 7, 2018

    @merlimat
    Contributor

    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.

  3. added this to the 2.0.0-incubating milestone on Feb 7, 2018
  4. EronWright commented on Sep 15, 2021

    @EronWright
    Contributor

    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.

  5. merlimat commented on Sep 15, 2021

    @merlimat
    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

  6. EronWright commented on Sep 15, 2021

    @EronWright
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions