10 Replies Latest reply on Jan 7, 2015 2:47 AM by aartirajput

    How to create multiple standalone server instances in JBOSS 7.1

    amitsoprna

      Hi,

       

      I have a basic question, as I did not find any documentation on how to create multiple standalone server instances

       

      1) How to create multiple instances of JBOSS server in standalone mode deployment?

       

      - Is copying and pasting the standalone folder with a different name will work?

       

      I have tried it by giving a port offset and then giving the server base directory on the command line. it starts up properly

       

      But when I start it with the following command :

       

      sh /opt/jboss/bin/standalone.sh -Djboss.server.base.dir=baapt -Dlogging.configuration=file:/opt/jboss/baapt/configuration/logging.properties

       

      Althouhg I have given the logging.properties file location on command line as "file:/opt/jboss/baapt/configuration/logging.properties"

       

      it still tries to pick it up from some other path "file:/home/amit/my_copied_standalone_folder/configuration/logging.properties"

       

      Following is the line printed on the server console:

       

      "Unable to read the logging configuration from 'file:/home/amit/my_copied_standalone_folder/configuration/logging.properties' (java.io.FileNotFoundException: /home/amit/my_copied_standalone_folder/configuration/logging.properties (No such file or directory))."

       

      So please suggest the right approach.

       

      I am just trying to migrate from JBOSS 4.2 to JBOSS 7.1. In 4.2 version we used to create multiple server instances by creating separate server folder structures inside the "JBOSS_HOME/server/" folder.

        • 1. Re: How to create multiple standalone server instances in JBOSS 7.1
          wdfink

          It should work if you copy the standalone folder and start with the option -Djboss.server.base.dir=XX.

          I'm not sure what the command "sh ....." will do with the environment whether it is starting a subshell.

          For me it works if I start it from a bash without the -Dlogging.config option(why you need it?) the configuration is used anyway.

          1 of 1 people found this helpful
          • 2. Re: How to create multiple standalone server instances in JBOSS 7.1
            amitsoprna

            Thanks Wolf-Dieter Fink,

             

            actually I tried giving the -Dlogging.config option to direct JBOSS to look for that file in my copied standalone folder that i renamed and not in the original standalone folder. With or without giving this option I get the following printed on the server console, although the server starts succesfully:

             

             

            =========================================================================

             

              JBoss Bootstrap Environment

             

              JBOSS_HOME: /opt/jboss

             

              JAVA: /opt/jdk/bin/java

             

              JAVA_OPTS:  -server -XX:+TieredCompilation -Xms512m -Xmx1024m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone-full.xml

             

            =========================================================================

             

            Unable to read the logging configuration from 'file:/home/amit/my_copied_standalone_folder/configuration/logging.properties' (java.io.FileNotFoundException: /home/amit/baapt/configuration/logging.properties (No such file or directory))

             

            I ma not sure why it goes and searches in /home/amit/my_copied_standalone_folder rather than in /opt/jboss/my_copied_standalone_folder

            • 3. Re: How to create multiple standalone server instances in JBOSS 7.1
              wdfink

              What JBoss version do you usr? 7.1.1.Final?

              What OS?

              Do you use a fresh unipped JBoss and copy only the standalone folder?

              Is there any JBOSS_ variable set in the environment?

              • 4. Re: How to create multiple standalone server instances in JBOSS 7.1
                amitsoprna

                Yes I am using the 7.1.1 Final JBOSS Version.

                I am running this in the VM having Centos operating system.

                Well before copying I had configured one application in the original standalone folder. But I overwrote the standalone-full.xml

                Apart from the variables shown in my above reply that comes from standalone.conf, I haven't set any other JBOSS_variable except "-Djboss.server.base.dir" that I give while starting JBOSS from command terminal.

                 

                Still as you have pointed out I will try to do a fresh copy of this folder and see if this error goes away. If not I will update here, thanks a lot for the help extended to me.

                • 5. Re: How to create multiple standalone server instances in JBOSS 7.1
                  hahne

                  I have 8 seperate JBOSS instances running on a single machine.

                  All are using the same directory JBOSS server.

                  step 1 have 8 DNS entries i.e. machine-01.com, machine-2.com etc

                  Then I have a script that starts each VJM as such: $JBOSS_HOME/bin/run.sh -c myserver --host=tparheedsg042-08 with the JVM ARGS

                  -Xloggc:/npower/itr/logs/tparheedsg042-08.nielsen.com/logs/gc.out 

                  -Dserver.log.directory=/npower/itr/logs/tparheedsg042-08.nielsen.com/logs

                  -Djboss.server.data.dir=/npower/itr/logs/tparheedsg042-08.nielsen.com/data

                  -Djboss.server.temp.dir=/npower/itr/logs/tparheedsg042-08.nielsen.com/tmp

                  -Djboss.boot.server.log.dir=/npower/itr/logs/tparheedsg042-08.nielsen.com/logs

                  -Djboss.server.log.dir=/npower/itr/logs/tparheedsg042-08.nielsen.com/logs

                   

                  Works like a champ :-)

                  By the way the machine is 48 core 255Gig

                  • 6. Re: How to create multiple standalone server instances in JBOSS 7.1
                    wdfink

                    Hi Ronald,

                    welcome to the forum.

                     

                    But as you are using a different version (AS6/5/4) it will be completely different.

                    • 7. Re: How to create multiple standalone server instances in JBOSS 7.1
                      abdulbasith

                      Can u pls help me to create more instances in a single Jboss server along with the startup scripts. I'm using Jboss as 7.1.1 Final in RHEL.
                      Thanks in advance.

                      • 8. Re: How to create multiple standalone server instances in JBOSS 7.1
                        wdfink

                        You might look into my comment, marked as helpful.

                        If you have special questions you should create a new thread.

                        • 10. Re: How to create multiple standalone server instances in JBOSS 7.1
                          aartirajput

                          I am also facing the same issue .

                          I have crated two insatnce with jboss 7.1.1 by just copying the standalone directory and changes the IP address and port detalils in  standalone.xml for both instances.

                          While running jboss for a instance its throwing an error for logging.properties file :

                           

                          Unable to read the logging configuration from 'file:/opt/jboss-as-7.1.1.Final/bin/instance_name/configuration/logging.properties' (java.io.FileNotFoundException: /opt/jboss-as-7.1.1.Final/bin/instance_name/configuration/logging.properties (No such file or directory))

                           

                          I don know why its searching in bin folder , although logging .properties file is located at right place (instance_name/configuration)with 755 permission.

                           

                          Please suggest how can i resolve this issue.

                           

                          Thanks.