3 Replies Latest reply on Jul 9, 2003 7:59 AM by flip

    multiple jboss instances on multihomed machine

    mattma

      Hello,

      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 -->




        • 1. Re: multiple jboss instances on multihomed machine
          maumau

          Hi mattma,
          Thank you very much for your post, it helped me a lot.

          If you use Jetty, you also need to modify

          deploy\jbossweb-jetty.sar\META-INF\jboss-service.xml

          <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
          <!-- Add and configure a HTTP listener to port 8080 -->
          <!-- The default port can be changed using: java -Djetty.port=80 -->
          <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->




          192.168.1.4
          10
          100
          30000
          5000





          • 2. Re: multiple jboss instances on multihomed machine
            tcabot

            Thanks, mattma, very useful post.

            One comment: it's also possible to make hsql *not* open a port at all, just follow the instructions in server/demo/deploy/hsqldb-ds.xml. For those of us that use an external database for most of our work it means one less file to hack per instance.


            <local-tx-datasource>
            <jndi-name>DefaultDS</jndi-name>
            <!-- for totally in-memory db, not saved when jboss stops. hsql mbean is unnecessary-->
            <connection-url>jdbc:hsqldb:.</connection-url>
            <driver-class>org.hsqldb.jdbcDriver</driver-class>
            <user-name>sa</user-name>

            <min-pool-size>5</min-pool-size>
            <security-domain>HsqlDbRealm</security-domain>
            </local-tx-datasource>


            • 3. Re: multiple jboss instances on multihomed machine
              flip

              Hi,

              your configuration hints are most helpful, I figured out how to use the shutdown command: it works as follows:

              ./shutdown.sh -Djava.naming.provider.url=jnp://192.168.57.26:1099