mirror of https://github.com/apache/nifi.git
NIFI-8643: Correcting nifi.cluster.load.balance.address in properties (#5146)
NIFI-8643: Correcting nifi.cluster.load.balance.address in properties
This commit is contained in:
parent
38cf25c7cf
commit
6f04b45773
|
@ -156,7 +156,7 @@ public class SecureNiFiConfigUtil {
|
|||
addSubjectAlternativeName(nifiProperties, NiFiProperties.REMOTE_INPUT_HOST, dnsSubjectAlternativeNames);
|
||||
addSubjectAlternativeName(nifiProperties, NiFiProperties.WEB_HTTPS_HOST, dnsSubjectAlternativeNames);
|
||||
addSubjectAlternativeName(nifiProperties, NiFiProperties.WEB_PROXY_HOST, dnsSubjectAlternativeNames);
|
||||
addSubjectAlternativeName(nifiProperties, NiFiProperties.LOAD_BALANCE_ADDRESS, dnsSubjectAlternativeNames);
|
||||
addSubjectAlternativeName(nifiProperties, NiFiProperties.LOAD_BALANCE_HOST, dnsSubjectAlternativeNames);
|
||||
|
||||
// Not necessary to add as a SAN
|
||||
dnsSubjectAlternativeNames.remove(LOCALHOST_NAME);
|
||||
|
|
|
@ -20,7 +20,7 @@ nifi.flow.configuration.file=./target/flow.xml.gz
|
|||
|
||||
nifi.remote.input.host=remote-host
|
||||
nifi.web.proxy.host=proxy-host
|
||||
nifi.cluster.load.balance.address=cluster-host
|
||||
nifi.cluster.load.balance.host=cluster-host
|
||||
|
||||
# web properties #
|
||||
nifi.web.http.host=
|
||||
|
|
|
@ -20,7 +20,7 @@ nifi.flow.configuration.file=./target/flow.xml.gz
|
|||
|
||||
nifi.remote.input.host=1.2.3.4
|
||||
nifi.web.proxy.host=1.2.3.5
|
||||
nifi.cluster.load.balance.address=1.2.3.6
|
||||
nifi.cluster.load.balance.host=1.2.3.6
|
||||
|
||||
# web properties #
|
||||
nifi.web.http.host=
|
||||
|
|
|
@ -247,7 +247,7 @@ public class NiFiProperties extends ApplicationProperties {
|
|||
public static final String FLOW_ELECTION_MAX_CANDIDATES = "nifi.cluster.flow.election.max.candidates";
|
||||
|
||||
// cluster load balance properties
|
||||
public static final String LOAD_BALANCE_ADDRESS = "nifi.cluster.load.balance.address";
|
||||
public static final String LOAD_BALANCE_HOST = "nifi.cluster.load.balance.host";
|
||||
public static final String LOAD_BALANCE_PORT = "nifi.cluster.load.balance.port";
|
||||
public static final String LOAD_BALANCE_CONNECTIONS_PER_NODE = "nifi.cluster.load.balance.connections.per.node";
|
||||
public static final String LOAD_BALANCE_MAX_THREAD_COUNT = "nifi.cluster.load.balance.max.thread.count";
|
||||
|
@ -821,16 +821,16 @@ public class NiFiProperties extends ApplicationProperties {
|
|||
|
||||
public InetSocketAddress getClusterLoadBalanceAddress() {
|
||||
try {
|
||||
String address = getProperty(LOAD_BALANCE_ADDRESS);
|
||||
if (StringUtils.isBlank(address)) {
|
||||
address = getProperty(CLUSTER_NODE_ADDRESS);
|
||||
String host = getProperty(LOAD_BALANCE_HOST);
|
||||
if (StringUtils.isBlank(host)) {
|
||||
host = getProperty(CLUSTER_NODE_ADDRESS);
|
||||
}
|
||||
if (StringUtils.isBlank(address)) {
|
||||
address = "localhost";
|
||||
if (StringUtils.isBlank(host)) {
|
||||
host = "localhost";
|
||||
}
|
||||
|
||||
final int port = getIntegerProperty(LOAD_BALANCE_PORT, DEFAULT_LOAD_BALANCE_PORT);
|
||||
return InetSocketAddress.createUnresolved(address, port);
|
||||
return InetSocketAddress.createUnresolved(host, port);
|
||||
} catch (final Exception e) {
|
||||
throw new RuntimeException("Invalid load balance address/port due to: " + e, e);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue