单台主机上启动多个JBOSS的配置

1.JBoss提供了一种简便的方法:Binding Manager服务,不需要繁琐的端口配置就可以实现多实例运行端口不冲突,详细步骤如下:
以JBoss 4.2.3 GA为例,%JBOSS_HOME%\docs\examples\binding-manager\sample-bindings.xml,该文件默认情况下定义了4组不同的端口配置(ports-default、ports-01、ports-02、ports-03),也就是说默认情况下支持同一台机器部署4个JBoss实例。

2.将server应用下的default复制一份改名为node2.

3.修改node2/conf/jboss-service.xml文件,配置Service Binding(默认注释,取消注视修改ports-01/ports-02/ports-03即可)如下:

<!--
      | Binding service manager for port/host mapping. This is a sample
      | config that demonstrates a JBoss instances with a server name 'ports-01'
      | loading its bindings from an XML file using the ServicesStoreFactory
      | implementation returned by the XMLServicesStoreFactory.
      |
      | ServerName: The unique name assigned to a JBoss server instance for
      | lookup purposes. This allows a single ServicesStore to handle mulitiple
      | JBoss servers.
      |
      | StoreURL: The URL string passed to org.jboss.services.binding.ServicesStore
      | during initialization that specifies how to connect to the bindings store.
      | StoreFactory: The org.jboss.services.binding.ServicesStoreFactory interface
      | implementation to create to obtain the ServicesStore instance.
   -->
   <mbean code="org.jboss.services.binding.ServiceBindingManager"
     name="jboss.system:service=ServiceBindingManager">
     <attribute name="ServerName">ports-02</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>

4.修改node2/deploy\jboss-web.deployer\server.xml配置文件

<Connector port="8067" address="0.0.0.0"    
         maxThreads="250" maxHttpHeaderSize="8192"
         emptySessionPath="true" protocol="HTTP/1.1"
         enableLookups="false" redirectPort="8443" acceptCount="100"
         connectionTimeout="20000" disableUploadTimeout="true" />

5.启动实例,访问端口为8067。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值