[ https://issues.apache.org/jira/browse/NIFI-10221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David Handermann resolved NIFI-10221. ------------------------------------- Assignee: David Handermann Resolution: Won't Fix [~Kirhold] ListSFTP and other many other Processors rely on standard Java DNS resolution to select the IP address for the connection. The JVM caches DNS responses using configurable timeouts, which can be adjusted using system properties. At a general level, however, DNS-based round robin load balancing also requires clients to interpret responses and attempt multiple connections. The following question and answer describe some reasons why a load balancing solution based solely on DNS is not ideal: https://serverfault.com/questions/60553/why-is-dns-failover-not-recommended Supporting this kind of approach would require custom control over DNS lookups, and custom client code to try all addresses. With this background, it does not seem like something that should be supported in standard components. Feel free to follow up with additional feedback if you have additional details about the potential use case, which could be generally applicable. > Nifi does not respect multirecord domain in hostname field. > ----------------------------------------------------------- > > Key: NIFI-10221 > URL: https://issues.apache.org/jira/browse/NIFI-10221 > Project: Apache NiFi > Issue Type: Bug > Affects Versions: 1.16.0 > Reporter: Wiktor Kubicki > Assignee: David Handermann > Priority: Major > > *Short description:* > Using DNS we are able to add multiple A records with several IP addresses to > domain, but Nifi use always only (first?) one. > > *Background:* > We can add multiple A records in DNS to provide round robin "load balancer", > which can also be used as failover server in Active - Active server schema. A > good example of that implementation is there: [How To Configure DNS > Round-Robin Load-Balancing For High-Availability | > DigitalOcean|https://www.digitalocean.com/community/tutorials/how-to-configure-dns-round-robin-load-balancing-for-high-availability]. > We use this solution to provide address to our two sFTP servers in different > geographical locations. > > {*}How it works now{*}: > When i put domain into hostname field in listSFTP, Nifi will solve DNS and > obtain only one address (probably the first one but i cannot comfirm) and > connect to it. But when this one IP is unreachable, NiFi will not try with > second one nor try the second one in any next run. > > *How it should works:* > Addresses should be used randomly (round robin), and if one is unavailable, > then in the same run should be tried another one till end of IP's or > successful connection. > > {*}Example{*}: > Using sftp client (OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017) i can > connect to host by domain, even if one of IP addresses is down: > > {code:java} > $ sftp -vvv -oPort=22 u...@example.com > OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017 > debug1: Reading configuration data /XXX/.ssh/config > debug1: Reading configuration data /etc/ssh/ssh_config > debug1: /etc/ssh/ssh_config line 58: Applying options for * > debug2: resolving "example.com" port 22 > debug2: ssh_connect_direct: needpriv 0 > debug1: Connecting to example.com [X.X.X.203] port 22. > debug1: connect to address X.X.X.203 port 22: Connection refused > debug1: Connecting to example.com [Y.Y.Y.123] port 22. > debug1: Connection established.{code} > As you can see, sftp tries to connect to first, when connections refused then > it try to second one with success. And that's how it should work in NiFi > -- This message was sent by Atlassian Jira (v8.20.10#820010)