multiple jboss instances on multihomed machine
mattma Jun 2, 2003 12:55 AMHello,
Not sure if anyone has use for this information, but I just managed to get multiple jboss instances running on the same machine with multiple ip addresses. This solution has nothing to do with the "ServiceBindingManager" which seems interesting - but I haven't had the time to explore it. I'm posting this solution for the benefit of anyone who happens to want to run jboss on a multi-homed machine and if nothing else, for my own documentation. comments are welcome.
There is one caveat to doing this... the ./shutdown.sh -S command stops working because the shutdown command will look for localhost:1099 which probably won't be the ip address you bound jboss to. I haven't looked into the shudown.sh script but was wondering if anyone knew about runtime parameters you could use to tell the shutdown script what ip address jboss was bound to. For now, I simply do a
netstat -nap | grep 192.168.57.26:1099 to figure out what PID jboss is using and do a kill -9 on it.
The following ports are ones used by jboss
JBoss Port Listing
port (service) configfile
---- --------- ----------
1701 (hsqldb) hsqldb-ds.xml
1099 (jboss-naming) jboss-service.xml
34xxx (jboss-pooled invoker) jboss-service.xml
8083 (jboss-web service) jboss-service.xml
8090-8093 (jboss-message queue) jbossmq-service.xml
8080 (tomcat) /jbossweb-tomcat.sar/META-INF/jboss-service.xml
8009 (tomcat) /jbossweb-tomcat.sar/META-INF/jboss-service.xml
The following code listing uses the BindAddress attribute to bind each service listed above to a specific ip address.
-------------------------------------------------------------------------------
~/jboss/server/default/deploy/hsqldb-ds.xml
<connection-url>jdbc:hsqldb:hsql://localhost:1726</connection-url>
1726
true
default
false
true
-------------------------------------------------------------------------------
~/jboss/server/default/conf/jboss-service.xml
8083
192.168.57.26
<!-- Should resources and non-EJB classes be downloadable -->
true
<!-- The listening port for the bootstrap JNP service. Set this to -1
to run the NamingService without the JNP invoker listening port.
-->
1099
192.168.57.26
1
300
300
60000
192.168.57.26
0
0
false
<depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager
-------------------------------------------------------------------------------
~/jboss/server/default/deploy/jms/jbossmq-service.xml
<depends optional-attribute-name="Invoker">jboss.mq:service=Invoker
ConnectionFactory
XAConnectionFactory
8090
192.168.57.26
60000
true
<depends optional-attribute-name="Invoker">jboss.mq:service=Invoker
UILConnectionFactory
UILXAConnectionFactory
8091
192.168.57.26
<!-- FIXME: ping disabled because of deadlock problem -->
0
<!-- 60000 -->
true
<depends optional-attribute-name="Invoker">jboss.mq:service=Invoker
OIL2ConnectionFactory
OIL2XAConnectionFactory
8092
192.168.57.26
60000
true
<depends optional-attribute-name="Invoker">jboss.mq:service=Invoker
UIL2ConnectionFactory
UIL2XAConnectionFactory
8093
192.168.57.26
60000
true
<!-- Used to disconnect the client if there is no activity -->
<!-- Ensure this is greater than the ping period -->
70000
<!-- The size of the buffer (in bytes) wrapping the socket -->
<!-- The buffer is flushed after each request -->
2048
<!-- Large messages may block the ping/pong -->
<!-- A pong is simulated after each chunk (in bytes) for both reading and writing -->
<!-- It must be larger than the buffer size -->
1000000
-------------------------------------------------------------------------------
~/jboss/server/default/deploy/jbossweb-tomcat.sar/META-INF/jboss-service.xml
<!-- A HTTP/1.1 Connector on port 8080 -->
<!-- A AJP 1.3 Connector on port 8009 -->