5 Replies Latest reply on Jan 4, 2016 1:56 PM by pferraro

    Cluster-HA-Singleton: Quorum only?

    rbattenfeld

      Hi

       

      Is there a way to deploy this topology:

      • Node1: App + Service + Quorum
      • Node2: App + Service + Quorum
      • Node3:          Service + Quorum

       

      With 'Service' and 'Quorum' I reference this code snipped:

       

        @Override

          public void activate(ServiceActivatorContext context) {

              install(HATimerService.DEFAULT_SERVICE_NAME, 1, context);

              install(HATimerService.QUORUM_SERVICE_NAME, 2, context);

          }

       

      So, essentially, I am looking for a setup which allows to deploy the application on two nodes with a quorum running on a third node. Is this possible? The failover will just happening between node1 and node2.

       

      Thanks a lot

      Ralf

        • 1. Re: Cluster-HA-Singleton: Quorum only?
          pferraro

          I don't fully understand your scenario.  What is it that you are trying to achieve?  You have some service that you only want running on a single node, but you don't ever want it to run on node3?

          • 2. Re: Cluster-HA-Singleton: Quorum only?
            rbattenfeld

            Yes, exactly. This is a common pattern. Say the first two servers are really expensive big machines with tons of GB memory and cores. In order to achieve high availability we need a quorum which allows to avoid the split brain problem. And this server for the quorum can be a low end server with very low memory and cores setup.

             

            Does this make sense for you?

            • 3. Re: Cluster-HA-Singleton: Quorum only?
              pferraro

              Why would you install the service on a node that you never want to run it?

              Is not sufficient to specify a name preference for node1 and node2?

              • 4. Re: Cluster-HA-Singleton: Quorum only?
                rbattenfeld

                It was just a question. I see in the code that the service and quorum is installed in different steps. So, my idea was to install just the quorum.

                But if that is not supported or doesn't make sense then the current implementation is fine for me.

                 

                I am not sure what you mean with the name preference. This just selects the default node... It doesn't solve the split brain problem, right?

                • 5. Re: Cluster-HA-Singleton: Quorum only?
                  pferraro

                  I'm not sure what you mean by "install just the quorum".  If you have 3 nodes, but you want only node1 or node2 to run your service, you can install it via:

                  factory.createSingletonServiceBuilder(name, service)
                      .requireQuorum(2)
                      .electionPolicy(new PreferredSingletonElectionPolicy(new SimpleSingletonElectionPolicy(), new NamePreference("node1"), new NamePreference("node2")))
                     .build(target)
                     .install();