4.5.1.  Running multiple instances of JBoss Application Server using different sets of ports

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:

  1. Create a new file /etc/init.d/service-name which is a symlink to /etc/init.d/jbossas, e.g:

    ln -s /etc/init.d/jbossas /etc/init.d/jbossas-ports-01
    
  2. Create a new config file for service-name, /etc/sysconfig/service-name. The contents of this file should be similar to /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.

  3. Then add service-name for management by chkconfig, e.g:

    chkconfig --add jbossas-ports-01
    
  4. To start/stop the service, simply: service service-name start/stop, e.g:

    service jbossas-ports-01 start