5 Replies Latest reply on Nov 21, 2015 8:55 PM by jbertram

    HornetQ, Wildfly Domain Mode, HA and/or Load Balancing

    jlar310

      In a Wildfly managed domain, all servers share the same configuration from the domain controller's domain.xml file.

       

      Question 1: How are you supposed to do HornetQ HA under Wildfly Domain mode when they share the same configuration. If you wanted a live/backup pair, how would you configure it?

       

      Question 2: What if I want both HA and Load Balancing? Can HornetQ even do this? I've read the docs, Chapter 38 (Clusters) and Chapter 39 (HA), but there is absolutely no discussion on how one might achieve failover in a load-balancing cluster. When I set up a Wildfly cluster using the out-of-the-box "full-ha" profile (wildfly 8.2.0 final) , my client EJB calls will fail over to another node when one is shut down, but the JMS client operations just complain via log4j DEBUG level "Main server is not up. Hopefully there's a backup configured now" after one server is shut down.

       

      I would gladly RTFM if I could just find the right FM!!!

       

      Google hasn't been much help because the word "domain" appears dozens of times in the standalone configuration files so there are mostly false positives.

       

      I'm coming from running ActiveMQ inside JBoss 4.2.3 where HA and load balancing were one in the same. It just plain worked. I would really like to avoid the extra work of integrating ActiveMQ with Wildfly, but I just can't seem to get HornetQ to do what I want.

        • 1. Re: HornetQ, Wildfly Domain Mode, HA and/or Load Balancing
          jbertram

          In domain mode you can pass system properties to each host so even though they use the same config they can have unique configurations per host.  See here for more details.

           

          In simple terms, HornetQ HA is provided via a live-backup pair and load-balancing is provided via a cluster.  If you want both HA and load-balancing then you will need 2 live-backup pairs clustered together.  There are several ways to do this.  First, you can have 4 instances of Wildfly each configured with 1 instance of HornetQ each as a live or a backup which all part of the same cluster.  This is typically called a "dedicated" topology.  Second, you can have 2 instances of Wildfly each configured with 2 instances of HornetQ (i.e. both a live and a backup in the same instance of Wildfly).  This is called a "colocated" topology and there's an example of this shipped in <WILDFLY_HOME>/docs/examples/configs/standalone-hornetq-colocated.xml.

          • 2. Re: HornetQ, Wildfly Domain Mode, HA and/or Load Balancing
            jlar310

            Thank you. Collocation is the search term that eluded me. Not as clean a solution as I was hoping for, but it looks like it will work. I considered using system properties to designate a backup, but in the Web console, the option is a check-box so I feared a system property value would get overwritten if not careful.

            • 3. Re: HornetQ, Wildfly Domain Mode, HA and/or Load Balancing
              jbertram

              In future versions the colocation stuff is much simpler (e.g. a live server can spin up a backup in the background with minimal configuration).

              • 4. Re: HornetQ, Wildfly Domain Mode, HA and/or Load Balancing
                cennore

                Hi jbertram,

                 

                Can the example cited at WILDFLY_HOME/docs/examples/configs/standalone-hornetq-colocated.xml be used in configuring the hornetq config in domain.xml for the desired profile in use?

                Also how do I define the backup or live servers in host.xml? I checked the link you posted but really couldn't find anything specifically helpful.

                Would really appreciate if you could post examples or give really clear explanations; apologies but I'm totally new to the world of clustering/load-balancing and trying to find my feet.

                 

                Thanks!

                • 5. Re: HornetQ, Wildfly Domain Mode, HA and/or Load Balancing
                  jbertram

                  Can the example cited at WILDFLY_HOME/docs/examples/configs/standalone-hornetq-colocated.xml be used in configuring the hornetq config in domain.xml for the desired profile in use?

                  I don't see why not.

                   

                  Also how do I define the backup or live servers in host.xml? I checked the link you posted but really couldn't find anything specifically helpful.

                  I'm not sure what you're asking.  If you're using a colocated configuration rather than a dedicated configuration then each Wildfly instance will have a live and a backup so you won't need to make one server a live and one a backup.

                   

                  Would really appreciate if you could post examples or give really clear explanations; apologies but I'm totally new to the world of clustering/load-balancing and trying to find my feet.

                  I don't have the bandwidth to provide step-by-step instructions and examples.  My advice to you would be to start simple.  If you're totally new to this then don't try to tackle a domain configuration or even a colocated configuration right at first.  Start with something simple like a live/backup pair of Wildfly instances and then work up from there.  In other words, don't jump into the deep end if you can't swim.