13 Replies Latest reply on Aug 30, 2012 2:57 AM by hushen.savani

    HornetQ HA - Live/Backup Server Issue

    hushen.savani

      Dear Community,

       

           I am using Hornetq-2.2.10. I am facing problem while configuring Live/Backup nodes for HornetQ HA. I have configured following configuration is hornetq-configuration.xml on node0:

       

         <clustered>true</clustered>
      
          <shared-store>true</shared-store>
      
           <failover-on-shutdown>false</failover-on-shutdown>
        
      <bindings-directory>${jboss.home.dir}/server/cmm_node0/data/hornetq/bindings</bindings-directory>
      
      
         <journal-directory>${jboss.home.dir}/server/cmm_node0/data/hornetq/journal</journal-directory>
      
      
         <large-messages-directory>${jboss.home.dir}/server/cmm_node0/data/hornetq/largemessages</large-messages-directory>
      
      
         <paging-directory>${jboss.home.dir}/server/cmm_node0/data/hornetq/paging</paging-directory>
      
         <connectors>
            <connector name="netty">
               <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
               <param key="host"  value="${jboss.bind.address:localhost}"/>
               <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
            </connector>
            
            <connector name="netty-throughput">
               <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
               <param key="host"  value="${jboss.bind.address:localhost}"/>
               <param key="port"  value="${hornetq.remoting.netty.batch.port:5455}"/>
               <param key="batch-delay" value="50"/>
            </connector> 
      
            <connector name="in-vm">
               <factory-class>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</factory-class>
               <param key="server-id" value="${hornetq.server-id:0}"/>
            </connector> 
         </connectors> 
      
         <acceptors>
            <acceptor name="netty">
               <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
               <param key="host"  value="${jboss.bind.address:localhost}"/>
               <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
            </acceptor>
            
            <acceptor name="netty-throughput">
               <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
               <param key="host"  value="${jboss.bind.address:localhost}"/>
               <param key="port"  value="${hornetq.remoting.netty.batch.port:5455}"/>
               <param key="batch-delay" value="50"/>
               <param key="direct-deliver" value="false"/>
            </acceptor> 
      
            <acceptor name="in-vm">
              <factory-class>org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory</factory-class>
              <param key="server-id" value="0"/>
            </acceptor>  
         </acceptors> 
      
         <broadcast-groups>
            <broadcast-group name="bg-group1">
               <group-address>${hornetq.broadcast.bg-group1.address:231.7.7.7}</group-address>
               <group-port>${hornetq.broadcast.bg-group1.port:9876}</group-port>
               <broadcast-period>2000</broadcast-period>
               <connector-ref>netty</connector-ref>
            </broadcast-group>
         </broadcast-groups> 
      
         <discovery-groups>
            <discovery-group name="dg-group1">
               <group-address>${hornetq.discovery.dg-group1.address:231.7.7.7}</group-address>
               <group-port>${hornetq.discovery.dg-group1.port:9876}</group-port>
               <refresh-timeout>10000</refresh-timeout>
            </discovery-group>
         </discovery-groups>
         
         <cluster-connections>
            <cluster-connection name="cmm-cluster">
               <address>jms</address>           
               <connector-ref>netty</connector-ref>
                      <discovery-group-ref discovery-group-name="dg-group1"/>
            </cluster-connection>
         </cluster-connections>
         
         <security-settings>
            <security-setting match="#">
               <permission type="createNonDurableQueue" roles="guest"/>
               <permission type="deleteNonDurableQueue" roles="guest"/>
               <permission type="consume" roles="guest"/>
               <permission type="send" roles="guest"/>
            </security-setting>
         </security-settings> 
      
         <address-settings>
            <!--default for catch all-->
            <address-setting match="#">
               <dead-letter-address>jms.queue.DLQ</dead-letter-address>
               <expiry-address>jms.queue.ExpiryQueue</expiry-address>
               <redelivery-delay>0</redelivery-delay>
               <max-size-bytes>3221225472</max-size-bytes>       
               <message-counter-history-day-limit>10</message-counter-history-day-limit>
               <address-full-policy>PAGE</address-full-policy>
               <redistribution-delay>60000</redistribution-delay>
            </address-setting>
         </address-settings> 
      </configuration>
      
      

       

      And Connection Factory is defined in hornetq-jms.xml on node0 as following:

       

       <connection-factory name="NettyConnectionFactory">
            <xa>true</xa>
            <connectors>
               <connector-ref connector-name="netty"/>
            </connectors>
            <entries>
               <entry name="/ConnectionFactory"/>
               <entry name="/XAConnectionFactory"/>
            </entries> 
            <ha>true</ha>
      
            <!-- Pause 1 second between connect attempts -->
            <retry-interval>1000</retry-interval> 
      
            <!-- Multiply subsequent reconnect pauses by this multiplier. This can be used to
            implement an exponential back-off. For our purposes we just set to 1.0 so each reconnect
            pause is the same length -->
            <retry-interval-multiplier>1.0</retry-interval-multiplier> 
      
            <!-- Try reconnecting an unlimited number of times (-1 means "unlimited") -->
            <reconnect-attempts>-1</reconnect-attempts> 
      
         </connection-factory>
      

       

       

      And for node1 (backup node) following configurations has been done in hornetq-configuration.xml:

       

       

       <clustered>true</clustered>
         
          <backup>true</backup> 
      
          <shared-store>true</shared-store>
      
           <failover-on-shutdown>false</failover-on-shutdown>
      
         <connectors>
            <connector name="netty">
               <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
               <param key="host"  value="${jboss.bind.address:localhost}"/>
               <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
            </connector>
            
            <connector name="netty-throughput">
               <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
               <param key="host"  value="${jboss.bind.address:localhost}"/>
               <param key="port"  value="${hornetq.remoting.netty.batch.port:5455}"/>
               <param key="batch-delay" value="50"/>
            </connector>
      
             <connector name="in-vm">
               <factory-class>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</factory-class>
               <param key="server-id" value="${hornetq.server-id:0}"/>
            </connector>
           </connectors>
      
          <acceptors>
            <acceptor name="netty">
               <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
               <param key="host"  value="${jboss.bind.address:localhost}"/>
               <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
            </acceptor>
            
            <acceptor name="netty-throughput">
               <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
               <param key="host"  value="${jboss.bind.address:localhost}"/>
               <param key="port"  value="${hornetq.remoting.netty.batch.port:5455}"/>
               <param key="batch-delay" value="50"/>
               <param key="direct-deliver" value="false"/>
            </acceptor>
      
             <acceptor name="in-vm">
              <factory-class>org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory</factory-class>
              <param key="server-id" value="0"/>
            </acceptor>
      
          </acceptors>
        
         <broadcast-groups>
            <broadcast-group name="bg-group1">
               <group-address>${hornetq.broadcast.bg-group1.address:231.7.7.7}</group-address>
               <group-port>${hornetq.broadcast.bg-group1.port:9876}</group-port>
               <broadcast-period>2000</broadcast-period>
               <connector-ref>netty</connector-ref>
            </broadcast-group>
         </broadcast-groups>
        
         <discovery-groups>
            <discovery-group name="dg-group1">
               <group-address>${hornetq.discovery.dg-group1.address:231.7.7.7}</group-address>
               <group-port>${hornetq.discovery.dg-group1.port:9876}</group-port>
               <refresh-timeout>10000</refresh-timeout>
            </discovery-group>
         </discovery-groups>
         
         <cluster-connections>
            <cluster-connection name="cmm-cluster">
               <address>jms</address>           
               <connector-ref>netty</connector-ref>
                      <discovery-group-ref discovery-group-name="dg-group1"/>
            </cluster-connection>
         </cluster-connections>
         
         <security-settings>
            <security-setting match="#">
               <permission type="createNonDurableQueue" roles="guest"/>
               <permission type="deleteNonDurableQueue" roles="guest"/>
               <permission type="consume" roles="guest"/>
               <permission type="send" roles="guest"/>
            </security-setting>
         </security-settings>
        
         <address-settings>
            <!--default for catch all-->
            <address-setting match="#">
               <dead-letter-address>jms.queue.DLQ</dead-letter-address>
               <expiry-address>jms.queue.ExpiryQueue</expiry-address>
               <redelivery-delay>0</redelivery-delay>
               <max-size-bytes>3221225472</max-size-bytes>       
               <message-counter-history-day-limit>10</message-counter-history-day-limit>
               <address-full-policy>PAGE</address-full-policy>
               <redistribution-delay>60000</redistribution-delay>
            </address-setting>
         </address-settings>
        </configuration>
      

       

      And in hornetq-jms.xml for node1 (backup node), connection factory is defined as following:

       

       

      <connection-factory name="NettyConnectionFactory">
            <xa>true</xa>
            <connectors>
               <connector-ref connector-name="netty"/>
            </connectors>
            <entries>
               <entry name="/ConnectionFactory"/>
               <entry name="/XAConnectionFactory"/>
            </entries>
      
            <ha>true</ha>
            <!-- Pause 1 second between connect attempts -->
            <retry-interval>1000</retry-interval>
      
             <!-- Multiply subsequent reconnect pauses by this multiplier. This can be used to
            implement an exponential back-off. For our purposes we just set to 1.0 so each reconnect
            pause is the same length -->
            <retry-interval-multiplier>1.0</retry-interval-multiplier>
        
            <!-- Try reconnecting an unlimited number of times (-1 means "unlimited") -->
            <reconnect-attempts>-1</reconnect-attempts>
      
         </connection-factory>
      

         

       

      Now, with this configurations, I have noted following observations:

       

      1) Clustering gets enabled

      2) Backup server announces itself as a backup server once started.

      3) But, once the application is started running, the hornetq server load balances itself automatically between live and backup server (which shouldn't be done, because hornetq docs says that hornetq provides passive HA).

      4) Now, if live node gets down, the backup node does not process the messages further.

      5) If the live server is again started, then it starts processing all the messages it has processed.

       

      HornetQ Configurations are attached. PFA.

       

      Please suggest on the same on urgent basis, we are unable to configure HA on production server.

       

      Thanks.

       

      Best Regards,

      Hushen Savani 

        • 1. Re: HornetQ HA - Live/Backup Server Issue
          gaohoward

          looks like you didn't specify following attributes in your backup config:

           

          <bindings-directory>${jboss.home.dir}/server/cmm_node0/data/hornetq/bindings</bindings-directory>
          <journal-directory>${jboss.home.dir}/server/cmm_node0/data/hornetq/journal</journal-directory>
          <large-messages-directory>${jboss.home.dir}/server/cmm_node0/data/hornetq/largemessages</large-messages-directory>
          <paging-directory>${jboss.home.dir}/server/cmm_node0/data/hornetq/paging</paging-directory>

           


          • 2. Re: HornetQ HA - Live/Backup Server Issue
            hushen.savani

            Hi Howard,

             

                 Thanks for prompt response. Yes, well in this case if I specify such configurations in backup node as well, it starts showing following exceptions in backup node on startup:

            17:32:49,762 WARN  [HornetQActivation] Failure in HornetQ activation org.hornetq.ra.inflow.HornetQActivationSpec(ra=org.hornetq.ra.HornetQResourceAdapter@c6853a8 destination=queue/secondary.mocmAuditQueue destinationType=javax.jms.Queue ack=Auto-acknowledge durable=false clientID=null user=null maxSession=50)

            HornetQException[errorCode=2 message=Cannot connect to server(s). Tried with all available servers.]

                      at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:779)

                      at org.hornetq.ra.inflow.HornetQActivation.setupSession(HornetQActivation.java:360)

                      at org.hornetq.ra.inflow.HornetQActivation.setup(HornetQActivation.java:292)

                      at org.hornetq.ra.inflow.HornetQActivation$SetupActivation.run(HornetQActivation.java:603)

                      at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:205)

                      at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)

                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                      at java.lang.Thread.run(Thread.java:619)

            17:32:49,789 INFO  [EJBContainer] STARTED EJB: com.elitecore.messageservice.ejb.messageserviceengine.messageservicelistener.mdb.BusinessProcessQueueListenerMDB ejbName: BusinessProcessQueueListenerMDB

            17:32:49,812 WARN  [HornetQActivation] Failure in HornetQ activation org.hornetq.ra.inflow.HornetQActivationSpec(ra=org.hornetq.ra.HornetQResourceAdapter@c6853a8 destination=queue/cmmBusinessProcessQueue destinationType=javax.jms.Queue ack=Auto-acknowledge durable=false clientID=null user=null maxSession=50)

            HornetQException[errorCode=2 message=Cannot connect to server(s). Tried with all available servers.]

                      at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:779)

                      at org.hornetq.ra.inflow.HornetQActivation.setupSession(HornetQActivation.java:360)

                      at org.hornetq.ra.inflow.HornetQActivation.setup(HornetQActivation.java:292)

                      at org.hornetq.ra.inflow.HornetQActivation$SetupActivation.run(HornetQActivation.java:603)

                      at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:205)

                      at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)

                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                      at java.lang.Thread.run(Thread.java:619)

            17:32:49,846 INFO  [EJBContainer] STARTED EJB: com.elitecore.messageservice.ejb.messageserviceengine.messageservicelistener.mdb.FailedEntitiesListenerMDB ejbName: FailedEntitiesListenerMDB

            17:32:49,849 WARN  [HornetQActivation] Failure in HornetQ activation org.hornetq.ra.inflow.HornetQActivationSpec(ra=org.hornetq.ra.HornetQResourceAdapter@c6853a8 destination=queue/secondary.mocmFailureQueue destinationType=javax.jms.Queue ack=Auto-acknowledge durable=false clientID=null user=null maxSession=50)

            HornetQException[errorCode=2 message=Cannot connect to server(s). Tried with all available servers.]

                      at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:779)

                      at org.hornetq.ra.inflow.HornetQActivation.setupSession(HornetQActivation.java:360)

                      at org.hornetq.ra.inflow.HornetQActivation.setup(HornetQActivation.java:292)

                      at org.hornetq.ra.inflow.HornetQActivation$SetupActivation.run(HornetQActivation.java:603)

                      at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:205)

                      at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)

                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                      at java.lang.Thread.run(Thread.java:619)

            17:32:49,880 INFO  [EJBContainer] STARTED EJB: com.elitecore.messageservice.ejb.messageserviceengine.messageservicelistener.mdb.ManagementQueueListenerMDB ejbName: ManagementQueueListenerMDB

            17:32:49,883 WARN  [HornetQActivation] Failure in HornetQ activation org.hornetq.ra.inflow.HornetQActivationSpec(ra=org.hornetq.ra.HornetQResourceAdapter@c6853a8 destination=queue/secondary.mocmManagementQueue destinationType=javax.jms.Queue ack=Auto-acknowledge durable=false clientID=null user=null maxSession=50)

             

             

            17:33:10,050 ERROR [HornetQActivation] Unable to reconnect org.hornetq.ra.inflow.HornetQActivationSpec(ra=org.hornetq.ra.HornetQResourceAdapter@c6853a8 destination=queue/cmmTestQueue destinationType=javax.jms.Queue ack=Auto-acknowledge durable=false clientID=null user=null maxSession=50)

            HornetQException[errorCode=2 message=Cannot connect to server(s). Tried with all available servers.]

                      at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:779)

                      at org.hornetq.ra.inflow.HornetQActivation.setupSession(HornetQActivation.java:360)

                      at org.hornetq.ra.inflow.HornetQActivation.setup(HornetQActivation.java:292)

                      at org.hornetq.ra.inflow.HornetQActivation.handleFailure(HornetQActivation.java:564)

                      at org.hornetq.ra.inflow.HornetQActivation$SetupActivation.run(HornetQActivation.java:607)

                      at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:205)

                      at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)

                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                      at java.lang.Thread.run(Thread.java:619)

            17:35:04,720 WARN  [HornetQXAResourceWrapper] Can't connect to any hornetq server on recovery [XARecoveryConfig [hornetQConnectionFactory=HornetQConnectionFactory [serverLocator=ServerLocatorImpl [initialConnectors=[org-hornetq-core-remoting-impl-invm-InVMConnectorFactory?server-id=0], discoveryGroupConfiguration=null], clientID=null, dupsOKBatchSize=1048576, transactionBatchSize=1048576, readOnly=false], username=null, password=null]]

            17:35:04,721 WARN  [loggerI18N] [com.arjuna.ats.internal.jta.recovery.xarecovery1] Local XARecoveryModule.xaRecovery  got XA exception javax.transaction.xa.XAException: Error trying to connect to any providers for xa recovery, XAException.XAER_RMERR

            17:35:04,721 WARN  [HornetQXAResourceWrapper] Can't connect to any hornetq server on recovery [XARecoveryConfig [hornetQConnectionFactory=HornetQConnectionFactory [serverLocator=ServerLocatorImpl [initialConnectors=[org-hornetq-core-remoting-impl-invm-InVMConnectorFactory?server-id=0], discoveryGroupConfiguration=null], clientID=null, dupsOKBatchSize=1048576, transactionBatchSize=1048576, readOnly=false], username=null, password=null]]

             

             

            And then server does not get connected to the cluster.

             

            Please suggest. Thanks.

             

            Best Regards,

            Hushen Savani

            • 3. Re: HornetQ HA - Live/Backup Server Issue
              gaohoward

              That looks like you have deployed a MDB in backup server (so I think you use hornetq in jboss AS). Can you give some details about the MDB?

              • 4. Re: HornetQ HA - Live/Backup Server Issue
                hushen.savani

                Hi Howard,

                 

                     Yes, I use HornetQ-2.2.10 inside JBossEAP-5.2.1. And I deploy the same MDBs on both the servers - Backup and Live. Am I not supposed to deploy my ear on the backup server?

                 

                     My MDBs are simple MDBs. PFA one of the sample MDBs of my application.

                 

                     Pl. suggest. Thanks.

                 

                Best Regards,

                Hushen Savani

                • 5. Re: HornetQ HA - Live/Backup Server Issue
                  gaohoward

                  I'm quite sure what's the purpose of it but anyway if you deploy a MDB in a container, you need to make sure it points to a 'live server' (jca config). Those MDBs will automatically fail over to backups if live server fails.

                  1 of 1 people found this helpful
                  • 6. Re: HornetQ HA - Live/Backup Server Issue
                    hushen.savani

                    Hi Howard,

                     

                         I'm not sure I understand what you are saying. Can you please elaborate more?

                     

                         Well, I tried undeploying my MDBs from backup node, the backup server got started with following log:

                    18:12:30,882 INFO  [ClusterConnectionImpl] backup announced

                    18:12:30,900 INFO  [TomcatDeployment] deploy, ctxPath=/jbossws

                    18:12:30,928 INFO  [TomcatDeployment] deploy, ctxPath=/web-console

                    18:12:31,224 INFO  [NettyAcceptor] Started Netty Acceptor version 3.2.3.Final-r1 192.168.1.76:6155 for CORE protocol

                    18:12:31,225 INFO  [NettyAcceptor] Started Netty Acceptor version 3.2.3.Final-r1 192.168.1.76:6145 for CORE protocol

                    Feb 18, 2012 6:12:31 PM org.hornetq.core.logging.impl.JULLogDelegate info

                    INFO: Backup Server is now live

                    18:12:31,282 INFO  [HornetQServerImpl] Backup Server is now live

                    18:12:31,399 INFO  [RARDeployment] Required license terms exist, view vfsfile:/home/crestel/crestelsetup/EAP_HA/jboss-as/server/cmm_node1/deploy/jboss-local-jdbc.rar/META-INF/ra.xml

                    18:12:31,419 INFO  [RARDeployment] Required license terms exist, view vfsfile:/home/crestel/crestelsetup/EAP_HA/jboss-as/server/cmm_node1/deploy/jboss-xa-jdbc.rar/META-INF/ra.xml

                    18:12:31,437 INFO  [RARDeployment] Required license terms exist, view vfsfile:/home/crestel/crestelsetup/EAP_HA/jboss-as/server/cmm_node1/deploy/jms-ra.rar/META-INF/ra.xml

                    18:12:31,490 INFO  [HornetQResourceAdapter] HornetQ resource adaptor started

                    18:12:31,507 INFO  [RARDeployment] Required license terms exist, view vfsfile:/home/crestel/crestelsetup/EAP_HA/jboss-as/server/cmm_node1/deploy/mail-ra.rar/META-INF/ra.xml

                    18:12:31,516 INFO  [BridgeImpl] Bridge ClusterConnectionBridge@4d16e8e6 [name=sf.cmm-cluster.f4bd253e-5a2d-11e1-b97e-002128bc0745, queue=QueueImpl[name=sf.cmm-cluster.f4bd253e-5a2d-11e1-b97e-002128bc0745, postOffice=PostOfficeImpl [server=HornetQServerImpl::serverUUID=77181c83-599a-11e1-89af-002128bc0745]]@5dbd3f6f targetConnector=ServerLocatorImpl (identity=(Cluster-connection-bridge::ClusterConnectionBridge@4d16e8e6 [name=sf.cmm-cluster.f4bd253e-5a2d-11e1-b97e-002128bc0745, queue=QueueImpl[name=sf.cmm-cluster.f4bd253e-5a2d-11e1-b97e-002128bc0745, postOffice=PostOfficeImpl [server=HornetQServerImpl::serverUUID=77181c83-599a-11e1-89af-002128bc0745]]@5dbd3f6f targetConnector=ServerLocatorImpl [initialConnectors=[org-hornetq-core-remoting-impl-netty-NettyConnectorFactory?port=6245&host=192-168-1-76], discoveryGroupConfiguration=null]]::ClusterConnectionImpl@533872696[nodeUUID=77181c83-599a-11e1-89af-002128bc0745, connector=org-hornetq-core-remoting-impl-netty-NettyConnectorFactory?port=6145&host=192-168-1-76, address=jms, server=HornetQServerImpl::serverUUID=77181c83-599a-11e1-89af-002128bc0745])) [initialConnectors=[org-hornetq-core-remoting-impl-netty-NettyConnectorFactory?port=6245&host=192-168-1-76], discoveryGroupConfiguration=null]] is connected

                     

                     

                         But when I killed live server, the following log has been shown in backup server, and the backup server didn't take over the control!

                    HornetQException[errorCode=2 message=Channel disconnected]

                         at org.hornetq.core.client.impl.ClientSessionFactoryImpl.connectionDestroyed(ClientSessionFactoryImpl.java:379)

                         at org.hornetq.core.remoting.impl.netty.NettyConnector$Listener$1.run(NettyConnector.java:711)

                         at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:100)

                         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                         at java.lang.Thread.run(Thread.java:619)

                     

                         Please suggest. Thanks.

                     

                    Best Regards,

                    Hushen Savani

                    • 7. Re: HornetQ HA - Live/Backup Server Issue
                      ataylor

                      a backup server is a backup for another live server in the cluster not the MDB's, when a failure occurs it takes over the responsibilities and connects to the live server in the same vm where it will distribute any messages it receives. these are then sent to the MDB's.

                      1 of 1 people found this helpful
                      • 8. Re: HornetQ HA - Live/Backup Server Issue
                        hushen.savani

                        Hi Howard/Andy,

                         

                             Thanks for prompt responses. I understood what you said. Let me rearrange my deployment structure.

                         

                             Thanks.

                         

                        Best Regards,

                        Hushen Savani

                        • 9. Re: HornetQ HA - Live/Backup Server Issue
                          hushen.savani

                          Hi Howard/Andy,

                           

                               I have rearranged my deployment structure as following:

                           

                          1) HornetQ is embedded in JBoss Server.

                          2) I have two nodes in JBoss Application Server Level Cluster.

                          3) HornetQ Server is cluster enabled as well.

                          4) HornetQ HA/Failover is configured in HornetQ Server Configurations.

                          5) I deploy my application EARs in HASignleton mode on two nodes (i.e. node0 and node1)

                          6) Node0 is configured as Live and Node1 is configured as Backup as part of HornetQ Configurations.

                          7) Since, node0 will be acting as a Live server, node1 will be the Backup server, at the same time, my EARs (MDBs) will be deployed in HASingleton mode, so when node0 is live, at that time, ear would be active only on node0 due to HASingleton.

                          8) Now when node0 will be down, node1 will become live and at the same time the EARs will start deploying on node1.

                           

                          So, if we conclude, it will be like,

                           

                          Node  Status    Application-Deployed?

                          0        Live                      Yes              

                          1        Backup                 No

                          -----------[Now, Node0 is down]------------

                          0        Down                    No

                          1        Live                       Yes

                           

                               But, RedHat support represntative says that it is an invalid deployment structure as the HornetQ QA did not test this scenario. However, he cannot justify why its not valid? Can you please suggest some pointers on the same??

                           

                               Thanks.

                           

                          Best Regards.

                          Hushen Savani

                          • 10. Re: HornetQ HA - Live/Backup Server Issue
                            clebert.suconic

                            In theory it should work. a Support enginneer pinged me today saying he was going to test it. If you don't hear back from him (I'm assuming he meant to be answering you), please get back to me and I will figure out the outcome of his tests.

                            • 11. Re: HornetQ HA - Live/Backup Server Issue
                              hushen.savani

                              Hi Clebert,

                               

                                   Thanks a lot. I will co-ordinate with him, if it requires, I'll get back to this post. Thanks.

                               

                              Best Regards,

                              Hushen Savani

                              • 12. Re: HornetQ HA - Live/Backup Server Issue
                                jshepher

                                Would you be able to post the outcome of this here? I was trying to do the some thing today.

                                • 13. Re: HornetQ HA - Live/Backup Server Issue
                                  hushen.savani

                                  RedHat QA guys have taken this test case in JBossEAP-5.1.3 QA Cycle. They may soon come up with the results. You may track this issue at:

                                  https://issues.jboss.org/browse/JBPAPP-9549