敬的世界

          常用鏈接

          統(tǒng)計(jì)

          最新評(píng)論

          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 閱讀(291) 評(píng)論(0)  編輯  收藏


          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 夹江县| 新乡县| 青神县| 布尔津县| 乐陵市| 施甸县| 平潭县| 易门县| 磐石市| 元阳县| 曲阳县| 宾阳县| 江川县| 若尔盖县| 繁昌县| 临泉县| 马尔康县| 兴海县| 凤庆县| 贡觉县| 太白县| 通山县| 临朐县| 桓台县| 宝清县| 宝坻区| 澄江县| 滕州市| 广平县| 河池市| 山西省| 郑州市| 阿尔山市| 五大连池市| 哈尔滨市| 大邑县| 高雄市| 喀喇沁旗| 丹凤县| 平阳县| 沈丘县|