9 Replies Latest reply on Mar 3, 2016 5:29 AM by Wolf-Dieter Fink

    Clustering in Domain mode

    Oluwasegun Diyan Newbie

      Hi,

       

      I'm trying to achieve clustering in domain mode using the full-ha profile.

      The idea is to have 2 server groups running on 3 physical servers, each server group having 2 host servers - 1 live and 1 backup.

      All 3 host controllers will then be controlled from a domain controller.

       

      I've managed to get one host controller setup successfully. However I'm lost as to which host server in a server group is the live server and which is the backup.

      When running in standalone mode I could add the <backup>true</backup> tag to the hornetq configuration to assign a server as a backup. I've heard I could use system properties to do the same in domain mode in the host/xml file, however I've not seen any example or real guide on this.

       

      Would appreciate if someone could point me in the right direction.

       

      Thanks!

        • 1. Re: Clustering in Domain mode
          Oluwasegun Diyan Newbie

          Okay so I've been able to configure a domain controller and have setup a single host controller which has connected successfully.

          I can create server-groups and servers via the domain controller on the slave host and on the domain controller itself.

           

          Considering this setup, would I still Apache and mod_cluster or mod_jk to route requests to the hosts or do all requests get forwarded to the domain controller and then the domain controller decides intelligently how to forward these requests to the different hosts on the appropriate server-group?

           

          Considering offsets for each server, must this be unique per host or be unique across all hosts connected to the domain?

           

          Is there a maximum number or advisable maximum number of hosts that can be configured per domain controller?

           

          Please advise!

          • 2. Re: Clustering in Domain mode
            Wolf-Dieter Fink Master

            A domain is not related to cluster, it is a management thing.

            If you configure a server-group, that mean a bunch of servers with the same configuration (like if you copy the standalone*.xml to different standalone instances)

             

            I'm not sure about the HornetQ <backup>, if you can set an instance as backup you need to add this to a different server-group and use a copy of the profile (with changes)

            If there is only one attribute to change, you might use an expression like "${my.boolean.setting:false}" if the property is able to handle it will use my.boolean.setting and if not available default to false.

            You are able to set such properties in the host.xml <server><property> elements

             

            Yes, a server is a server and the domain-controller is a management instance without any application function.

            So you need apache (or other LB) in front of the servers.

            If you use a static protocol you need to add all the servers to apache, a better approach is advertizing like mod_cluster, here the server know where the LB is and send a request to be added/removed from it.

             

            No there is no maximum of hosts/servers, you can add as many you want, but I think it get complex if you have a lot of different configurations

             

            Make sense to you?

            1 of 1 people found this helpful
            • 3. Re: Clustering in Domain mode
              Oluwasegun Diyan Newbie

              Hello Fink,

               

              Thanks for taking tine out to explain these things straight. Things are getting clearer now.

               

              My understanding is that the ha profile has clustering configurations enabled by default. So I'm assuming all servers within a server group are already clustered. Am I wrong on this assumption?

              With standalones I had to tweak the hornetq configuration to enable failover, shared store, etc. Do I have to do same in Domain mode or do I leave things at the default full-ha configuration?

               

              I read in a different post within this forum that once a second server is added to a server-group within the same host, then Wildfly would automatically assign that server as a backup and failover would happen automatically if the first server instance within that server-group failed. Is this true or did I misunderstand the post?

               

              Typically, please explain how failover works in the domain mode. I would very much appreciate this.

               

              Thanks!

              • 4. Re: Clustering in Domain mode
                Oluwasegun Diyan Newbie

                Hello Fink,

                 

                Just read your article on WildFly 9 Cluster Howto - WildFly 9 - Project Documentation Editor and it has even further clarified stuff for me.

                Great job!

                 

                In my environment I have two main deployments, as such I have two main active server-groups with several host servers configured under each group across multiple physical servers.

                All controlled by a central Domain controller on a different physical server.

                 

                I would thus need to load balance both server-groups adequately and also allow for efficient failover.

                As such would I need to:

                i. Configure two ManagerBalancerName within the same VirtualHost in http.conf or

                ii. Configure two VirtualHosts in http.conf, each one for a single ManagerBalancerName

                 

                Sorry If my questions sounds quite basic to you, I kindof learn more when I ask the silliest of things!

                 

                Thanks for your time.

                • 5. Re: Clustering in Domain mode
                  Radoslav Husar Master

                  Are all the deployments on all the nodes? In that case I don't see a need for multiple balancers. Each server can register multiple /contexts with each balancer.

                  • 6. Re: Clustering in Domain mode
                    Joseph Paul Newbie

                    Where you able to resolve your issues?

                     

                    I don't understand how are you configuring a server-group containing multiple servers which are running in more than one physical servers? I don't see any article explaining this. I would appreciate if you can share the configurations.

                     

                      <servers> 
                         <server name="server-one" group="main-server-group"/> 
                         <server name="server-two" group="main-server-group"> 
                              <socket-bindings port-offset="150"/> 
                         </server>

                        <server name="server-three" group="main-server-group"> 

                              <socket-bindings port-offset="150"/> 

                         </server>
                      </servers> 

                     

                    I want to configure server-two and server-three are running in two different physical machine. Ultimately I want to configure all 3 servers under servers need to run on 3 different physical machines. Is that possible? If so how?

                    • 7. Re: Clustering in Domain mode
                      Wolf-Dieter Fink Master

                      Hello Joseph,

                       

                      you need to distinguish between the domain configuration (domain.xml) which is only necessary for the domain-controller. This include the profiles and the server-groups.

                      And the host.xml which is the configuration for each  which is for the domain-contoller and all slave host-controller.

                       

                      So you start a domain-contoller with all configuration, you can add servers here, but it is recommended to use the DC only for administration and without app-servers see host-master.xml.

                       

                      Now you start another instance (with domain.sh) but change the host.xml to connect a remote DC (example slave-host.xml), this HC will connect the DC and pull the configuration.

                      Within the host.xml you are now able to add servers and align it to a server-group, and this for all instances, as many you want or the domain network can handle

                       

                      That's it

                      • 8. Re: Clustering in Domain mode
                        Joseph Paul Newbie

                        Thanks for your response Dieter Fink.

                         

                        I understand Domain controller & Host controller concepts. I am also planning Domain Controller is just for managing HostControllers. My question was The servers inside the ServerGroup can be set up on more than one machine or not?

                         

                        For example I have I have 5 physical machines. Machine #1 is acting as a DomainController. Machine #2 is a HostController(just only one HC). I am creating just only one server-group. This server group need to handle Machine#2 (HC), Machine#3, Machine#4 and Machine#5 servers. I mean to ask whether the servers inside a server-group can be deployed on more than one machine or not? If not How should I go about this? 

                        • 9. Re: Clustering in Domain mode
                          Wolf-Dieter Fink Master

                          The server-group is the 'parent' for servers, just to inherit configuration and configured in domain.xml

                           

                          If you want a server to join the server-group (only one allowed for a server) you simple need to add a new server element for a host (no matter which host).

                          This can be done by edit the host.xml at the machine you start the slave or using the management console (here the HC need to be started and connected to the domain first - maybe without any server configuration)

                           

                          So yes, servers in one server-group can be on any host-controller of your domain and a host-controller can be started on the same or different physical machines as the domain contoller.