12 Replies Latest reply on Jul 4, 2002 1:44 PM by Julian Gosnell

    Question about farming

    Dong Hun Kim Newbie

      Hi,

      Is farming feature(auto deploy to clusters) supported for web applications when I use jboss-jetty combo?

      Thank you.

        • 1. Re: Question about farming
          Sacha Labourey Master

          yes, any xAR can be deployed: JAR, WAR, EAR, SAR, RAR, WSR, etc.

          • 2. Re: Question about farming
            Joao Clemente Newbie

            I think the author asked weather the deployment of one of those xAR's files on 1 machine of the cluster would deploy the application on ALL machines of the cluster.
            (I think this was what he called "farming-feature")

            By your reply I was not sure if you're saying that all those xAR files were suported in farming feature or if you're saying that you could deploy those files in Jboss-Jetty (period).

            Sorry if this obvious and the problem is just my bad english.

            Joao Clemente
            IST - Portugal

            • 3. Re: Question about farming
              Julian Gosnell Expert

              As I understand it, and Sacha may correct me, it works like this :

              You configure instances of JBoss on the same cluster partition to be masters or slaves (by deploying a particular service) - you need one master.

              Anything you drop into deploy/ on the master will be copied to the slaves. Anything you remove from the master will be removed from the slaves.

              The master deploy directory is the MODEL, you are the CONTROLLER, the slaves are the VIEWS.


              Jules

              • 4. Re: Question about farming
                Sacha Labourey Master

                As we are in the cluster-forum, my answer was implicitly based towards clustering. So, yes, all of these can be deployed *in a farm*.

                BTW, if you have a distributed/shared filesystem, you can also mimic this behaviour by making each JBoss instance use a common "deploy" folder shared somewhere on the network.

                • 5. Re: Question about farming
                  Thomas Peuss Newbie

                  Hello Sacha!

                  If you use a shared filesystem you have a single point of failure.
                  If you cluster only for performance you can do that but if you want failover, too you should not do that.

                  CU
                  Thomas

                  • 6. Re: Question about farming
                    Frederic Soulier Newbie

                    How do you differentiate between the master and the slaves in the cluster?
                    There's nothing in the JBoss Clustering doc (20/06/2002) on p29-30.

                    Thanks

                    • 7. Re: Question about farming
                      Sacha Labourey Master

                      Sure, but then it is up to you to use a HA-filesystem! It exists.

                      • 8. Re: Question about farming
                        Sacha Labourey Master

                        What is your concern? Most of the time, we don't need/use a master/slave concept in the clustering.

                        But for your question, JavaGroups can provide you with a master (election mechanism is handled by JavaGroups)

                        • 9. Re: Question about farming
                          Frederic Soulier Newbie

                          Actually, I got confused by the poster mentionning master/slave :)
                          My understanding is that (as per doc) you can drop any xAR file in the /deploy/farm directory on any of the nodes participating in a cluster and the xAR will automatically be deployed on all the other nodes of the cluster. Is that right?

                          If yes, then I have a 2 nodes cluster (W2K) using JBoss 3.0 + Tomcat 4.0.3 (final release) and if I start adding/removing xAR to the /deploy/farm directory the farming concept works fine and I can see the xAR being deployed on the other node although if an exception is taken (say you try to deploy the tomcat4-service.xml without the tomcat4-service.jar) then the only way for the farming to work correctly again (deploy/undeploy) is to shut down JBoss and restart.

                          I need to try a specific sequence, except if there's a known issue in this area.

                          Fred

                          • 10. Re: Question about farming
                            Sacha Labourey Master

                            Hello,

                            What you write is correct.

                            Currently, farming must be improved to support some of these "exceptional" cases.

                            Features suggestion (real features, the one that *you* use) are welcome on SF.net/projects/jboss

                            Cheers,


                            sacha

                            • 11. Re: Question about farming
                              Joao Clemente Newbie

                              Hmmm.. If the farming behaviour is to undeploy a app that you deployed in the master server... What happens if the master server fails?
                              I see two possible cenarios, and both seem somewhat bad:

                              1 - Slave's think that Master undeployed the app
                              2 - Slave's keep the app running but now it's impossible to undeploy it since there is no deploy/farm/app in the slave's filesystem

                              Maybe there is a different workaround to this that I'm not seeing?

                              • 12. Re: Question about farming
                                Julian Gosnell Expert

                                guys,

                                Sorry for the confusion about master/slave - forget it.

                                I just ran two 'JBoss --configuration all' on two boxes and dropped an ear into server/all/farm on one - after a short delay it was deployed on the other. I removed it from the first and it was immediately removed from the other - BINGO !

                                Sacha - very nice ! - now some thoughts...

                                I'm working on a little testsuite that will throw HTTP requests at different nodes in a cluster. I figured that the deployment of the test webapp should be done over a farm to keep my config simple. I like to deploy using the JMX interface because it is synchronous - i.e. I know that my app has finished deploying when my request comes back.

                                I tried using the deploy() method on org.jboss.ha.framework.server.FarmMemberService MBean through the JMX console.It appears to return as soon as the deployable has been copied into .../farm/... - It would be nice to have a method which only returned when the deployable had been deployed on all nodes (or would it time out ? :-( )...

                                There does not appear to be an undeploy() method available via the console and the isDeployed() method barfs...:

                                HTTP ERROR: 500 Exception in MBean operation 'isDeployed(,java.lang.String)'
                                RequestURI=/jmx-console/HtmlAdaptor

                                17:46:00,383 WARN [JBossWeb] WARNING: Servlet Exception for /jmx-console/HtmlAdaptor
                                MBeanException: Exception in MBean operation 'isDeployed(,java.lang.String)'
                                Cause: org.jboss.deployment.DeploymentException: Could not retrieve isDeployed attribute from local Deployer Service; - nested throwable: (ReflectionException: null
                                Cause: java.lang.NoSuchMethodException: Unable to locate method for: Deployed(,java.net.URL))
                                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:303)
                                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
                                at org.jboss.jmx.adaptor.control.Server.invokeOpByName(Server.java:226)
                                at org.jboss.jmx.adaptor.control.Server.invokeOp(Server.java:195)
                                at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.invokeOp(HtmlAdaptorServlet.java:171)
                                at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.processRequest(HtmlAdaptorServlet.java:77)
                                at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.doPost(HtmlAdaptorServlet.java:59)


                                I'm running Branch_3_0.

                                Cool stuff though - you could have lots of fun with this.....


                                Jules