-
1. Re: Can't register when machine has 2 IPs
mbabacek May 2, 2016 10:19 AM (in response to bill.burke)Dear Bill, it is a known issue caused by the Undertow mod_cluster proxy lying to the workers about its true location in the network: see [UNDERTOW-704] Undertow mod_cluster: Multiinterface box: Manager-Address always contains hostname - JBoss Issue Tracker
You could work-around that by editing your /etc/hosts and creating different hostnames for your IP addresses.
-
2. Re: Can't register when machine has 2 IPs
bill.burke May 2, 2016 1:26 PM (in response to mbabacek)I would submit a PR, but I can't seem to figure out where the registration message gets sent. Point me to the class if you can and I'll do the rest
-
3. Re: Can't register when machine has 2 IPs
mbabacek May 2, 2016 2:03 PM (in response to bill.burke)The message in question is generated here; the root cause is IMHO getHostString usage of InetSocketAddress.
The hostname that I think would better be off as an IP address if user explicitly wanted to use IP address comes from Wildfly configuration in ModClusterService. This is the SocketBinding class.
In my opinion, it is not desirable to change the way InetAddress is handled. I would leave it as it is and I would suggest adding an option to overwrite the Manager-Address with whatever user wants in the Undertow subsystem mod_cluster filter configuration. WDYT, swd847 ?
-
4. Re: Can't register when machine has 2 IPs
bill.burke May 2, 2016 2:24 PM (in response to mbabacek)I think it should use whatever interface is provided by the undertow subsystem. This stuff is already hard to figure out how to install. Reducing the number of moving parts is needed.
-
5. Re: Can't register when machine has 2 IPs
mbabacek May 4, 2016 7:34 AM (in response to bill.burke)That is not a correct approach. In production environments, it is common to have the balancer bound to an Internet facing NIC for processing client's requests and to an internal network NIC for processing mod_cluster workers' MCMP service messages and communicating with workers.
As I think about it, In the Undertow mod_cluster Proxy implementation, it should be possible to use two socket-bindings (with different interface attributes): one for the client - balacner communication and the other for worker - balancer communication. I have to take a look whether it could be achieved with the current code by configuring more Undertow hosts with different socket-bindings.
The possibility to alter X-Manager-Address and X-Manager-Host via a direct configuration still seems plausible to me though.
-
6. Re: Can't register when machine has 2 IPs
swd847 May 4, 2016 7:16 PM (in response to mbabacek)Mod_cluster already supports specifying the binding, the underlying issue here is that both NIC's resolve to the same hostname, which means that we advertise the host name it is not clear which one the client should connect to. This sort of issue should not really happen on production servers, as both NIC's should have separate host names (hopefully).
I talked to JFC and apparently sending the host name is by design, I'm not really sure how big a deal this is as it only affects multi homed machines where the NIC's share a hostname.
-
7. Re: Can't register when machine has 2 IPs
mbabacek May 5, 2016 5:08 AM (in response to swd847)In my mind, this is probably mostly a developer workstation thing. I hit the issue for the exactly same reason: having multiple NICs and a single hostname.
It is noteworthy though that Apache HTTP Server mod_cluster does let you use IP addresses and does not perform any shenanigans with resolving them to hostnames if you don't wish it to.
Most importantly, Apache HTTP Server mod_cluster implementation lets you set the Manager-Url explicitly if you wish to, see X-Manager-Url:
If I am not mistaken, Undertow does not let you set any explicit address.
IMHO, It is important to let users do that not only because of IP/hostname problem but also to allow them to solve situation where balancer appears to workers be reachable from a different network than it itself "thinks" it is in.