Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.pulsar.broker.ServiceConfiguration;
import org.apache.pulsar.broker.ServiceConfigurationUtils;
import org.apache.pulsar.common.configuration.PulsarConfigurationLoader;
import org.apache.pulsar.docs.tools.CmdGenerateDocs;
import picocli.CommandLine;
Expand Down Expand Up @@ -91,8 +92,12 @@ public PulsarStandaloneStarter(String[] args) throws Exception {
// Use advertised address from command line
config.setAdvertisedAddress(this.getAdvertisedAddress());
} else if (isBlank(config.getAdvertisedAddress()) && isBlank(config.getAdvertisedListeners())) {
// Use advertised address as local hostname
config.setAdvertisedAddress("localhost");
try {
config.setAdvertisedAddress(ServiceConfigurationUtils.unsafeLocalhostResolve());
} catch (Exception e) {
log.warn("Failed to resolve FQDN, using 'localhost' as advertised address", e);
config.setAdvertisedAddress("localhost");
}
} else {
// Use advertised or advertisedListeners address from config file
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public PulsarContainer() {
public PulsarContainer(final String pulsarVersion) {
super(pulsarVersion);
withExposedPorts(BROKER_HTTP_PORT, PULSAR_PORT);
withCommand("/pulsar/bin/pulsar standalone");
withCommand("/pulsar/bin/pulsar standalone --advertised-address localhost");
waitingFor(new HttpWaitStrategy()
.forPort(BROKER_HTTP_PORT)
.forStatusCode(200)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public PulsarContainer() {
public PulsarContainer(final String pulsarVersion) {
super(pulsarVersion);
withExposedPorts(BROKER_HTTP_PORT, PULSAR_PORT);
withCommand("/pulsar/bin/pulsar standalone");
withCommand("/pulsar/bin/pulsar standalone --advertised-address localhost");
waitingFor(new HttpWaitStrategy()
.forPort(BROKER_HTTP_PORT)
.forStatusCode(200)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public PulsarContainer() {
public PulsarContainer(final String pulsarVersion) {
super(pulsarVersion);
withExposedPorts(BROKER_HTTP_PORT, PULSAR_PORT);
withCommand("/pulsar/bin/pulsar standalone");
withCommand("/pulsar/bin/pulsar standalone --advertised-address localhost");
waitingFor(new HttpWaitStrategy()
.forPort(BROKER_HTTP_PORT)
.forStatusCode(200)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public StandaloneContainer(String clusterName, String pulsarImageName) {
@Override
protected void configure() {
super.configure();
setCommand("standalone");
setCommand("standalone --advertised-address localhost");
addEnv("PULSAR_MEM", "-Xms128M -Xmx1g -XX:MaxDirectMemorySize=1g");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public PulsarContainer() {
public PulsarContainer(final String pulsarVersion) {
super(pulsarVersion);
withExposedPorts(BROKER_HTTP_PORT, PULSAR_PORT);
withCommand("/pulsar/bin/pulsar standalone");
withCommand("/pulsar/bin/pulsar standalone --advertised-address localhost");
waitingFor(new HttpWaitStrategy()
.forPort(BROKER_HTTP_PORT)
.forStatusCode(200)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public PulsarContainer() {
public PulsarContainer(final String pulsarVersion) {
super(pulsarVersion);
withExposedPorts(BROKER_HTTP_PORT, PULSAR_PORT);
withCommand("/pulsar/bin/pulsar standalone");
withCommand("/pulsar/bin/pulsar standalone --advertised-address localhost");
waitingFor(new HttpWaitStrategy()
.forPort(BROKER_HTTP_PORT)
.forStatusCode(200)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public PulsarContainer() {
public PulsarContainer(final String pulsarVersion) {
super(pulsarVersion);
withExposedPorts(BROKER_HTTP_PORT, PULSAR_PORT);
withCommand("/pulsar/bin/pulsar standalone");
withCommand("/pulsar/bin/pulsar standalone --advertised-address localhost");
waitingFor(new HttpWaitStrategy()
.forPort(BROKER_HTTP_PORT)
.forStatusCode(200)
Expand Down
Loading