3 Replies Latest reply on Mar 22, 2012 9:48 AM by jbertram

    HornetQ & JBoss7 clustering questions

    qtm

      Hello,

       

      Thanks for your support until now, I'm getting a better picture of HornetQ and JBoss7. Still, I have some more questions:

       

      1. I've been using JBM 1.4.5 + JBoss 4.x so JNP is the main tool for my remote clients. Now that is gone, I'm looking for solutions to replace it.

        Until now I've discovered the remote protocol:

             final Properties env = new Properties();

             env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");

             env.put(Context.PROVIDER_URL, "remote://localhost:4447");

             Context ctx = new InitialContext(env);

       

        Its main draw-back is the lack of support for multiple hosts - "remote://[host1]:[port1],remote://[host2]:[port2]" fails. I'm interested in high availability in a cluster. When the live server is down and the back-up is available how can I connect to it? A try-catch block with a new connection in the catch(the back-up host and port) is my main option, but it's ugly. Is there a better way to do this?

       

      2. Does the old HA-JNDI port have an equivalent?

       

      3. Regarding clustering - my understanding for setting up a cluster is this: each live node and its back-ups have a shared stored, but that shared stored is different for each live-backup combo. Is this correct? Would it be a problem to have a single shared store for the entire cluster? I'm accepting the single point of failure risk.

       

      4. Data replication - "Replication will be available in the next release of HornetQ". Do you mean the 2.2.x family or the 2.3.x family or something else?

       

      5. In the live + back-up + remote client scenario. Let's say I've got a connection to the live and my thread is doing something while the live goes down and the back-up becomes live. Will the connection be usable or should I create a new one? From what I've tested, a new one should be created, but I might be wrong.

       

      6. In the live + back-up + remote client scenario: I'm getting some warnings(2 types): int the back-up server:

       

      (Periodic Recovery) ARJUNA016027: Local XARecoveryModule.xaRecovery got XA exception XAException.XAER_RMERR: javax.transaction.xa.XAException: Error trying to connect to any providers for xa recovery

          at org.hornetq.jms.server.recovery.HornetQXAResourceWrapper.getDelegate(HornetQXAResourceWrapper.java:275) [hornetq-jms-2.2.13.Final.jar:]

          at org.hornetq.jms.server.recovery.HornetQXAResourceWrapper.recover(HornetQXAResourceWrapper.java:77) [hornetq-jms-2.2.13.Final.jar:]

          at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.xaRecovery(XARecoveryModule.java:503) [jbossjts-4.16.2.Final.jar:]

          at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.resourceInitiatedRecoveryForRecoveryHelpers(XARecoveryModule.java:471) [jbossjts-4.16.2.Final.jar:]

          at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.bottomUpRecovery(XARecoveryModule.java:385) [jbossjts-4.16.2.Final.jar:]

          at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkSecondPass(XARecoveryModule.java:166) [jbossjts-4.16.2.Final.jar:]

          at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:789) [jbossjts-4.16.2.Final.jar:]

          at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:371) [jbossjts-4.16.2.Final.jar:]

      Caused by: HornetQException[errorCode=2 message=null]

          at org.hornetq.jms.server.recovery.HornetQXAResourceWrapper.connect(HornetQXAResourceWrapper.java:351) [hornetq-jms-2.2.13.Final.jar:]

          at org.hornetq.jms.server.recovery.HornetQXAResourceWrapper.getDelegate(HornetQXAResourceWrapper.java:251) [hornetq-jms-2.2.13.Final.jar:]

          ... 7 more

       

       

       

      WARN  [org.hornetq.core.server.cluster.impl.BroadcastGroupImpl] (Activation for server HornetQServerImpl::serverUUID=58899408-71a1-11e1-9dda-b8ac6f2ea395) local-bind-address specified for broadcast group but no local-bind-port specified so socket will NOT be bound to a local address/port

      WARN  [org.hornetq.core.client.impl.ClientSessionFactoryImpl] (Thread-1 (HornetQ-client-global-threads-33379524)) Failed to connect to server.

      WARN  [org.hornetq.core.client.impl.ServerLocatorImpl] (Thread-1 (HornetQ-client-global-threads-33379524)) null

       

      Is my configuration(attached) wrong or are they expected? I'm running on localhost, back-up server port offset =1 .

       

      Thank you

        • 1. Re: HornetQ & JBoss7 clustering questions
          jbertram
          1. As you know, JNDI in AS 7 doesn't support multiple hosts, but you can eschew JNDI and use the HornetQ "core" API which will allow UDP-based discovery.  See org.hornetq.api.jms.HornetQJMSClient#createConnectionFactoryWithHA for more information.
          2. There is no HA-JNDI equivalent in AS 7.
          3. You are correct that a shared store is unique for each live-backup combo.  Multiple live servers cannot use the same store so it simply isn't possible to have a single shared store for the entire cluster.  HornetQ was specifically designed not to have this single point of failure.
          4. We hope to get replication in 2.3.0.  I believe the 2.2.x series is done.
          5. If a remote client is connected to a live server that has a back-up and the live server goes down the connection should fail-over to the back-up without any intervention from the client.
          6. What version of AS7 are you using?  I know the first message about the XAER_RMERR is harmless, and I believe the second one is well.  Create a new thread in the HornetQ forum regarding that one to be sure.
          • 2. Re: HornetQ & JBoss7 clustering questions
            qtm

            Thanks for the info,

             

            one last question : are there any plans to extend the remote protocol to support multiple hosts/ports?

            • 3. Re: HornetQ & JBoss7 clustering questions
              jbertram

              I assume you are referring to JNDI in your question since HornetQ itself already supports this kind of lookup.  If that assumption is correct then the answer to your question is yes.  However, I don't have an ETA.