4 Replies Latest reply on Nov 23, 2016 4:42 PM by emeuwese

    Domain with load-balancer and worker nodes on single host?

    _bojan

      Hi,

      I am trying to set up a domain with a load balancer and two worker instances on the same host for testing purposes.

      According to WildFly 10.1 is now available! · WildFly,

      'You can now build a fully clustered topology using just our default profiles in domain mode, creating a server with the "load-balancer" profile, and a set of backend servers using the "full-ha" profile."

      It does not mention anything about the number of hosts, so I am trying to see if this works on a single host, i.e. master.

       

      I followed a tutorial by karm  over at Undertow mod_cluster proxy: Basic setup in Wildfly 10 - asciinema and was able to set up  a similar scenario using 3 standalone instances on a single machine, where one acts as mod-cluster balancer. But since domain mode already has the load-balancer profile, I figured it would be easy to do in domain mode.

       

      I downloaded Wildfly 10.1, started up the domain and removed default server groups from the domain.

      I created a lb-group, with load-balancer profile and load-balancer-sockets, as well as app-nodes group, with full-ha profile and full-ha-sockets.

      I then created a load-balancer server in lb-group with port offset of 0.

      In app-nodes group, I created two worker instances, server-one and server-two with port offsets of 100 and 200, respectively.

      I deployed a sample.war and assigned it to app-nodes group. I can access http://localhost:8180/sample and http://localhost:8280/sample fine, but when I try to use the load balancer, http://localhost:8080/sample, I get a 404 error.

       

      Log messages relating to modcluster on load-balancer instance:

      Undertow starts mod_cluster proxy advertisements on /224.0.1.105:23364 with frequency 10000 ms
      

      and on app-nodes instances:

       INFO  [org.jboss.modcluster] (ServerService Thread Pool -- 69) MODCLUSTER000001: Initializing mod_cluster version 1.3.3.Final
       INFO  [org.jboss.modcluster] (ServerService Thread Pool -- 69) MODCLUSTER000032: Listening to proxy advertisements on /224.0.1.105:23364
      

       

      I tried different port offsets, as well as using ha-profile instead of full-ha for worker instances, but the result is the same.

      How can I get this up and running? Any help is greatly appreciated.

        • 1. Re: Domain with load-balancer and worker nodes on single host?
          rhatlapa

          It probably just doesn't work because you are running the servers on localhost. Please try to run them on your public IP addresses and see if that helps.

          • 2. Re: Domain with load-balancer and worker nodes on single host?
            _bojan

            Hi,

            Thanks for the reply.

            I tried in a few different ways; via Docker containers and physical machines, but I could not get load balancer to work in domain mode with load-balancer profile, even when the balancer instance is on a different host than the domain controller. I still get a 404 when accessing the application.

            These methods used to work when I would use Apache with mod_cluster module, but I would really like to use Undertow instead.

            I will try to see what is different about domain mode load-balancer profile and the configuration from karm's tutorial for standalone mode.

            If I figure it out, I will post the answer. If anyone has any other suggestions, I am all in for trying out different approaches.

            Thanks.

            • 3. Re: Domain with load-balancer and worker nodes on single host?
              _bojan

              I found what was causing the problem.

              In load-balancer-sockets binding group, binding for modcluster was tied to private interface. I removed interface="private" and the balancer could register the nodes via ajp.

               

              Hope it may help save someone some time when setting up a local testing environment.

              1 of 1 people found this helpful
              • 4. Re: Domain with load-balancer and worker nodes on single host?
                emeuwese

                I experienced this too. With the interface from mcmp-management and modcluster set to public I got it working.

                domain.xml:

                <socket-binding-groups>
                     ...
                     <socket-binding-group name="load-balancer-sockets" default-interface="public">
                          ...
                          <socket-binding name="mcmp-management" interface="public" port="${jboss.mcmp.port:8090}"/>
                          <socket-binding name="modcluster" interface="public" multicast-address="224.0.1.105" multicast-port="23364"/>
                          ...
                     </socket-binding-group>
                </socket-binding-groups>