- 浏览: 830176 次
- 性别:
- 来自: 北京、四川
文章分类
最新评论
-
sunbeamzheng:
总结的很好,好好看看。 拷贝问题确实很需要注意,特别是影不影响 ...
java深拷贝与浅拷贝 -
xmh8023:
...
获取POST数据的值 -
xmh8023:
我访问别的服务器怎么办?急求
获取POST数据的值 -
xmh8023:
String urlString="http://l ...
获取POST数据的值 -
lv12312:
Tomcat 7的老版本么?有bug的,https://iss ...
JMX问题
oscache集群配置参数说明
url:http://www.cs.cornell.edu/Info/Projects/JavaGroupsNew/userguide/html/user/index.html
这里使用默认的cache.event.listeners=com.opensymphony.oscache.plugins.clustersupport.JavaGroupsBroadcastingListener
oscache集群的默认配置如下:
UDP(mcast_addr=231.12.21.132;mcast_port=45566;ip_ttl=32;\
mcast_send_buf_size=150000;mcast_recv_buf_size=80000):\
PING(timeout=2000;num_initial_members=3):\
MERGE2(min_interval=5000;max_interval=10000):\
FD_SOCK:VERIFY_SUSPECT(timeout=1500):\
pbcast.NAKACK(gc_lag=50;retransmit_timeout=300,600,1200,2400,4800;max_xmit_size=8192):\
UNICAST(timeout=300,600,1200,2400):\
pbcast.STABLE(desired_avg_gossip=20000):\
FRAG(frag_size=8096;down_thread=false;up_thread=false):\
pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=true)
FD
The failure detection layer (FD) periodically tries to reach its nearest neighbor to the right
Figure 7.1: Failure detection layer
The nearest neighbor is always computed based on the local view. Since all views in all stacks have the same member ordering, every member can always determine its next neighbor to the right. When a new view is received, the neighbor is recomputed.
The FD layer periodically pings its neighbor. When no response has been received after max_tries (each with a timeout), a SUSPECT message is multicast to all members of the group. The GMS layer which is currently the coordinator processes the message, all others ignore it7.1. In the example, the coordinator would be A. It pings B which in turn pings C. The last member ( E) 'wraps around' and pings the first (A).
FRAG(the fragmentation protocol layer)
It essentially breaks up bigger messages into smaller ones and reassembles them at the receiver's side.
GMS
The group membership service is probably the most important protocol layer, and also the most complex to implement. The description is based on the current (March 99) GMS layer, but work is underway to replace this layer with a new one (RpcGMS).
When a CONNECT event is received by the GMS layer, it tries to join the group. To do so, it first tries to retrieve the initial membership. If no other members can be found, it assumes it is the first member and sends a VIEW_CHANGE event up/down the stack. Otherwise, it determines the coordinator and sends a unicast message to the latter to join it to the group. The coordinator adds the new member to its local view and multicasts the new view to all GMS layers, which then in turn generate VIEW_CHANGE events up/down the stack.
When a member wants to leave a group, it disconnects from the channel. This causes a DISCONNECT event to be sent down where it is caught by the GMS layer. The latter sends a unicast LEAVE request to the coordinator, which in turn removes the member from its local view and multicasts the new view.
When a SUSPECT event is received by the GMS layer, if the layer is the current coordinator, the member will be removed from the local view and a new view multicast to all members. Otherwise, the event is just dropped. In case the suspected member is the coordinator itself, the next member of the group in order takes over and multicasts a new view (excluding the old coordinator).
PING
The PING layer is responsible for finding the initial membership of a group. It does so upon reception of a FIND_INITIAL_MBRS event (sent by the GMS layer). When done, a FIN_INITIAL_MBRS_OK event is sent up the stack, containing the members found as argument. GMS waits until it receives the initial membership, and - based on it - determines the current coordinator to which it then sends a join request. When not receiving the initial members within a certain time frame, a timeout is received, and the GMS creates a singleton group (with itself as only member).
Currently the initial membership is found either using a multicast to an IP multicast address to which all members respond, or using the Router daemon (see 3.8.1), if IP multicast is not enabled.
UDP
UDP is currently the bottommost layer available to use in a protocol stack.
When it receives a START event (upon channel connection), it creates a unicast and an IP multicast socket. The IP address plus the port number of the unicast socket form the channel's address: every message sent to either a single destination or the whole group will be marked with this address (in the source field). As soon as the local address is know, a SET_LOCAL_ADDRESS event will be sent up the stack, followed by a START_OK.
When a STOP event is received, the sockets are closed and a STOP_OK event is passed up the stack as acknowledgment. When a channel is closed, local address becomes meaningless (since based on a open socket).
Messages sent down the stack will be added a UDP header containing the group name and then put on the network as datagram packets. Datagrams received from the network will be converted into messages and their UDP header removed. If the header's group name is different from the channel's group name, then the message will be dropped. Otherwise, it is passed up the stack.
UDP can either use IP multicasting or unicasting to disseminate messages to the group. If option ip_mcast is false, unicast is used: when a message is to be sent to all group members, it is sent n times to each member. To do this, UDP has to cache the membership when receiving VIEW_CHANGE events.
The IP multicast address and port can be configured using options mcast_addr and mcast_port. Although it is not a problem when different groups use the same IP multicast address and port (since messages by members belonging to a different group are discarded by UDP), it is often preferable to choose different parameters. However, all group members must have their UDP layers configured too the same IP multicast address and port (when using IP mcast).
url:http://www.cs.cornell.edu/Info/Projects/JavaGroupsNew/userguide/html/user/index.html
这里使用默认的cache.event.listeners=com.opensymphony.oscache.plugins.clustersupport.JavaGroupsBroadcastingListener
oscache集群的默认配置如下:
UDP(mcast_addr=231.12.21.132;mcast_port=45566;ip_ttl=32;\
mcast_send_buf_size=150000;mcast_recv_buf_size=80000):\
PING(timeout=2000;num_initial_members=3):\
MERGE2(min_interval=5000;max_interval=10000):\
FD_SOCK:VERIFY_SUSPECT(timeout=1500):\
pbcast.NAKACK(gc_lag=50;retransmit_timeout=300,600,1200,2400,4800;max_xmit_size=8192):\
UNICAST(timeout=300,600,1200,2400):\
pbcast.STABLE(desired_avg_gossip=20000):\
FRAG(frag_size=8096;down_thread=false;up_thread=false):\
pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=true)
FD
The failure detection layer (FD) periodically tries to reach its nearest neighbor to the right
Figure 7.1: Failure detection layer
The nearest neighbor is always computed based on the local view. Since all views in all stacks have the same member ordering, every member can always determine its next neighbor to the right. When a new view is received, the neighbor is recomputed.
The FD layer periodically pings its neighbor. When no response has been received after max_tries (each with a timeout), a SUSPECT message is multicast to all members of the group. The GMS layer which is currently the coordinator processes the message, all others ignore it7.1. In the example, the coordinator would be A. It pings B which in turn pings C. The last member ( E) 'wraps around' and pings the first (A).
FRAG(the fragmentation protocol layer)
It essentially breaks up bigger messages into smaller ones and reassembles them at the receiver's side.
GMS
The group membership service is probably the most important protocol layer, and also the most complex to implement. The description is based on the current (March 99) GMS layer, but work is underway to replace this layer with a new one (RpcGMS).
When a CONNECT event is received by the GMS layer, it tries to join the group. To do so, it first tries to retrieve the initial membership. If no other members can be found, it assumes it is the first member and sends a VIEW_CHANGE event up/down the stack. Otherwise, it determines the coordinator and sends a unicast message to the latter to join it to the group. The coordinator adds the new member to its local view and multicasts the new view to all GMS layers, which then in turn generate VIEW_CHANGE events up/down the stack.
When a member wants to leave a group, it disconnects from the channel. This causes a DISCONNECT event to be sent down where it is caught by the GMS layer. The latter sends a unicast LEAVE request to the coordinator, which in turn removes the member from its local view and multicasts the new view.
When a SUSPECT event is received by the GMS layer, if the layer is the current coordinator, the member will be removed from the local view and a new view multicast to all members. Otherwise, the event is just dropped. In case the suspected member is the coordinator itself, the next member of the group in order takes over and multicasts a new view (excluding the old coordinator).
PING
The PING layer is responsible for finding the initial membership of a group. It does so upon reception of a FIND_INITIAL_MBRS event (sent by the GMS layer). When done, a FIN_INITIAL_MBRS_OK event is sent up the stack, containing the members found as argument. GMS waits until it receives the initial membership, and - based on it - determines the current coordinator to which it then sends a join request. When not receiving the initial members within a certain time frame, a timeout is received, and the GMS creates a singleton group (with itself as only member).
Currently the initial membership is found either using a multicast to an IP multicast address to which all members respond, or using the Router daemon (see 3.8.1), if IP multicast is not enabled.
UDP
UDP is currently the bottommost layer available to use in a protocol stack.
When it receives a START event (upon channel connection), it creates a unicast and an IP multicast socket. The IP address plus the port number of the unicast socket form the channel's address: every message sent to either a single destination or the whole group will be marked with this address (in the source field). As soon as the local address is know, a SET_LOCAL_ADDRESS event will be sent up the stack, followed by a START_OK.
When a STOP event is received, the sockets are closed and a STOP_OK event is passed up the stack as acknowledgment. When a channel is closed, local address becomes meaningless (since based on a open socket).
Messages sent down the stack will be added a UDP header containing the group name and then put on the network as datagram packets. Datagrams received from the network will be converted into messages and their UDP header removed. If the header's group name is different from the channel's group name, then the message will be dropped. Otherwise, it is passed up the stack.
UDP can either use IP multicasting or unicasting to disseminate messages to the group. If option ip_mcast is false, unicast is used: when a message is to be sent to all group members, it is sent n times to each member. To do this, UDP has to cache the membership when receiving VIEW_CHANGE events.
The IP multicast address and port can be configured using options mcast_addr and mcast_port. Although it is not a problem when different groups use the same IP multicast address and port (since messages by members belonging to a different group are discarded by UDP), it is often preferable to choose different parameters. However, all group members must have their UDP layers configured too the same IP multicast address and port (when using IP mcast).
发表评论
-
Java并发编程:volatile关键字解析
2015-07-30 11:30 637转:http://www.cnblogs.com/dolp ... -
Java内存模型
2015-07-29 13:55 9161. 概述 多任务和 ... -
自定义classloader
2015-07-29 13:54 692转:http://tiantian911.iteye.com ... -
自定义ClassLoader实现java应用核心逻辑模块热部署
2015-07-29 13:51 1023转:http://blog.csdn.net/zhangda ... -
java classloader原理初探
2015-07-29 10:14 669转:http://www.cnblogs.com/ ... -
Java 内存分配全面浅析
2015-07-29 08:52 609转:http://blog.csdn.net/shimi ... -
http stream
2014-07-29 16:38 1145StringBuilder sb = new String ... -
Tomcat远程调试
2011-04-09 12:33 1062需要在Tomcat中的catalina.bat中添加如下的一行 ... -
用jmx监控多台服务器(tomcat)
2010-09-08 18:25 4577因为需要写一个后台监控服务器的程序,涉及到jmx,也涉 ... -
call cmd /c start 一点疑问
2010-09-01 10:16 2250call "cmd /c start aaa.bat ... -
Windows计划任务之schtasks
2010-08-30 13:21 3596创建:SCHTASKS /Create /RU SYSTEM ... -
ajax返回值中有中文存在的乱码现象
2010-08-27 16:28 1447ajax返回值中有中文存在的乱码现象,解决就加入下面一行代码即 ... -
MIME TYPE
2010-08-26 16:23 7262最近要做需要在页面上放音频的东西,因此需要用到mime typ ... -
JMX问题
2010-08-20 17:20 5507这个问题貌似是启动tomcat之后就获取不到jmx的链接了,不 ... -
Eclipse控制台乱码
2010-08-05 15:18 4894安装了Eclipse,在运行tomcat时,控制台的中文显示乱 ... -
JMX服务端和客户端的代码
2010-07-27 15:37 3575服务端代码如下 package com.rmi; i ... -
JMX连接Tomcat的JMX测试类
2010-07-27 15:33 3301首先是为了使tomcat支持JMX,必须在tomcat的启动项 ... -
JMX的一个链接类
2010-07-27 09:37 1465package com.pachira.oamp.jmxS ... -
java中文转unicode码
2010-07-22 11:04 43412转载地址:http://www.iteye.com/topic ... -
获取POST数据的值
2010-07-21 14:17 9925当method为POST,Content-Type为 ...
相关推荐
4. 如果需要,根据应用需求调整 `oscache.properties` 文件中的配置参数。 OSCache 还支持集群环境和主动缓存刷新等高级特性。开发者可以进一步阅读 OpenSymphony 官方网站提供的文档以获取更多信息,以充分利用这...
5.2.2 CacheFilter参数说明 CacheFilter的配置涉及多个参数,例如`cacheName`用于指定缓存区域,`cacheKey`定义了缓存键的生成规则,`cacheTimeToLive`设置缓存存活时间等。 5.3 局部缓存 局部缓存则是在特定的业务...
通过阅读源码,我们可以了解到如何配置和自定义缓存策略,以及集群中的数据同步是如何实现的。例如,可以查看`CacheManager`类如何初始化和管理缓存,`Cache`类如何存储和检索对象,以及`Cluster`类如何处理集群通信...
《osCache缓存配置详解》 osCache是Java平台上的一个高效、易用的缓存解决方案,它由Tuckey组织开发,广泛应用于各种Web应用中,以提高数据读取速度,减轻数据库压力。osCache的核心功能是提供了一个内存中的对象...
OScache配置 缓存技术 一、缓存整个页面 在 OSCache组件中提供了一个CacheFilter用于实现页面级的缓存,主要用于对web应用中的某些动态页面进行缓存,尤其是那些需要生成PDF 格式文件/报表、图片文件等的页面,...
综上所述,这个压缩包提供的配置文件涵盖了Spring MVC的Web应用开发、MyBatis的数据访问、Spring 3.0的依赖注入和AOP以及oscache的缓存管理等多个方面,对于理解和学习这些技术的集成应用非常有帮助。在实际项目中,...
在实际项目中,这些配置文件会结合使用,形成一个完整的Spring MVC、Mybatis、Spring和oscache的集成环境,实现高效的数据访问、业务逻辑处理和页面展示。通过合理的配置,可以优化性能、增强可维护性和扩展性。
3. 根据你的应用需求,配置 `oscache.properties` 文件以设置缓存参数。 **使用方法** OSCache 提供了多种使用方式: 1. **缓存对象**:可以直接调用 OSCache 的 API 接口来缓存和检索对象。API 包括了缓存的存取...
5. **配置属性文件**:在项目`src`目录下创建`oscache.properties`文件,用于设置Oscache的各种参数,如缓存策略、过期时间等。 6. **集成到JSP页面**:在JSP页面中引入Oscache标签库,使用`<%@taglib uri="oscache...
2. **配置OSCache**:创建一个`oscache.properties`配置文件,定义缓存的大小、过期策略、是否启用分布式缓存等参数。例如: ``` cache.size=1000 cache.memoryStoreEvictionPolicy=LRU distributed.cache=false...
`oscache.properties` 是OSCache的配置文件,它包含了缓存的设置参数,例如缓存的大小、过期策略、是否启用缓存更新监听器等。开发者可以通过修改这个文件来定制OSCache的行为,以适应不同的应用需求。 `oscache-...
- osCache还支持集群环境,通过JGroups等工具实现分布式缓存,使得多个节点间的数据共享成为可能。 5. **osCache的使用注意事项**: - 考虑缓存的更新策略:当数据库中的数据发生变化时,需要确保缓存能够及时...
osCache 是一个开源的、基于Java的缓存框架,它为Java应用程序提供了高效且可配置的内存缓存功能。在本文中,我们将深入探讨osCache的基本概念、工作原理以及如何在实际项目中进行配置和使用。 一、osCache基本概念...
2. **配置指南**: 解释如何配置`oscache.xml`,以及各配置项的含义和用途。 3. **API文档**: 描述了OSCache的类库接口,方便开发者进行深入开发。 4. **示例代码**: 提供实际运行的代码片段,帮助理解如何在项目中...
OSCache标记库由... (4) 支持集群:集群缓存数据能被单个的进行参数配置,不需要修改代码。 (5) 缓存过期:你可以有最大限度的控制缓存对象的过期,包括可插入式的刷新策略(如果默认性能不能满足需要时)。
- `cache.cluster.jms.*`:如果配置集群,这些属性用于设置 JMS 主题和节点,以实现分布式缓存通信。 使用 OSCache 的过程包括初始化、配置、加载缓存、访问缓存以及管理缓存。例如,可以通过编程方式初始化 ...
虽然主要是单机缓存解决方案,但OSCache也可以扩展到分布式环境,通过集群共享缓存,进一步提高系统可扩展性和可用性。 总之,OSCache-2.4.1是一个强大的缓存解决方案,旨在提高JSP应用的性能,减轻数据库压力,...
osCache不仅可以用于Web应用,也可以用于任何Java应用程序,支持集群环境,提供了丰富的功能和配置选项。 1. **osCache的基本概念** - **缓存**:缓存是一种技术,用于临时存储频繁访问的数据,以便快速响应用户的...