2 Replies Latest reply on Apr 24, 2016 6:56 PM by Radoslav Husar

    Wildfly 10 not load balancing to other host

    Humberto Ferreira da Luz Jr. Novice

      I followed these instructions from Stuart Douglas video.

       

      It worked like in the video. But then, instead of adding the 3rd backend server to the same host, I created another host and added the backend3 server to it, which was also added the backend-servers group.

       

      I started the 2nd host as a slave and I could access the clustering-demo using its ip and the backend3 port. Besides the host controller was able to register the slave:

       

      [Host Controller] 10:05:52,198 INFO  [org.jboss.as.domain.controller] (Host Controller Service Threads - 56) WFLYHC0019: Registered remote slave host "srv217", JBoss WildFly Full 10.0.0.Final (WildFly 2.0.10.Final)
      

       

      However, when I accessed the main server, the load was still being balanced only to backend1 and backend2.

      I tried to stop both and let only backend3 started, but then I couldn't access clustering-demo through the load balancer anymore.

       

      Anyone know if an addicional configuration is required for the load balancer to work with a slave host?

        • 1. Re: Wildfly 10 not load balancing to other host
          Humberto Ferreira da Luz Jr. Novice

          I'm adding my host controller and slave log.

           

          Host controller: master log - Pastebin.com

           

          Slave: slave log - Pastebin.comhttp://pastebin.com/TMZtpt3U

           

          These lines caught my attention:

           

          [Server:backend2] 08:56:58,956 INFO  [org.infinispan.CLUSTER] (remote-thread--p7-t1) ISPN000310: Starting cluster-wide rebalance for cache clustering-demo.war, topology CacheTopology{id=1, rebalanceId=1, currentCH=DefaultConsistentHash{ns=80, owners = (1)[master:backend2: 80+0]}, pendingCH=DefaultConsistentHash{ns=80, owners = (2)[master:backend2: 40+40, master:backend1: 40+40]}, unionCH=null, actualMembers=[master:backend2, master:backend1]}

          [Server:backend2] 08:56:59,023 INFO  [org.infinispan.CLUSTER] (remote-thread--p7-t1) ISPN000310: Starting cluster-wide rebalance for cache routing, topology CacheTopology{id=1, rebalanceId=1, currentCH=DefaultConsistentHash{ns=80, owners = (1)[master:backend2: 80+0]}, pendingCH=DefaultConsistentHash{ns=80, owners = (2)[master:backend2: 40+40, master:backend1: 40+40]}, unionCH=null, actualMembers=[master:backend2, master:backend1]}

          [Server:backend2] 08:56:59,376 INFO  [org.infinispan.CLUSTER] (remote-thread--p7-t2) ISPN000336: Finished cluster-wide rebalance for cache clustering-demo.war, topology id = 1

           

          It seems to confirm that slave:backend3 is not detected.

          • 2. Re: Wildfly 10 not load balancing to other host
            Radoslav Husar Master

            However, when I accessed the main server, the load was still being balanced only to backend1 and backend2.

            Let me just note here that if you are using sticky sessions (which mod_cluster uses by default) the existing sessions will be routed to the same nodes, so you should create new sessions to see if they are load balanced to the 3rd member. This is probably not a problem but just thought I should mention it.

             

            actualMembers=[master:backend2, master:backend1]}

             

            Right, as you say, the backend3 did not join the cluster and neither did it register with the mod_cluster load-balancer since no sessions are routed to it. There can be bunch of issues but its most certainly a misconfiguration on your side. When you say:

             

            instead of adding the 3rd backend server to the same host, I created another host and added the backend3 server to it

             

            do you mean another physical machine? In that case if you be clear that the servers will not be discovered as the nodes are bound to localhost (127.0.0.1).

             

            If not double check your configuration, make sure the app is deployed, port offset is configured, etc...