jboss as 7 - running multiple instances in the same linux server - standalone vs domain
Asked Answered
P

4

6
  1. I downloaded the jboss tar file.
  2. Copied into my test server.
  3. Did untar and installed it at $HOME/jboss/

Now, I need to have three instances running at the same time - Dev, QA, UAT - on a SINGLE server.

Is the Domain mode for this situation? My conclusion was that it is not. That Domain mode is to manage JVMs across multiple servers. For example, if I wanted QA to be in server1 and server2. Is that correct?

However, my need is NOT to manage JBOSS instances across multiple servers.

Given that should I be using standalone mode? If so, how would I run three instances of JBOSS (Dev, QA and UAT) concurrently.

I tried the instructions given here (Approach 2) : https://community.jboss.org/wiki/MultipleInstancesOfJBossAS7OnTheSameMachine

But I keep getting the errors like this:

MSC00001: Failed to start service jboss.serverManagement.controller.management.http: org.jboss.msc.service.StartException in service jboss.serverManagement.controller.management.http: Address already in use /127.0.0.1:9990

Is there any simple tutorial that I can follow. I see this questions asked multiple times, but none of them seem to have a satisfactory answer.... that I find helpful. Is this a black art that lowly developers should not attempt in their home alone?

SGB

Phonsa answered 20/2, 2013 at 22:57 Comment(0)
P
8

To get multiple jboss instances running on linux, in JBOSS_HOME/standalone/configuration/standalone.xml, I changed a single line from :

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">

to the following...

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:100}">

NOTE: The reason I was having problem was because I had setup my JBOSS_HOME in my .bash_profile as per the jboss installation instructions. I needed to remove this so that both instances would not use the same JBOSS_HOME.

Phonsa answered 25/2, 2013 at 18:7 Comment(0)
S
5

Slight Change in above comment.

bash$ ./standalone.sh -Djboss.socket.binding.port-offset=10000

This will start the server port as 18080.

default port is 8080 + 10000 will give 18080.

Soubise answered 20/11, 2013 at 10:13 Comment(0)
J
3

It's easier to add "-Djboss.socket.binding.port-offset=1000" while starting standalone.sh, e.g.:

./standalone.sh -Djboss.socket.binding.port-offset=1000

This will start jboss on ports +1000 to the standard ones (so 8080 will become 18080). No need to change xml files.

Jaymejaymee answered 17/6, 2013 at 13:51 Comment(1)
./standalone.sh -Djboss.socket.binding.port-offset=10000 will give port as 18080Soubise
R
0

If you are using Jboss on Intellij, you would like to add the offset into server configuration, just go to Run --> Edit configuration:

enter image description here

Rossiter answered 24/2, 2015 at 21:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.