How to Run multiple JBoss instances on the same machine !!!!

Many a times production boxes are load balanced and there will be more than one instance of application server running. During development  phase we test the applications on single node, and it becomes very critical to test the application on multiple nodes, especially when there is some in-memory datagrid or HA-JNDI etc.

It is at these times when we search for any existing environments where in we can test our application. Not always its very easy to get our hands on these environments as they are always used by other tasks with more priorities. In these situation the following tip will come in very handy.

Follow these steps to run multiple instances of JBoss on the same machine.

1) Copy all default directory under <JBOSS_HOME>/server/ in to another directory say by name “instance2″.

2) Effectively this means there would be another directory under <JBOSS_HOME>/server/ by name “instance2″.

3) Now in order to start “instance2″ open command prompt navigate to <JBOSS_HOME>/bin and use the following command run.bat -c instance2 -Djboss.service.binding.set=ports-02.

4) This should start second instance on port 8280.

5) The default instance can be started using the normal command run.bat.

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Leave Comment