parent
db2caa54cd
commit
ed7f6526b9
|
@ -221,12 +221,10 @@ public class NettyTransport extends AbstractLifecycleComponent<Transport> implem
|
|||
|
||||
@Override
|
||||
protected void doStart() throws ElasticsearchException {
|
||||
boolean success = false;
|
||||
try {
|
||||
clientBootstrap = createClientBootstrap();
|
||||
|
||||
if (!settings.getAsBoolean("network.server", true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (settings.getAsBoolean("network.server", true)) {
|
||||
final OpenChannelsHandler openChannels = new OpenChannelsHandler(logger);
|
||||
this.serverOpenChannels = openChannels;
|
||||
|
||||
|
@ -248,7 +246,7 @@ public class NettyTransport extends AbstractLifecycleComponent<Transport> implem
|
|||
if (DEFAULT_PROFILE.equals(name)) {
|
||||
profileSettings = settingsBuilder()
|
||||
.put(profileSettings)
|
||||
.put("port", profileSettings.get("port", settings.get("port", this.settings.get("transport.tcp.port", DEFAULT_PORT_RANGE))))
|
||||
.put("port", profileSettings.get("port", this.settings.get("transport.tcp.port", DEFAULT_PORT_RANGE)))
|
||||
.build();
|
||||
} else {
|
||||
// if profile does not have a port, skip it
|
||||
|
@ -275,6 +273,13 @@ public class NettyTransport extends AbstractLifecycleComponent<Transport> implem
|
|||
InetSocketAddress publishAddress = createPublishAddress(publishHost, publishPort);
|
||||
this.boundAddress = new BoundTransportAddress(new InetSocketTransportAddress(boundAddress), new InetSocketTransportAddress(publishAddress));
|
||||
}
|
||||
success = true;
|
||||
} finally {
|
||||
if (success == false) {
|
||||
doStop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, BoundTransportAddress> profileBoundAddresses() {
|
||||
|
|
Loading…
Reference in New Issue