简体   繁体   中英

Mod_cluster Manager cant access nodes

I have installed WildFly10 and started it in domain mode with two servers with port ofsset 100 and 200.

I have configured Apache HTTPD 2.4 and Mod_cluster Manager 1.3.1 with VirtualHost listening on port 8080 and ServerName test-cluster.

When I visit the test-cluster:8080/mod_cluster_manager everything works fine. When I change the listening port in Mod_cluster Manager to 80, restart the Apache and visit test-cluster/mod_cluster_manager I can see the page, but there are no JBoss/WildFly server nodes register...

What could be the problem?

UDP Multicat advertisement and interfaces

Suppose your Apache HTTP Server listens on all of your interfaces (0.0.0.0), and that means, for the EnableMCPMReceive VirtualHost, that it has to pick one address to send out via UDP Multicast. This address is the one Wildfly will try to contact.

If Wildfly cannot find the Apache HTTP Server, I suggest you add two more specific settings to your Apache HTTP Server configuration to debug the problem:

ServerAdvertise On http://pick_ip_address_wildfly_can_access:6666

The aforementioned directive (used instead of ServerAdvertise On ) makes sure that a deterministic, expected address:port is sent via UDP Multicast. If you test on your Wildfly machine with Advertize.java utility, you should see something like this:

karm@wildfly-box:~/Projects/MOD_CLUSTER$ java Advertize 224.0.1.105 23364 10.10.10.11

Linux like OS
ready waiting...
received: HTTP/1.0 200 OK
Date: Tue, 31 May 2016 07:51:00 GMT
Sequence: 11
Digest: f23cf884bce70445742540dd84e1a060
Server: 2eceb85a-2704-11e6-9b43-e7ff3db3d039
X-Manager-Address: pick_ip_address_wildfly_can_access:6666
X-Manager-Url: /2eceb85a-2704-11e6-9b43-e7ff3db3d039
X-Manager-Protocol: http
X-Manager-Host: localhost.localdomain
  • 224.0.1.105 - the first argument is a UDP Multicast address the Apache HTTP Server sends datagrams to
  • 23364 - the second argument is a port used for it
  • 10.10.10.11 - the last argument is an IP address of the interface that receives data from the same network Apache HTTP Server advertises to - which could be set on Apache HTTP Server side with AdvertiseBindAddress directive, see below. It means that "pick_ip_address_wildfly_can_access" must be something that can talk to 10.10.10.11; eg 10.10.10.13, if they are both on eg interface em1 or eth0 on respective servers.

AdvertiseBindAddress 10.10.10.13:23364

As you can see in the aforementioned directive, we explicitly picked the interface that is bound to 10.10.10.13 address on the Apache HTTP Server, ie our "ip_address_wildfly_can_access". The port is not arbitrary, it is the same one used in the undermentioned directives.

The equivalent on Wildfly side is interface="public" attribute -- which is the default for socket bindings. If you wish to set modcluster socket binding to listen for UDP multicast on a different interface - change it.

The undermentioned AdvertiseGroup directive is an auxiliary one in the default case - you don't need to set it as you use the default. It must match what you have in your modcluster socketbinding:

AdvertiseGroup 224.0.1.105:23364

<socket-binding name="modcluster" port="0" multicast-address="224.0.1.105" multicast-port="23364"/>

I hope it is clear now, that any NAT or port mapping on router, or iptables or other network shenanigans could easily affect your configuration.

  • Apache HTTP Server must advertise on an interface Wildfly listens on,
  • Apache HTTP Server must advertise an address Wildfly can access and
  • Wildfly must report back its address and port Apache HTTP Server can access

I found the solution. You need to modify iptables to open broadacast address on which JBoss/WildFly is broadcasting the messages to the cluster.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM