11 Replies Latest reply on Aug 30, 2012 9:24 AM by thomas2008ch

    How to start multiple Jboss instance?

    thomas2008ch

      Hi,

       

      The structure of Jboss AS 7 is quite different from that of Jboss 5. Now I will install 3 instances of standalone as follow:

       

      $JBOSS_HOME$/bin

                                /standalone

                                /standalone1

                                /standalone2

                                ...

       

      One can see the standalone1 and 2 are c copy/clone of standalone.

       

      I know if I want to start the instance of standalone, I wii go into directory bin/ and use the command as follow:

       

      [code]

      ./standalone.sh -b ip

      [/code]

       

      But how can I start the Jboss instance of standalone1 and 2?

       

       

      Thomas

        • 1. Re: How to start multiple Jboss instance?
          wdfink

          try bin/standalone.sh -djboss.server.base.dir=standalone1 -bx.x.x.x this will use the config there and create the logs and data also in that sub-directories.

          • 2. Re: How to start multiple Jboss instance?
            wdfink

            But why you do not use the domain mode?

            It simplify the configuration as a server-group can be a template for the configuration.

            • 3. Re: How to start multiple Jboss instance?
              thomas2008ch

              The reason why I not use domain is: The standalone1 and standalone belong to different user and may have different configuration in detail. The user will deploy different applications on them and these applications have nothing do to with each other.

              • 4. Re: How to start multiple Jboss instance?
                thomas2008ch

                Hi,

                 

                1.

                It should be -djboss.server.base.dir=standalone  or -Djboss.server.base.dir=standalone.. ?

                 


                2.

                Can I define the D-parameter in a profile?

                • 5. Re: How to start multiple Jboss instance?
                  yigongjoyce

                  Hallo Thomas,

                   

                  I have the same problem like you.

                   

                  I just start my server like this:

                   

                  note1:           standalone.bat --server-config=standalone-ha.xml -Djboss.node.name=nodeOne

                  note2 :          standalone.bat --server-config=standalone-ha.xml -Djboss.node.name=nodeTwo -Djboss.socket.binding.port-offset=100

                   

                  It works, but in that case, i have just one "deployments" folder. I cann't separate the two instances.

                  • 6. Re: How to start multiple Jboss instance?
                    thomas2008ch

                    Hi yigongjoyce,

                     

                    Your situation is different from mein. You start wo instance with port-offset. But they use the same configuration files.

                     

                    My situation is described above.

                    • 7. Re: How to start multiple Jboss instance?
                      yigongjoyce

                      Hi,

                       

                      I have tried the method, which Wolf-Dieter posted hat. It's exactly what I want!

                       

                      Thanks!

                      • 8. Re: How to start multiple Jboss instance?
                        wdfink

                        1.

                        You should use "-Djboss...", upper case yes as this is a property.

                        2.

                        No you cant because it will choice the directory before the profile is read.

                         

                        Regarding your restrictions about domain:

                        You can configure a domain with different servers in exact this way where each server might have a different configuration (e.g. one EJB, one Web, one JMS) and deploy different applications there. The benefit is the single point of configuration, also if you spread over different physical boxes.

                        Only thing is that you start with different (system) users.

                        • 9. Re: How to start multiple Jboss instance?
                          thomas2008ch

                          1.

                          If the servers are located on different machines, does it make sense to use the domain module? Or the domain module just for multiple servers on the same machine?

                           

                          2.

                          Assumed several servers are locate on the same machine, according to the document I read, these servers share the same IP but with port-offset, right? How about if each server occuppies different ips?

                           

                          3.

                          How about load-balancing to these servers from the web-server such as Apache Httpd  in front of the Jboss?

                          • 10. Re: How to start multiple Jboss instance?
                            wdfink

                            1.

                            The domain mode is for administration of serveral JBoss server instances, no matter wether it is located on the same or different system.

                            You only need to prepare a JBoss with a host.xml that points to the DC (the domain.xml you might delete, its not necessary)

                            After that you can add new servers on that host via CLI (or configure still XML on the host.xml local, but this is not recommended)

                             

                            2.

                            You can add the <interfaces> element to each server element and overwrite the ip address. If you delete the global <interfaces> each server must contain its own interfaces element to specify the necessary ip addresses

                            • 11. Re: How to start multiple Jboss instance?
                              thomas2008ch

                              many thanks.