Skip to content

Commit

Permalink
Make standalone to advertise "localhost" to avoid failure when hostna…
Browse files Browse the repository at this point in the history
…me is not resolvable (apache#5856)

### Motivation

The standalone service is failing to startup when the hostname is not resolvable to an IP. This is common in laptops. 

The reason is that the function worker in standalone is trying to connect to the advertised address rather than "localhost". 

To fix this, we should make the standalone to always advertise "localhost" as the the broker address. This is ok because in any case the standalone treats the advertisement as the pulsar proxy, in that it forces the clients to always go through the same service url, so a client connecting from a different host won't have problems.
  • Loading branch information
merlimat authored and tuteng committed Jan 4, 2020
1 parent 88fc454 commit f95c71f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public PulsarStandaloneStarter(String[] args) throws Exception {
zkServers = this.getAdvertisedAddress();
} else if (isBlank(config.getAdvertisedAddress())) {
// Use advertised address as local hostname
config.setAdvertisedAddress(ServiceConfigurationUtils.unsafeLocalhostResolve());
config.setAdvertisedAddress("localhost");
} else {
// Use advertised address from config file
}
Expand Down

0 comments on commit f95c71f

Please sign in to comment.