6 Replies Latest reply on Mar 10, 2010 6:40 PM by jimmy.hui

    Multiple instances of JBoss on a server

    jimmy.hui

      Hi,

       

      Coming from a WebLogic background I'm trying to figure out how to deploy multiple instances of the same EJB application to multiple JBoss 5 servers that run on a single machine. WebLogic has the concept of Domains and I could create multiple domains on a server independantly. From what I can see JBoss servers are run from $JBOSS_HOME and I was wondering if you could actually run them elsewhere outside of the jboss install area?

       

      Perphaps my line of thinking is too WebLogic centric and it's not the way to do it in JBoss? But we have multiple developers who will want to deploy the same application onto their own JBoss server (for testing and development) but all instances are running off the same physical server. Any tips on how one would achieve this configuration/deployment?

       

      Cheers,

      Jimmy

        • 1. Re: Multiple instances of JBoss on a server
          jaikiran

          You can have multiple instances of JBoss AS running on the same physical machine. Then each AS instance can have the same application deployed. Which version of JBoss AS do you use? See this for more details on how to run multiple instances http://community.jboss.org/wiki/ConfiguringMultipleJBossInstancesOnOneMachine

          • 2. Re: Multiple instances of JBoss on a server
            jimmy.hui

            We are using JBoss 5.0 at the moment.

             

            If I wanted to run multiple instances of JBoss, does that mean i need to create multiple server configurations within $JBOSS_HOME? So if I require 4 servers per developer, there would be 4 server configurations within $JBOSS_HOME per developer?

             

            I guess the question is if I can move the server configuration files outside of the $JBOSS_HOME area such that when i do ./run.sh -c <server config name> it can find it outside of $JBOSS_HOME?

            • 3. Re: Multiple instances of JBoss on a server
              jaikiran

              jimmy.hui wrote:

               

              We are using JBoss 5.0 at the moment.

               


              I would recommend you move to 5.1.0

               

              jimmy.hui wrote:

               

               

               

              If I wanted to run multiple instances of JBoss, does that mean i need to create multiple server configurations within $JBOSS_HOME? So if I require 4 servers per developer, there would be 4 server configurations


              Yes either 4 server configurations for the same AS installation or 4 separate server installations. The former consumes less disk space. The server configurations need not be within the JBOSS_HOME

               

              jimmy.hui wrote:

               

              I guess the question is if I can move the server configuration files outside of the $JBOSS_HOME area such that when i do ./run.sh -c <server config name> it can find it outside of $JBOSS_HOME?

              You can create those configurations outside the JBOSS_HOME and then pass the jboss.server.home.url Java system property to point to the absolute file location of that configuration.

               

              For example, to create a new config named "custom" (which is a copy of "default" config):

               

              1) Copy JBOSS_HOME/server/default (and all its sub folders and files) to /home/me/workspace/custom

              2) From the bin folder of JBoss AS, start the server using:

               

              ./run.sh -Djboss.server.home.url=/home/me/workspace/custom -Djboss.service.binding.set=ports-01
              

               

              For Windows OS use run.bat.

               

              The -Djboss.service.binding.set property points to a unique group of ports, so that the server startup won't fail with port in use exceptions, when more than one developer boots his server at the same time.

              • 4. Re: Multiple instances of JBoss on a server
                jimmy.hui

                Thank you for this, it certainly is pointing me in the right direction!

                 

                When I use -Djboss.server.home.url and point it to a custom folder and try to start up JBoss I get a MalformedURLException: No Protocol error. Would you happen to have any ideas on this?

                 

                Cheers

                Jimmy

                • 5. Re: Multiple instances of JBoss on a server
                  jaikiran

                  jimmy.hui wrote:

                   

                   

                   

                  When I use -Djboss.server.home.url and point it to a custom folder and try to start up JBoss I get a MalformedURLException: No Protocol error. Would you happen to have any ideas on this?

                   

                  Cheers

                  Jimmy

                  I did not post the correct value in my earlier post. The correct way to specify that URL is to include the file:// protocol. So something like

                   

                  -Djboss.server.home.url=file:///home/me/workspace/custom
                  1 of 1 people found this helpful
                  • 6. Re: Multiple instances of JBoss on a server
                    jimmy.hui
                    Ahh yes, got it working last night! Thank you for the help!