4.5.  Running multiple instances of JBoss Application Server

4.5.  Running multiple instances of JBoss Application Server

Note

Please note that automated updating of instances created using methods below is not supported. If you create custom instances, you will manually have to port files / changes from a new update to that instance.

The description here is restricted to running multiple instances of the JBoss Application Server Linux service. Running multiple instances with run.sh is already described elsewhere in the JBoss Application Server documentation.

You can administer multiple SysV services that run JBoss Application Server by creating additional service scripts. The process basically consists of:

Note

The original init script log files are created under /var/log/jbossas in directories that correspond to the configuration used (like 'default') with the usual server.log name. For instance:

/var/log/jbossas/default/server.log

In general, each log file is created by the SysV script as

/var/log/service-name/$JBOSSCONF/server.log

so no file conflicts shall exist.

For more flexibility in the configuration of the different servers, you may want to create full copies of JBOSS_HOME. This is described in Creating copies of JBOSS_HOME above -- make sure you use the cp command's p switch to preserve the jboss user and group ownership. Then, in /etc/sysconfig/service-name, uncomment and update the value of the JBOSS_HOME variable.

Optionally, you can just uncomment and change the value of JBOSS_HOME as described above so as to specify an empty or non-existent directory and the script will automatically create a copy of the RPM-installed /var/lib/jbossas (original JBOSS_HOME) for you when the service is first started. The current "minimal", "production", "default" and "all" configurations will be copied. Make sure the parent directory, in case of a new directory, or the directory itself, if already existent, have write permissions for the user jboss.

Note

Starting the server this first time may take a little longer due to the file copying.

There are 2 ways to run additional instances of JBoss Application Server and avoid port conflicts: