敬的世界

          常用鏈接

          統計

          最新評論

          Running multiple instances of JBoss on the same server

          Sometimes it is useful to run more than one instance of JBoss on the same server. Other instances can be set up for development, testing or for quality assurance, etc.

          ConfiguringMultipleJBossInstancesOnOneMachine on the JBoss wiki has the basic info but does not seem to be up to date for the newer servers (4.2.x+).

          Before setting up another instance, other outside resources may also have to be 'cloned' if it is possible that they may conflict, such as setting up another instance of a database with a separate connection url and matching datasource for JBoss.

          The basic steps are as follows:

          1) Add port-bindings.xml file for binding service port definitions. This file has the same content as jboss sample-bindings.xml available from the wiki.

          Rename to "port-bindings.xml" and save to $JBOSS_HOME/server directory.

          2) The binding service manager needs to be enabled in conf/jboss-service.xml for instances that are not using the default ports.

          Remove the comments to enable the "ServiceBindingManager" mbean and modify the content as below:

          "ServerName" attribute should reference a port configuration in port-bindings.xml and "StoreURL" should point to the port-bindings.xml file


          <mbean code="org.jboss.services.binding.ServiceBindingManager"
          ???? name="jboss.system:service=ServiceBindingManager">
          ???? <attribute name="ServerName">ports-01</attribute>
          ???? <attribute name="StoreURL">file:../server/port-bindings.xml</attribute>
          ???? <attribute name="StoreFactoryClassName">
          ?????? org.jboss.services.binding.XMLServicesStoreFactory
          ???? </attribute>
          </mbean>

          the next few changes are not mentioned in jboss wiki documentation

          3) Under "Socket transport Connector", in the "Configuration" section, serverBindPort must be changed to another value or it will conflict with the default(4446)

          <mbean code="org.jboss.remoting.transport.Connector"
          ????????? name="jboss.remoting:service=Connector,transport=socket"
          ????????? display-name="Socket transport Connector">
          ...

          <attribute name="Configuration">

          ...

          ?????? <attribute name="serverBindPort">4446</attribute>

          4) And in
          /deploy/ejb3.deployer/META-INF/jboss-service.xml,
          for the remoting.transport.Connector mbean, port 3873 must be changed to another value or it will conflict with the default.

          ??? <mbean code="org.jboss.remoting.transport.Connector"
          ????????? name="jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3">

          ...?????

          ??????? <attribute name="InvokerLocator">socket://${jboss.bind.address}:3873</attribute>

          ?

          5) Also, any startup scripts in $JBOSS_HOME/bin may have to be cloned with different debug ports if remote debugging is enabled.

          In summary the directory structure for setting up two other instances would be something like the below with added port-bindings.xml and modifications in the filenames in bold.



          $JBOSS_HOME/server/port-bindings.xml
          $JBOSS_HOME/server/default
          $JBOSS_HOME/server/node1
          $JBOSS_HOME/server/node1/conf/jboss-service.xml
          $JBOSS_HOME/server/node1/deploy/ejb3.deployer/META-INF/jboss-service.xml
          $JBOSS_HOME/server/node2
          $JBOSS_HOME/server/node2/conf/jboss-service.xml
          $JBOSS_HOME/server/node2/deploy/ejb3.deployer/META-INF/jboss-service.xml

          Separate instances are run with "run -c node1" etc. and applications accessed with urls like:

          http://localhost:8080/myapp/
          http://localhost:8180/myapp/
          http://localhost:8280/myapp/

          posted on 2008-11-17 04:26 picture talk 閱讀(292) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 都江堰市| 峨山| 昆山市| 津市市| 新邵县| 体育| 潜山县| 清镇市| 景宁| 亳州市| 鄢陵县| 洪雅县| 宜川县| 昌宁县| 饶阳县| 富锦市| 宁陵县| 平江县| 平阴县| 松原市| 寻甸| 泾源县| 伊吾县| 定安县| 金华市| 农安县| 永德县| 玉环县| 汉中市| 云和县| 祁连县| 东至县| 蒲江县| 延吉市| 定日县| 垣曲县| 临泉县| 剑阁县| 中宁县| 民丰县| 博乐市|