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