同一台机器启动多个JBOSS的设置

本文详细介绍了如何修改JBoss服务的多个端口信息,包括WebService、JNDI、RMI、JMS和EJB服务地址,以及如何更改jboss启动端口和Jconsole监控端口。通过具体的步骤指导,帮助开发者解决JBoss配置过程中的常见问题。

    同一台机器启动多个JBoss不像Tomcat,Tomcat只需要修改两三个端口即可,而JBoss默认发布的服务端口包括http协议的8080、AJP协议的8009、JNP服务的1099、RMI命名服务的1098、RMI/JRMP invoker的4444端口等,而且不是在同一个文件中配置的,有些在server.xml中,有些在配置下的jboss-service.xml文件中。

以下是本人修改成功的设置步骤:

1)  更改webservice的端口信息,\server\default\conf\jboss-service.xml文件

<mbean code="org.jboss.web.WebService"
      name="jboss:service=WebService">
      <attribute name="Port"></attribute>
      <!-- Should non-EJB .class files be downloadable -->
      <attribute name="DownloadServerClasses">true</attribute>
      <!-- Should resources other than .class files be downloadable. Both
         DownloadServerClasses and DownloadResources must be true for resources
         to be downloadable. This is false by default because its generally a
         bad idea as server configuration files that container security
         information can be accessed.
       -->
      <attribute name="DownloadResources">false</attribute>
      <attribute name="Host">${jboss.bind.address}</attribute>
      <attribute name="BindAddress">${jboss.bind.address}</attribute>
      <!-- Use the default thread pool for dynamic class loading -->
      <depends optional-attribute-name="ThreadPool"
         proxy-type="attribute">jboss.system:service=ThreadPool</depends>
   </mbean>

2) 更改JNDI的端口信息,\server\default\conf\jboss-service.xml文件

<mbean code="org.jboss.naming.NamingService"
      name="jboss:service=Naming"
      xmbean-dd="resource:xmdesc/NamingService-xmbean.xml">
      <!-- The call by value mode. true if all lookups are unmarshalled using
      the caller's TCL, false if in VM lookups return the value by reference.
      -->
      <attribute name="CallByValue">false</attribute>
      <!-- The listening port for the bootstrap JNP service. Set this to -1
        to run the NamingService without the JNP invoker listening port.
      -->
      <attribute name="Port"></attribute>
      <!-- The bootstrap JNP server bind address. This also sets the default
      RMI service bind address. Empty == all addresses
       -->
      <attribute name="BindAddress">${jboss.bind.address}</attribute>
      <!-- The port of the RMI naming service, 0 == anonymous -->
      <attribute name="RmiPort"></attribute>
      <!-- The RMI service bind address. Empty == all addresses
       -->
      <attribute name="RmiBindAddress">${jboss.bind.address}</attribute>
      <!-- The thread pool service used to control the bootstrap lookups -->
      <depends optional-attribute-name="LookupPool"
         proxy-type="attribute">jboss.system:service=ThreadPool</depends>
   </mbean>

3) 更改RMI端口信息,\server\default\conf\jboss-service.xml文件

<!-- RMI/JRMP invoker -->
   <mbean code="org.jboss.invocation.jrmp.server.JRMPInvoker"
      name="jboss:service=invoker,type=jrmp">
      <attribute name="RMIObjectPort"></attribute>
      <attribute name="ServerAddress">${jboss.bind.address}</attribute>
      <!--
      <attribute name="RMIClientSocketFactory">custom</attribute>
      <attribute name="RMIServerSocketFactory">custom</attribute>
      <attribute name="RMIServerSocketAddr">custom</attribute>
      <attribute name="SecurityDomain">ssl-domain-name</attribute>
      -->
      <depends>jboss:service=TransactionManager</depends>
   </mbean>

   <mbean code="org.jboss.invocation.local.LocalInvoker"
      name="jboss:service=invoker,type=local">

      <depends>jboss:service=TransactionManager</depends>
   </mbean>

   <mbean code="org.jboss.invocation.pooled.server.PooledInvoker"
      name="jboss:service=invoker,type=pooled">
      <attribute name="NumAcceptThreads">1</attribute>
      <attribute name="MaxPoolSize">300</attribute>
      <attribute name="ClientMaxPoolSize">300</attribute>
      <attribute name="SocketTimeout">60000</attribute>
      <attribute name="ServerBindAddress">${jboss.bind.address}</attribute>
      <attribute name="ServerBindPort"></attribute>
      <attribute name="ClientConnectAddress">${jboss.bind.address}</attribute>
      <attribute name="ClientConnectPort">0</attribute>
      <attribute name="ClientRetryCount">1</attribute>
      <attribute name="EnableTcpNoDelay">false</attribute>

4) 更改JMS端口, \server\default\deploy\jms\uil2-service.xml文件

<mbean code="org.jboss.mq.il.uil2.UILServerILService"
     name="jboss.mq:service=InvocationLayer,type=UIL2">

    <!-- The server chain -->
    <depends optional-attribute-name="Invoker">jboss.mq:service=Invoker</depends>
    <!-- JNDI binding -->
    <attribute name="ConnectionFactoryJNDIRef">ConnectionFactory</attribute>
    <!-- JNDI binding for XA -->
    <attribute name="XAConnectionFactoryJNDIRef">XAConnectionFactory</attribute>
    <!-- The bind address -->
    <attribute name="BindAddress">${jboss.bind.address}</attribute>
    <!-- The bind port -->
<attribute name="ServerBindPort"></attribute>

5) 修改EJB服务地址,\server\default\deploy\iPegasusWEB.war\WEB-INF\classes\ipegasus.properties文件

EJB_SERVER_URL = localhost:  //填写步骤2中修改后的Port
IMG_REMOTE_URL = http://localhost:9999/ipegasus/UploadFile/
REPLACE_URL = /ipegasus/UploadFile/

6) 更改jboss启动端口,\server\default\deploy\jbossweb-tomcat55.sar\server.xml文件

<!-- A HTTP/1.1 Connector on port 8080 -->
      <Connector port="" address="${jboss.bind.address}"
         maxThreads="350" strategy="ms" maxHttpHeaderSize="8192"
         emptySessionPath="true"
         enableLookups="false" redirectPort="8443" acceptCount="100"
         connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="GBK"/>

7) 修改Jconsole监控端口,\jboss \bin\run.bat文件

set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.port=  -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintTenuringDistribution -XX:+PrintClassHistogram -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime

转载于:https://www.cnblogs.com/zonglr/p/4994833.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值