From 6f04b457735bb6d511332cdcc3b0dabf302bf775 Mon Sep 17 00:00:00 2001 From: Joe Gresock Date: Fri, 11 Jun 2021 16:58:20 -0400 Subject: [PATCH] NIFI-8643: Correcting nifi.cluster.load.balance.address in properties (#5146) NIFI-8643: Correcting nifi.cluster.load.balance.address in properties --- .../nifi/bootstrap/util/SecureNiFiConfigUtil.java | 2 +- .../src/test/resources/nifi.properties.dns-sans | 2 +- .../src/test/resources/nifi.properties.ip-sans | 2 +- .../java/org/apache/nifi/util/NiFiProperties.java | 14 +++++++------- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/util/SecureNiFiConfigUtil.java b/nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/util/SecureNiFiConfigUtil.java index bb1abeee92..2c2007eb16 100644 --- a/nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/util/SecureNiFiConfigUtil.java +++ b/nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/util/SecureNiFiConfigUtil.java @@ -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); diff --git a/nifi-bootstrap/src/test/resources/nifi.properties.dns-sans b/nifi-bootstrap/src/test/resources/nifi.properties.dns-sans index 3ad1c9fb1b..49f93eb014 100644 --- a/nifi-bootstrap/src/test/resources/nifi.properties.dns-sans +++ b/nifi-bootstrap/src/test/resources/nifi.properties.dns-sans @@ -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= diff --git a/nifi-bootstrap/src/test/resources/nifi.properties.ip-sans b/nifi-bootstrap/src/test/resources/nifi.properties.ip-sans index 8a759e52e1..45df5d2a42 100644 --- a/nifi-bootstrap/src/test/resources/nifi.properties.ip-sans +++ b/nifi-bootstrap/src/test/resources/nifi.properties.ip-sans @@ -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= diff --git a/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java b/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java index fdf473ec3e..8c8e2fbc29 100644 --- a/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java +++ b/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java @@ -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); }