Launch JBoss AS 5 and JBoss AS 4 at the same time

I thought it would be the JBoss FAQ, but I can not find it.

I would like to run JBoss 4 and JBoss 5 at the same time. I manually changed all the ports on the JBoss 5 server / standard instance by changing the initial digit of the port to 9 and it seems to work. I can run JBoss 4 and JBoss 5 without port conflicts.

One of my colleagues said that in his opinion, he had heard that there was a way to “repack” JBoss 5 to move all port numbers by a certain amount. This would be a cleaner solution than manually editing the port settings.

Is there an easy way to change the port settings in JBoss 5 so that it can work simultaneously with JBoss 4?

+3
source share
5 answers

. IP .

JBoss, , , ( "rebase" ). JBoss :

run -Djboss.service.binding.set=ports-01 

JBoss ( ):

http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4213775#4213775
+10

"rebase", - IP -b run.sh . , . , JBoss . ,

$ sudo ip addr add dev lo local 127.0.0.100/24
$ run.sh -b 127.0.0.1
$ run.sh -b 127.0.0.100
$ wget http://127.0.0.1:8080
$ wget http://127.0.0.100:8080

Voila! JBoss .

+2

, , , . , , .

, , , .

, ( ):

run.sh -c <service name> -DJPATH=/usr/local/bin:/usr/bin:/bin:/usr/local/jre1.6.0_03/bin/ -Djboss.bind.address=192.168.110.21 \
-Djboss.port.connector=37079 -Djboss.port.classloader=37080 -Djboss.port.naming=37081 -Djboss.port.namingrmi=37082 -Djboss.port.jmxrmi=37083 \
-Djboss.port.pooled=37084 -Djboss.port.jndinaming=37085 -Djboss.port.jndirmi=37086 -Djboss.port.jms=37087 -Djboss.port.ajp=37078
+1

- , , Jboss AS 4 5 DMZ. , , 2 . 2 sh, Jboss4, 5 :

start-jboss4.sh:

#!/bin/sh
nohup /etc/jboss-4.2.3.GA/bin/run.sh -b 10.0.0.51 > jboss4.log &

start-jboss5.sh:

#!/bin/sh
nohup /etc/jboss-5.1.0.GA/bin/run.sh -Djboss.service.binding.set=ports-01 -b 10.0.0.51 >> jboss5.log &

, , , . 2 .

stop-jboss4.sh:

#!/bin/sh
/etc/jboss-4.2.3.GA/bin/shutdown.sh -S -s jnp://10.0.0.51

stop-jboss5.sh:

#!/bin/sh
/etc/jboss-5.1.0.GA/bin/shutdown.sh -S -s jnp://10.0.0.51:1199

, script JBoss JNDI-. script script 1199 ( + 100) JNDI .

, -.

+1
source

Note that the jboss.service.binding.set property is used only by JBoss 5. So, if you want JBoss 4 in a different port profile, you would need to change $ {JBOSS_HOME} / server / default / conf / jboss- service.xml .

Find the element that references the ServiceBindingManager and change the ServerName attribute.

<mbean code="org.jboss.services.binding.ServiceBindingManager"
  name="jboss.system:service=ServiceBindingManager">
  <attribute name="ServerName">ports-01</attribute>
  <attribute name="StoreURL">${jboss.home.url}/docs/examples/binding-manager/sample-bindings.xml</attribute>
  <attribute name="StoreFactoryClassName">
    org.jboss.services.binding.XMLServicesStoreFactory
  </attribute>
</mbean>

The port values ​​used by JBoss 4 are read from $ {JBOSS_HOME} /docs/examples/binding-manager/sample-bindings.xml. Default port port names:

  • default ports
  • ports-01
  • Ports 02
  • ports-03
+1
source

Source: https://habr.com/ru/post/1703918/


All Articles