4.5.1. Running multiple instances of JBoss Application Server using different sets of ports
Using different sets of ports
The BindingManager in JBoss Application Server can be used to dynamically override service configurations (e.g. port numbers). Jbossas has some pre-configured overrides, namely ports-01, ports-02 and ports-03. The configuration file can be found at /var/lib/jbossas/docs/examples/binding-manager/sample-bindings.xml. These sets of overrides can be used when multiple instances of JBoss Application Server must be started. Please follow these steps when multiple instance of JBoss Application Server need to be started:
Create a new file /etc/init.d/ which is a symlink to service-name/etc/init.d/jbossas, e.g:
ln -s /etc/init.d/jbossas /etc/init.d/jbossas-ports-01
Create a new config file for service-name, /etc/sysconfig/. The contents of this file should be similar to service-name/etc/sysconfig/jbossas, except with instance specific values uncommented and updated, e.g:
cp /etc/sysconfig/jbossas /etc/sysconfig/jbossas-ports-01. Uncomment and update JBOSSCONF to ports-01 in /etc/sysconfig/jbossas-ports-01.
Then add service-name for management by chkconfig, e.g:
chkconfig --add jbossas-ports-01
To start/stop the service, simply: service , e.g:
service-name start/stop
service jbossas-ports-01 start