- 浏览: 273530 次
- 性别:
- 来自: 杭州
文章分类
最新评论
-
muyufenghua:
public static <T super B> ...
浅谈Java泛型中的extends和super关键字 -
wantodare:
class Test1 {
{
a=1;
}
pr ...
Java对象初始化详解 -
wubo2qml:
问下如何进行列中数字大小的比较。我看了几个过滤器,最接近的是S ...
利用Filter进行HBase查询 -
blackproof:
rowkey是A_B我知道要的A集合,也知道要的B范围不用自定 ...
利用Filter进行HBase查询 -
bin_1715575332:
文章不错,尤其了后半部分讲解一些原理。
利用Filter进行HBase查询
注:本文中所述内容适合于Jboss 4.x系列应用服务器。
为了在同一台服务器上能够运行多个Jboss服务器,或者同时运行Jboss和Tomcat服务器,我们需要修改Jboss的各种端口。
Why configure JBoss's Ports?
Configuring port numbers in JBoss can seem a little complicated, but it's actually pretty easy to understand once you get how JBoss is configured. However, why bother spending the time learning all this if it isn't going to be useful? Here are a few reasons why you might want to configure JBoss ports:
JBoss 4.x Ports
Here are the ports used by JBoss 4.x:
Default port numbers and where they are configured.
Additional port numbers for clustered configurations
Other ports for optional services
How to configure ports for different instances of JBoss
Solution #1 : Use the Service Binding facility
The "Service Binding" feature uses a JMX bean to configure the other JMX beans (as far as I can tell). This requires you to make a file that has all of the possible bindings for each 'jboss server name'. The basics are:
这段话是说,Jboss在启动时会用一个MBean去配置其他MBean使用到的端口,我们就可以将不同Jboss实例使用的端口号预先定义在这个文件中,然后在jboss-service.xml中使用那个MBean,指定需要的参数,然后Jboss就会用你指定的端口去配置其他MBean。这个MBean的名字是org.jboss.services.binding.ServiceBindingManager。在jboss-service.xml中可以找到其定义,如下:
其中<attribute name="ServerName">ports-01</attribute>这个属性指定你要使用的某组端口号,<attribute name="StoreURL">${jboss.home.url}/docs/examples/binding-manager/sample-bindings.xml</attribute>这个属性定义了你使用的配置端口号的文件,这个链接是一个例子,我们可以根据这个例子配置自己的端口号。
See: [url]http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfiguringMultipleJBossInstancesOnOneMachine [/url]
这个功能在JBoss 5.x系列中是默认提供的。
Solution #2: Use M4 or ANT to pre-process the XML configuration files.
If JBoss isn't the only thing that needs port numbers, host names and directories configured into each instance than you need more than just the Service Binding feature. In this case, we experience one drawback of JBoss's modular configuration: there are lots of files to change! Although this isn't really that difficult it requires a bit of work and it might break if JBoss changes their configuration files around if you're not careful.
Solution #3 (the best of both) : Use a combination of Service Binding and ANT or M4
The answer to the drawbacks of solutions #1 and #2: Use both! If you use substitution on the service binding configuration file itself then it is as if all JBoss ports are configured in one file. This means you don't have to process each individual configuration file. The basic idea here is to create a service binding XML file that has the substitutable tokens in it, and use ANT or M4 to process this one file.
Mapping the EJB3 Remote Invoker Port
The example port bindings file doesn't map the EJB3 remoting port. This is easy:
Just replace '3873' with the port number you want to use.
What ports is JBoss Listening on?
On Linux, you can use:
$ lsof -p {jboss pid} | grep TCP
附:
Jboss 5.x以上版本的应用服务器跟4.x本版的应用服务器在端口修改上有很大不同。从本文可以看到对4.x端口修改要涉及到很多个文件,这样修改起来还是很不方便的。所以在5.x以上版本中,jboss提供了一个binding.xml文件,在/default/conf/bootstrap目录下面。所以在5.x版本里面端口的修改要方便一点。
为了在同一台服务器上能够运行多个Jboss服务器,或者同时运行Jboss和Tomcat服务器,我们需要修改Jboss的各种端口。
Why configure JBoss's Ports?
Configuring port numbers in JBoss can seem a little complicated, but it's actually pretty easy to understand once you get how JBoss is configured. However, why bother spending the time learning all this if it isn't going to be useful? Here are a few reasons why you might want to configure JBoss ports:
- You are running an instance of Tomcat on your machine already, and you can't start JBoss because port 8080 is already in use.
- You have a team of developers sharing a deployment machine. Each developer needs their own instance of JBoss (Note: if so, you will want to look at Shared JBoss Installation Directory also)
- A testing team wants to test different versions of the application using the same machine.
- You are planning on deploying more than one JBoss JVM per machine in a cluster to get higher availability and better performance (lots of smaller JVMs).
JBoss 4.x Ports
Here are the ports used by JBoss 4.x:
Default port numbers and where they are configured.
Default Port | Location | Description |
1099 | ./conf/jboss-service.xml or ./naming.sar/META-INF/jboss-service.xml | Bootstrap JNP port. |
1098 (anon) | ./conf/jboss-service.xml or ./naming.sar/META-INF/jboss-service.xml | RMI naming service port.Use '0' for an anonymous port. |
4444 | ./conf/jboss-service.xml or ./deploy/invokers-service.xml | RMI/JRMP invoker port |
4445 | ./conf/jboss-service.xml or ./deploy/invokers-service.xml | Pooled invoker |
8083 | ./conf/jboss-service.xml or ./deploy/dynclassloader-service.xml | RMI dynamic class loader port |
8080 | ./deploy/jbossweb-tomcat55.sar/server.xml | HTTP port for the web container |
8009 | ./deploy/jbossweb-tomcat55.sar/server.xml | AJP port for the web container |
8093 | ./deploy/jms/uil2-service.xml | UIL for JMS. |
8443 (optional) | ./deploy/jbossweb-tomcat55.sar/server.xml | HTTPS port for the web container |
Additional port numbers for clustered configurations
Default Port | Location | Description |
1100 | ./deploy/cluster-service.xml | HA-JNDI |
1101 (anon) | ./deploy/cluster-service.xml | RMI for HA-JNDI Use '0' for an anonymous port. |
4446 | ./deploy/cluster-service.xml | HA Pooled Invoker |
4447 | ./deploy/cluster-service.xml | HA JRMP |
45566 (mcast) | ./deploy/cluster-service.xml | JGroups clustering |
Other ports for optional services
Default Port | Location | Description |
3528 | ./deploy/iiop-service.xml | CORBA port |
3873 | ./deploy/ejb3.deployer/META-INF/jboss-service.xml | EJB3 remote invoker |
1162 | ./deploy/snmp-adaptor.sar/META-INF/jboss-service.xml | SNMP Log |
1161 | ./deploy/snmp-adaptor.sar/META-INF/jboss-service.xml | SNMP Adaptor |
19001 | jmx-rmi-adaptor.sar | JMX over RMI |
How to configure ports for different instances of JBoss
Solution #1 : Use the Service Binding facility
The "Service Binding" feature uses a JMX bean to configure the other JMX beans (as far as I can tell). This requires you to make a file that has all of the possible bindings for each 'jboss server name'. The basics are:
这段话是说,Jboss在启动时会用一个MBean去配置其他MBean使用到的端口,我们就可以将不同Jboss实例使用的端口号预先定义在这个文件中,然后在jboss-service.xml中使用那个MBean,指定需要的参数,然后Jboss就会用你指定的端口去配置其他MBean。这个MBean的名字是org.jboss.services.binding.ServiceBindingManager。在jboss-service.xml中可以找到其定义,如下:
<mbean code="org.jboss.services.binding.ServiceBindingManager" name="jboss.system:service=ServiceBindingManager"> <attribute name="ServerName">ports-01</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>
其中<attribute name="ServerName">ports-01</attribute>这个属性指定你要使用的某组端口号,<attribute name="StoreURL">${jboss.home.url}/docs/examples/binding-manager/sample-bindings.xml</attribute>这个属性定义了你使用的配置端口号的文件,这个链接是一个例子,我们可以根据这个例子配置自己的端口号。
- Create a globally shared "Service Binding" file that will contain the port numbers for each possible instance of JBoss on the machine by 'configuration name'. 例如,我$JBOSS_HOME$\server\default\conf目录下面建立了一个名为bindings.xml的文件,在这个文件中,定义了多组端口号,每组端口号对应一个Jboss实例。
- Uncomment or add a "Service Binding" section in conf/jboss-service.xml. This where the configuration will select which set of bindings it will use from the shared bindings file. 在jboss-service.xml里面启动org.jboss.services.binding.ServiceBindingManager这个MBean,指定参数之后,Jboss启动时就会用你指定的那组端口来配置其他的MBean。
See: [url]http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfiguringMultipleJBossInstancesOnOneMachine [/url]
这个功能在JBoss 5.x系列中是默认提供的。
Solution #2: Use M4 or ANT to pre-process the XML configuration files.
If JBoss isn't the only thing that needs port numbers, host names and directories configured into each instance than you need more than just the Service Binding feature. In this case, we experience one drawback of JBoss's modular configuration: there are lots of files to change! Although this isn't really that difficult it requires a bit of work and it might break if JBoss changes their configuration files around if you're not careful.
Solution #3 (the best of both) : Use a combination of Service Binding and ANT or M4
The answer to the drawbacks of solutions #1 and #2: Use both! If you use substitution on the service binding configuration file itself then it is as if all JBoss ports are configured in one file. This means you don't have to process each individual configuration file. The basic idea here is to create a service binding XML file that has the substitutable tokens in it, and use ANT or M4 to process this one file.
Mapping the EJB3 Remote Invoker Port
The example port bindings file doesn't map the EJB3 remoting port. This is easy:
<service-config name="jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3" delegateClass="org.jboss.services.binding.AttributeMappingDelegate"> <delegate-config> <attribute name="InvokerLocator">socket://${jboss.bind.address}:3873</attribute> </delegate-config> <binding port="3873"/> </service-config>
Just replace '3873' with the port number you want to use.
What ports is JBoss Listening on?
On Linux, you can use:
$ lsof -p {jboss pid} | grep TCP
附:
Jboss 5.x以上版本的应用服务器跟4.x本版的应用服务器在端口修改上有很大不同。从本文可以看到对4.x端口修改要涉及到很多个文件,这样修改起来还是很不方便的。所以在5.x以上版本中,jboss提供了一个binding.xml文件,在/default/conf/bootstrap目录下面。所以在5.x版本里面端口的修改要方便一点。
发表评论
-
Servlet 3.0新特性
2011-03-11 13:12 1383Servlet 3.0中最主要的两个新特性总结如下: 改变了 ... -
Java中wait与notify方法的使用
2010-05-22 14:09 9495在java多线程编程中 ... -
MySql批量插入数据
2010-04-05 15:55 10679在实际的开发过程中,特别是大型的分布式应用系统,往往会涉 ... -
去掉对Spring BeanFacotry的getBean方法的依赖
2009-12-27 23:52 2740在使用Spring时,有时会碰到这种情况: 引用需要在 ... -
通过HttpServletRequestWrapper解决Tomcat请求乱码问题
2009-11-16 23:08 2291应用一:解决tomcat下中文乱码问题(先来个简单的) 在t ... -
相对路径获取Tomcat Web容器中的资源
2009-08-20 21:36 14465最近做项目碰到个问题,我需要利用velocity模版来渲染 ... -
Jboss是数据源配置
2009-08-16 15:38 2044配置Jboss的数据源非常简单,可以从$JBOSS_HOME\ ... -
JBOSS共享安装
2009-08-07 14:36 1949本文内容适合于Jboss 4.x系列应用服务器。 在项目中, ... -
Tomcat热部署
2009-06-24 20:33 3819使用过tomcat的人都知道 ... -
Improved Session Tracking
2009-06-24 01:23 1182Improved Session Tracking Septe ... -
jsessionid存在的问题及其解决方案
2009-06-24 00:29 3193jsessionid是Java Web Server( ... -
tomcat数据库连接池设置
2009-06-23 16:56 14491.Tomcat中的设置 2.我的工作目录在c:\eclip ... -
ORA-12514:TNS:监听程序当前无法识别连接描述符中请求的服务
2009-06-23 16:47 25811. 首先查看tnsnames.ora ... -
webwork type等于redirect时的参数传递
2009-06-23 02:09 2166Webwork在使用result类型为redirect时,将会 ... -
js跨域问题小结
2009-06-11 15:43 1744js跨域问题小结 javascript出于安全方面的考虑,是不 ... -
Spring共享上下文机制
2009-05-19 15:53 3870对于Spring应用程序上下文的引用基本有两种形式 ... -
webwork result type之redirect&redirect-action
2009-05-09 17:49 3238可能大家都知道在webwork里面如果想重定向到另外一个 ... -
使用javascirpt获取JSON格式的日期
2009-05-08 14:00 1999在用json-lib里的net.sf.json.JSONO ... -
JQuery JSON异步请求中文乱码问题
2009-05-08 13:48 15870最近在用Jquery的getJSON方法进行AJAX异步调 ... -
webwork-2.1.7与Spring2.0整合
2009-05-03 14:00 1473这里使用随webwork2.2发布的ActionAutowir ...
相关推荐
- **JBoss 3.0.x 版本**:支持基于轮询的简单负载均衡算法。 - **JBoss 3.2 及以上版本**:引入了更复杂的负载均衡算法,如最少活跃事务优先(LATTP)等。 #### 七、HTTP Session 集群 ##### 7.1 概念介绍 - **定义...
了解这些默认端口及其配置位置对于管理JBoss实例至关重要。 1. **1099**:此端口用于BootStrap JNP(Java Naming and Directory Protocol)服务,可以在`./conf/jboss-service.xml`或`./naming.sar/META-INF/jboss-...
- 更改默认端口:如果在同一台机器上需要启动多个JBOSS实例,需要更改JBOSS的默认端口。可以在`.\Jboss\server\port-bindings`目录下的配置文件中更改端口号。 #### 结语 通过以上步骤,您应该能够在Eclipse环境中...
使用`mkdir /app/jboss`创建了“/app/jboss”目录,随后通过`chown jboss /app/jboss/ -R`和`chmod 755 /app/jboss/ -R`命令分别更改了该目录的所有者为“jboss”用户,并赋予了相应的读写执行权限。 ### 二、安装...
- **位置**: `X:\jboss4\server\default\conf` - **功能**: 标准的CMP实体EJB部署描述文件。 - **配置要点**: - 描述数据源及其映射类型。 - 描述EJB映射的表。 - 描述EJB的finder方法。 - 描述类型映射。 ###...
如果你使用的是JBoss,请拷贝至:x:/jboss/server/default/deploy (注:默认部署后既解包,如没有解包,请首先解包) 4.4.数据库连接配置 打开:x:/tomcat/faceye/WebRoot/Web-INF/classes/...
4. **配置Tomcat**:在`conf`目录下的`server.xml`是主要的配置文件,用于定义服务器端口、虚拟主机、Context(应用上下文)和其他设置。根据需求,可能需要修改默认配置。 5. **启动与停止**:在`bin`目录下,可以...
通过修改`server.xml`中的Connector元素,可以配置端口、协议和其他相关参数。 9. **安全管理**:Tomcat允许配置角色和权限,通过`conf/tomcat-users.xml`文件添加用户和角色,实现基于角色的访问控制。 10. **JMX...
- 在JBoss的`bin`目录下,使用`chmod u+x *.sh`命令使所有`.sh`文件具有执行权限。 **3.3 启动与停止JBoss** - 使用`<JBOSS_HOME>/bin/standalone.sh`启动JBoss。 - 使用`<JBOSS_HOME>/bin/jboss-cli.sh`关闭JBoss...
- **重要性**: 修改服务端口对于避免端口冲突以及满足特定需求非常重要。 #### 三、问答题知识点解析 1. **WebLogic的定义** - **定义**: WebLogic是BEA公司(现已被Oracle收购)开发的一款基于J2EE架构的中间件...
配置主要通过修改`conf/server.xml`文件,可以设置端口号、上下文路径、连接器参数等。 4. **部署Web应用** 应用程序通常以WAR(Web ARchive)文件形式部署到Tomcat的`webapps`目录下,Tomcat会自动解压并启动应用...
- `web.xml`:每个Web应用程序都有一个此文件,定义了应用的Servlet、过滤器、监听器等组件及其配置。 4. **目录结构**: - `conf`:存放所有配置文件。 - `webapps`:默认的Web应用程序部署目录。 - `logs`:...
- **监听端口**:Tomcat 默认监听端口为 **8080**,可以通过配置文件修改。 - **Web 应用部署**:每个 Web 应用都需要放置在 `webapps` 目录下,并且包含一个 `WEB-INF` 目录,其中存放 `classes`、`lib` 文件夹及...