`

JBoss Howto - Configure Ports

 
阅读更多

https://community.jboss.org/docs/DOC-9376

 

ConfigurePorts

版本 18  单击查看文档历史记录
创建于: 2004-6-1 上午3:49 作者 tedtollefson - 最后修改:  2010-5-12 下午3:46 作者 Stelios Koussouris

Setting up multiple instances of JBoss on the same machine

 

The ServiceBindingManager

 

JBoss 5

 

Easy Way

 

Start JBoss with the VM parameter jboss.service.binding.set set to either ports-defaultports-01ports-02 etc. For example:

 

 

run -Djboss.service.binding.set=ports-01

 

 

The advantage of this way is you don't have to take (and maintain) a separate copy of the all folder if you want to, say, start up multiple instances of JBoss running as a cluster.

 

Harder Way

 

Edit server/default/conf/bindingservice.beans/META-INF/bindings-jboss-beans.xml

 

Change "ports-default":

<!-- The name of the set of bindings to use for this server -->
<parameter>${jboss.service.binding.set:ports-default}</parameter>

 

To any of the defined port sets. JBoss 5 ships with 4 pre defined port sets. You can find them defined further down in the bindings.xml file.

<!-- The ports-01 bindings are obtained by taking the base bindings and adding 100 to each port value -->
   <bean name="Ports01Bindings" class="org.jboss.services.binding.impl.ServiceBindingSet">
      <constructor>
         <!--  The name of the set -->
         <parameter>ports-01</parameter>
         <!-- Default host name -->
         <parameter>${jboss.bind.address}</parameter>
         <!-- The port offset -->
         <parameter>100</parameter>
         <!-- Set of bindings to which the "offset by X" approach can't be applied -->
         <parameter><null/></parameter>
      </constructor>
   </bean>

 

In this case lets change it to use the ports-01 set.

<!-- The name of the set of bindings to use for this server -->
<parameter>${jboss.service.binding.set:ports-01}</parameter>

 

If you familiarize yourself with this configuration file you should find it easy to create you own port sets.

 

Previous versions of JBoss

 

In conf/jboss-service you will find the binding manager.


   <!-- 
      | 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-01</attribute>
     <attribute name="StoreURL">../docs/examples/binding-manager/sample-bindings.xml</attribute>
     <attribute name="StoreFactoryClassName">
       org.jboss.services.binding.XMLServicesStoreFactory
     </attribute>
   </mbean>

   -->

 

Uncomment this to use the ports-01 settings from the example bindings.

The example contains 4 different ports settings besides the default settings (which is really unecessary).

 

Doing it by hand

 

Thanks to Daniel Kha for this guide

 

It is possible to setup a second instance of JBoss 3.0.6 (or 3.2.0) on the same machine simply by changing the ports of the 2nd installation of JBoss.  I believe this would also work for more than 2 instances.  In brief, to get my second JBoss installation to run, in most of the files I changed the ports by prepending an extra "1" to the default port numbers resulting in ports in the ~10000 range.

 

I've made some changes so you might want to go over this again depending on the last modified date (see bottom).

 

The following was written primarily for JBoss 3.0.6.  Updates were done for JBoss 3.2.0 (noted in steps where it's different between the versions).

Update 2006-02-14: Locations of the files in JBoss-4.0.4RC1 (and probably other versions of jboss4) were added.

 

JBoss Configuration Files to Change:

 

1.  In <jboss_home>/server/all/conf/jboss-service.xml (4.0.4rc1: deploy/dynclassloader-service.xml for WebService, deploy/naming-service.xml for NamingService, deploy/invokers-service.xml for JRMPInvoker), edit the following:

 

- For the mbean org.jboss.web.WebService, change the port setting line to (8083 is the default):

<attribute name="Port">18083</attribute>

 

- For the mbean org.jboss.naming.NamingService, change the port setting line to (1099 is the default):

<attribute name="Port">11099</attribute>

 

- For the mbean org.jboss.invocation.jrmp.server.JRMPInvoker, change the port setting line to (4444 is the default):

<attribute name="RMIObjectPort">14444</attribute>

 

 

2.  In <jboss_home>/server/all/deploy/cluster-service.xml (4.0.4rc1: could not find this one), edit the following:

 

- For the mbean org.jboss.ha.jndi.HANamingService, add this port setting (1100 is the default so I just prefixed an extra "1"):

<attribute name="Port">11100</attribute>

 

- Also for the mbean org.jboss.ha.jndi.HANamingService, add this port setting (0 is the default, I just made it 19000 to keep things sort of consistent with the above):

<attribute name="RmiPort">19000</attribute>

 

 

3.  In <jboss_home>/server/all/deploy/jbossmq-service.xml (4.0.4rc1: could not find the first one, deploy/jms/uil2-service.xml for UILServerILService), edit the following:

 

- For the mbean org.jboss.mq.il.oil.OILServerILService, change the port setting line to (8090 is the default):

<attribute name="ServerBindPort">18090</attribute>

 

- For the mbean org.jboss.mq.il.uil.UILServerILService, change the port setting line to (8091 is the default):

<attribute name="ServerBindPort">18091</attribute>

 

For JBoss 3.2.0, also do these steps (contributed by Anantha Krishnan V):

 

3.a In <jboss_home>/server/all/deploy/jbossmq-service.xml, edit the following:

 

- For the mbean org.jboss.mq.il.oil2.OIL2ServerILService, change the port setting line to (8092 is the default):

<attribute name="ServerBindPort">18092</attribute>

 

- For the mbean org.jboss.mq.il.uil2.UILServerILService, change the port setting line to (8093 is the default):

<attribute name="ServerBindPort">18093</attribute>

 

 

4.  In <jboss_home>/server/all/deploy/hsqldb-service.xml, edit the following:

 

- For the mbean org.jboss.jdbc.HypersonicDatabase, change the port setting line to (1476 is the default):

<attribute name="Port">11476</attribute>

 

- For the mbean org.jboss.resource.connectionmanager.RARDeployment, change the ConnectionURL property to reflect the new port setting line (1476 is the default):

<config-property name="ConnectionURL" type="java.lang.String">jdbc:hsqldb:hsql://localhost:11476</config-property>

 

For JBoss 3.2.0, do these steps (contributed by Anantha Krishnan V):

 

4.a In <jboss_home>/server/all/deploy/hsqldb-ds.xml, edit the following:

 

- For the mbean org.jboss.jdbc.HypersonicDatabase, change the port setting line to (1701 is the default):

<attribute name="Port">11701</attribute>

 

- Change the local-tx-datasource to reflect the new port setting line (1701 is the default):

<connect-url>jdbc:hsqldb:hsql://localhost:11701</connect-url>

 

 

5.  In <jboss_home>/server/all/deploy/jbossweb.sar/META-INF/jboss-service.xml, edit the following:

 

- Under the "Configure the Request Listeners" section, look for the add listener call of "org.mortbay.http.SocketListener" and change the port setting line to (8080 is the default):

<Set name="Port"><SystemProperty name="jetty.port" default="18080"/></Set>

 

- Under the "Configure the Request Listeners" section, look for the add listener call of "org.mortbay.http.ajp.AJP13Listener" and change the port setting line to (8009 is the default):

<Set name="Port">18009</Set>

 

- Also the call "org.mortbay.http.ajp.AJP13Listener", change the port setting line to (443 is the default):

<Set name="confidentialPort">1443</Set>

 

For JBoss 3.2.0, do these steps (contributed by Anantha Krishnan V):

 

5.a In <jboss_home>/server/all/deploy/jbossweb-jetty.sar/META-INF/jboss-service.xml, edit the following:

 

- Do the same as above, since the .sar was renamed.

 

For JBoss 3.2.1 with Tomcat, do these steps:

 

5.b In <jboss_home>/server/all/deploy/jbossweb-tomcat.sar/META-INF/jboss-service.xml, edit the following:

 

- Under the "Configure the Request Listeners" section, look for the add listener call of "org.apache.coyote.tomcat4.CoyoteConnector" and change the port setting line to (8080 is the default):

<!-- A HTTP/1.1 Connector on port 18080 --><Connector className="org.apache.coyote.tomcat4.CoyoteConnector"                port="18080" minProcessors="3" maxProcessors="10"                enableLookups="true" acceptCount="10" debug="0"                connectionTimeout="20000" useURIValidationHack="false" />

 

- Also the AJP 1.3 Connector, change the port setting line to (8009 and 8443 are the defaults):

<!-- A AJP 1.3 Connector on port 18009 -->            <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"                port="18009" minProcessors="5" maxProcessors="75"                enableLookups="true" redirectPort="18443"                acceptCount="10" debug="0" connectionTimeout="20000"                useURIValidationHack="false"                protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>

 

6.  In <jboss_home>/server/all/deploy/jmx-rmi-adaptor.sar/META-INF/jboss-service.xml, edit the following:

 

- For the mbean org.jboss.jmx.adaptor.rmi.RMIAdaptorService, change the port setting line to (0 is the default, but I made it 19001 since we already used 19000):

<attribute name="RMIObjectPort">19001</attribute>

 

 

7.  In <jboss_home>/server/all/conf/jacorb.properties, edit the following (if you are using JBoss 3.0.6):

 

- For the line OAPort=n, change the port setting line to (3528 is the default):

OAPort=13528

 

 

8.  Now execute the run.bat or run.sh script from the

/bin directory in each of the JBoss instances (in sequence, one after the other) and things should work!

 

 

To shutdown the different instances:

 

1.  Execute the shutdown.bat or shutdown.sh script from the

/bin directory with 2 extra arguments.  The first argument is the hostname and the second is the port number.

 

In our example you would shutdown the JBoss instance that is configured with default ports using this command:

<jboss_home>\bin\shutdown.bat -s jnp://localhost:11099 -u <username> -p <password>

 

And for the second instance with the modified ports, use this command:

<jboss_home>\bin\shutdown.bat -s jnp://localhost:11199 -u <username> -p <password>

 

Note: The port will be each binding port that was specified for jboss:service=Naming

 

Note: UNIX users use shutdown.sh.

分享到:
评论

相关推荐

    jboss-annotations-api_1.3_spec-2.0.1.Final-API文档-中英对照版.zip

    赠送jar包:jboss-annotations-api_1.3_spec-2.0.1.Final.jar; 赠送原API文档:jboss-annotations-api_1.3_spec-2.0.1.Final-javadoc.jar; 赠送源代码:jboss-annotations-api_1.3_spec-2.0.1.Final-sources.jar;...

    jboss-logging-3.4.3.Final-API文档-中文版.zip

    赠送jar包:jboss-logging-3.4.3.Final.jar; 赠送原API文档:jboss-logging-3.4.3.Final-javadoc.jar; 赠送源代码:jboss-logging-3.4.3.Final-sources.jar; 赠送Maven依赖信息文件:jboss-logging-3.4.3.Final....

    jboss-threads-3.1.0.Final-API文档-中文版.zip

    赠送jar包:jboss-threads-3.1.0.Final.jar; 赠送原API文档:jboss-threads-3.1.0.Final-javadoc.jar; 赠送源代码:jboss-threads-3.1.0.Final-sources.jar; 赠送Maven依赖信息文件:jboss-threads-3.1.0.Final....

    jboss-logging-3.4.1.Final-API文档-中文版.zip

    赠送jar包:jboss-logging-3.4.1.Final.jar; 赠送原API文档:jboss-logging-3.4.1.Final-javadoc.jar; 赠送源代码:jboss-logging-3.4.1.Final-sources.jar; 赠送Maven依赖信息文件:jboss-logging-3.4.1.Final....

    jboss-websocket-api_1.1_spec-2.0.0.Final-API文档-中英对照版.zip

    赠送jar包:jboss-websocket-api_1.1_spec-2.0.0.Final.jar; 赠送原API文档:jboss-websocket-api_1.1_spec-2.0.0.Final-javadoc.jar; 赠送源代码:jboss-websocket-api_1.1_spec-2.0.0.Final-sources.jar; 赠送...

    jboss-as-sprint-int-5.0.0.GA.jar 和 jboss-spring-int-vfs.jar

    标题中的"jboss-as-sprint-int-5.0.0.GA.jar"和"jboss-spring-int-vfs.jar"就是这样的两个关键组件,用于帮助从Tomcat顺利过渡到JBoss环境。 首先,我们来详细了解一下`jboss-as-sprint-int-5.0.0.GA.jar`。这个...

    jboss-as-sprint-int-5.0.0.GA.jar jboss-spring-int-vfs.jar

    "jboss-as-sprint-int-5.0.0.GA.jar" 和 "jboss-spring-int-vfs.jar" 是与JBoss应用服务器相关的两个关键组件,主要用于Spring框架与JBoss服务器的集成以及虚拟文件系统(Virtual File System,VFS)的支持。...

    jboss-logging-3.3.2.Final-API文档-中文版.zip

    赠送jar包:jboss-logging-3.3.2.Final.jar; 赠送原API文档:jboss-logging-3.3.2.Final-javadoc.jar; 赠送源代码:jboss-logging-3.3.2.Final-sources.jar; 赠送Maven依赖信息文件:jboss-logging-3.3.2.Final....

    jboss-websocket-api_1.1_spec-2.0.0.Final-API文档-中文版.zip

    赠送jar包:jboss-websocket-api_1.1_spec-2.0.0.Final.jar; 赠送原API文档:jboss-websocket-api_1.1_spec-2.0.0.Final-javadoc.jar; 赠送源代码:jboss-websocket-api_1.1_spec-2.0.0.Final-sources.jar; 赠送...

    jboss-logging-3.4.3.Final-API文档-中英对照版.zip

    赠送jar包:jboss-logging-3.4.3.Final.jar; 赠送原API文档:jboss-logging-3.4.3.Final-javadoc.jar; 赠送源代码:jboss-logging-3.4.3.Final-sources.jar; 赠送Maven依赖信息文件:jboss-logging-3.4.3.Final....

    jboss-annotations-api_1.3_spec-2.0.1.Final-API文档-中文版.zip

    赠送jar包:jboss-annotations-api_1.3_spec-2.0.1.Final.jar; 赠送原API文档:jboss-annotations-api_1.3_spec-2.0.1.Final-javadoc.jar; 赠送源代码:jboss-annotations-api_1.3_spec-2.0.1.Final-sources.jar;...

    jboss-threads-3.1.0.Final-API文档-中英对照版.zip

    赠送jar包:jboss-threads-3.1.0.Final.jar; 赠送原API文档:jboss-threads-3.1.0.Final-javadoc.jar; 赠送源代码:jboss-threads-3.1.0.Final-sources.jar; 赠送Maven依赖信息文件:jboss-threads-3.1.0.Final....

    jboss-backport-concurrent.jar

    jboss-backport-concurrent.jar jboss-backport-concurrent.jar

    jboss-marshalling-1.3.0.CR9.jar, jboss-marshalling-serial-1.3.0.CR9.jar

    jboss-marshalling-1.3.0.CR9.jar jboss-marshalling-serial-1.3.0.CR9.jar

    jboss-as-web.Final-RECOMPILE.jar.rar

    "jboss-as-web.Final-RECOMPILE.jar"这个文件就是针对JBoss AS 7热部署功能的一个关键组件。 热部署是软件开发过程中的一种理想特性,允许开发者在不中断应用程序服务的情况下更新或替换已部署的代码。对于持续迭代...

    jboss-eap-7.2.0.zip

    【JBoss EAP 7.2.0:企业级应用平台详解】 JBoss EAP(Enterprise Application Platform)是Red Hat公司推出的一款开源、基于Java EE(现在称为Jakarta EE)的应用服务器,它为企业级应用程序提供了稳定、安全和可...

    jboss-eap-6.4.0.zip

    JBoss EAP 6.4 是 Red Hat 提供的一个企业级应用服务器,它基于 Java EE 6 规范,提供了全面的中间件服务,用于构建、部署和管理企业级应用程序。这个版本是 JBoss 产品线的一个关键里程碑,因为它包含了众多功能...

    jboss-archive-browsing.jar

    jboss-archive-browsing.jar jboss-archive-browsing.jar

    jboss-native-2.0.8-windows-ssl

    标题 "jboss-native-2.0.8-windows-ssl" 暗示了我们要讨论的是JBoss Native在Windows环境下的一个版本,特别是针对SSL(Secure Socket Layer)支持的实现。JBoss Native是Red Hat JBoss中间件的一部分,它提供了一个...

    jboss-logging-3.4.2.Final-API文档-中文版.zip

    赠送jar包:jboss-logging-3.4.2.Final.jar; 赠送原API文档:jboss-logging-3.4.2.Final-javadoc.jar; 赠送源代码:jboss-logging-3.4.2.Final-sources.jar; 赠送Maven依赖信息文件:jboss-logging-3.4.2.Final....

Global site tag (gtag.js) - Google Analytics