提交 f95c71f2 编写于 作者: M Matteo Merli 提交者: Guangning

Make standalone to advertise "localhost" to avoid failure when hostname is not resolvable (#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.
上级 88fc4541
......@@ -67,7 +67,7 @@ public class PulsarStandaloneStarter extends PulsarStandalone {
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
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册