3 Replies Latest reply on Jun 29, 2006 4:13 PM by brian.stansberry

    Active/passive configuration

    vzilka

      How do I configure a JBoss that runs my web application to access only one server in the cluster, and access another only if the first one fails? I need the second machine to be idle unless a crash occurs.

        • 1. Re: Active/passive configuration
          lepe

          http://tomcat.apache.org/connectors-doc/howto/workers.html

          Look for disabled and redirect properties.

          /L

          • 2. Re: Active/passive configuration
            vzilka

            10x, but what I ment was EJB clustering. The web machine needs to activate an EJB, and the 2 EJB machines should be configured active/passive

            • 3. Re: Active/passive configuration
              brian.stansberry

              You'd need to write a custom load balance policy that always picked the first server from the list of targets and then stuck to it. See the code for org.jboss.ha.framework.interfaces.FirstAvailable -- change the part where it using a Random to pick the target.

              You'd also have to make sure your active server was completely started before starting the passive. That way the active one would be the first target.

              This is kind of a quick-and-dirty approach; with thought maybe you can come up with something more elegant.

              Another point -- if you use the PooledInvoker instead of the JRMPInvoker, the targets the load balancer works on are of type ServerAddress. That class exposes the address of the host it connects to. A custom load balance policy could potentially make use of that info (e.g. check a system property for a "preferred" active host, and access that if its available, otherwise choose a passive host from the remaining targets).