2 Replies Latest reply on Jun 20, 2012 12:03 AM by saifeldeen

    Hornetq Live / Backup server issue with JAS6

    saifeldeen

      G'day,

       

      I have the following setup:

      • JAS 6 using HornetQ 2.2.5 Primary 1 - P1
      • JAS 6 using HornetQ 2.2.5 Primary 2 - P2
      • JAS 6 using HornetQ 2.2.5 Failover 1 - F1
      • JAS 6 using HornetQ 2.2.5 Failover 2 - F2

       

      I deploy my EAR to the "deploy" directory in P1 and F1.  My EAR contains a single EJB and the EJB contains a reference to a queue resource "queue/testQueue".  P1 starts up perfectly fine.  F1 doesn't.  The EAR doesn't deploy correctly and the following message is logged:

      DEPLOYMENTS MISSING DEPENDENCIES:

        Deployment "jboss-injector:topLevelUnit=testQ.ear,unit=test.jar,bean=QueueInsert" is missing the following dependencies:

          Dependency "<UNKNOWN jboss-injector:topLevelUnit=testQ.ear,unit=test.jar,bean=QueueInsert>" (should be in state "Installed", but is actually in state "** UNRESOLVED Demands 'jboss-switchboard:appName=testQ,module=test,name=QueueInsert' **")

        Deployment "jboss-switchboard:appName=testQ,module=test,name=QueueInsert" is missing the following dependencies:

          Dependency "queue/testQueue" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'queue/testQueue' **")

        Deployment "jboss.j2ee:ear=testQ.ear,jar=test.jar,name=QueueInsert,service=EJB3" is missing the following dependencies:

          Dependency "<UNKNOWN jboss.j2ee:ear=testQ.ear,jar=test.jar,name=QueueInsert,service=EJB3>" (should be in state "Installed", but is actually in state "** UNRESOLVED Demands 'jboss-injector:bean=QueueInsert,topLevelUnit=testQ.ear,unit=test.jar' **")

        Deployment "jboss.j2ee:ear=testQ.ear,jar=test.jar,name=QueueInsert,service=EJB3_endpoint" is missing the following dependencies:

          Dependency "jboss.j2ee:ear=testQ.ear,jar=test.jar,name=QueueInsert,service=EJB3" (should be in state "Installed", but is actually in state "PreInstall")

       

       

      DEPLOYMENTS IN ERROR:

        Deployment "<UNKNOWN jboss-injector:topLevelUnit=testQ.ear,unit=test.jar,bean=QueueInsert>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss-switchboard:appName=testQ,module=test,name=QueueInsert' **

        Deployment "queue/testQueue" is in error due to the following reason(s): ** NOT FOUND Depends on 'queue/testQueue' **

        Deployment "<UNKNOWN jboss.j2ee:ear=testQ.ear,jar=test.jar,name=QueueInsert,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss-injector:bean=QueueInsert,topLevelUnit=testQ.ear,unit=test.jar' **

       

       

              at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.2.GA]

              at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.2.GA]

              at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.1.0.Final]

              at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:107) [:0.2.2]

              at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:135) [:6.1.0.Final]

              at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.1.0.Final]

              at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6]

              at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6]

              at java.lang.Thread.run(Thread.java:662) [:1.6.0_29]

       

      It seems that F1 cannot find the queue configuration, even though it is there in the hornetq-jms.xml.

       

      However, when I remove <backup>true</backup> from F1's hornetq-configuration, the primary / failover nodes behave perfectly fine.  That is, I can stop P1 and F1 will behave as a backup should behave (i.e. take control), I can then stop F1 and P1 will then take control etc...

       

      I have attached the configuration for P1, P2, F1 and F2 if it helps (without <backup>true</backup> in the failover nodes) and also my EAR file.  I am starting my JBoss instances as follows:

      # primary 01

      run.bat -c node1 -g DocsPartition -u 239.255.100.100  -b 192.168.1.35 -Djboss.messaging.ServerPeerID=1  -Djboss.service.binding.set=ports-default

      # primary 02

      run.bat -c node2 -g DocsPartition -u 239.255.100.100   -b 192.168.1.35 -Djboss.messaging.ServerPeerID=2   -Djboss.service.binding.set=ports-01

      # failover 01

      run.bat -c node1-backup -g DocsPartition -u 239.255.100.100  -b 192.168.1.35 -Djboss.messaging.ServerPeerID=3  -Djboss.service.binding.set=ports-02

      # failover 02

      run.bat -c node2-backup -g DocsPartition -u 239.255.100.100   -b 192.168.1.35 -Djboss.messaging.ServerPeerID=4   -Djboss.service.binding.set=ports-03

       

      My questions are:

      • When I follow the doco, i.e. use <backup>true</backup> in the failover nodes, why doesn't the EAR get deployed and why does the failover node not function correctly?  Are developers required to deploy to deploy-hasingleton rather than the deploy directory?
      • If I don't use <backup>true</backup> in the failover nodes, are there any ramifications?  As I said earlier, the primary / failover nodes work perfectly this way...
        • 1. Re: Hornetq Live / Backup server issue with JAS6
          ataylor

          If you set backp=false on your failover node then it actually isnt a failover node, its just a live server that happens to share the same journal as its 'real' live node, you dont want to do this.

           

          regarding your error, this is because the queue isnt created until the backup server is activated (after a live shutdown), How the queue resource is injected I have no idea as this is controlled by the AS deployers, ths AS guys might be able to commecnt on this if you ask them, you could try looking up the queue yourself in the ejb method rather than injecting it.

           

          One this i will add is that dedicated messaging backups are only really for pure messaging apps, if you have a JEE app then it would be better to use a colacated topology, this is where the backup is deployed on a server that is also runing a live server, with this once the live fails the backup comes up and distributes its messages to the other live server on the node to handle (for MDB's, EJB's etc).

          1 of 1 people found this helpful
          • 2. Re: Hornetq Live / Backup server issue with JAS6
            saifeldeen

            G'day Andy,

             

            Thanks for the fast response!

             

            If I understood correctly, to do what I'm trying to do with JEE, the idea would be to run backup servers of hornetq for each "live" server so that failover can be effected when the live server is shutdown. 

             

            As a result of that understanding, I implemented the following setup and it works exactly as I expect!

            jboss-hornetq-cluster-failover.jpg

            I also found the following post useful https://community.jboss.org/thread/158768 as it almost describes the scenario I was hoping to implement.