`
PowerNTT
  • 浏览: 27121 次
  • 性别: Icon_minigender_1
  • 来自: 大连
社区版块
存档分类
最新评论

Jboss default方式下的Cluster配置[四]

阅读更多
Jgroup & OSCache

Import jars:

jgroups-all.jar [JGroups-2.6.3]
oscache-2.4.1.jar

Configuration

oscache.properties

# CACHE IN MEMORY
#
# If you want to disable memory caching, just uncomment this line.
#
# cache.memory=false


# CACHE KEY
#
# This is the key that will be used to store the cache in the application
# and session scope.
#
# If you want to set the cache key to anything other than the default
# uncomment this line and change the cache.key
#
# cache.key=__oscache_cache


# USE HOST DOMAIN NAME IN KEY
#
# Servers for multiple host domains may wish to add host name info to
# the generation of the key.  If this is true, then uncomment the
# following line.
#
# cache.use.host.domain.in.key=true


# CACHE LISTENERS
#
# These hook OSCache events and perform various actions such as logging
# cache hits and misses, or broadcasting to other cache instances across a cluster.
# See the documentation for further information.
#
cache.event.listeners= com.opensymphony.oscache.plugins.clustersupport.JavaGroupsBroadcastingListener,\
                      com.opensymphony.oscache.extra.CacheEntryEventListenerImpl,\
                     com.opensymphony.oscache.extra.CacheMapAccessEventListenerImpl,\
                     com.opensymphony.oscache.extra.ScopeEventListenerImpl,\
                     com.opensymphony.oscache.extra.StatisticListenerImpl

# CACHE PERSISTENCE CLASS
#
# Specify the class to use for persistence. If you use the supplied DiskPersistenceListener,
# don't forget to supply the cache.path property to specify the location of the cache
# directory.
# 
# If a persistence class is not specified, OSCache will use memory caching only.
#
cache.persistence.class=com.opensymphony.oscache.plugins.diskpersistence.DiskPersistenceListener
# cache.persistence.class=com.opensymphony.oscache.plugins.diskpersistence.HashDiskPersistenceListener

# CACHE OVERFLOW PERSISTENCE
# Use persistent cache in overflow or not. The default value is false, which means
# the persistent cache will be used at all times for every entry.  true is the recommended setting.
#
cache.persistence.overflow.only=true

# CACHE DIRECTORY
#
# This is the directory on disk where caches will be stored by the DiskPersistenceListener.
# it will be created if it doesn't already exist. Remember that OSCache must have
# write permission to this directory.
#
# Note: for Windows machines, this needs \ to be escaped
# ie Windows:
# cache.path=c:\\myapp\\cache
# or *ix:
cache.path=/opt/cache
#
# cache.path=c:\\app\\cache


# CACHE ALGORITHM
#
# Default cache algorithm to use. Note that in order to use an algorithm
# the cache size must also be specified. If the cache size is not specified,
# the cache algorithm will be Unlimited cache.
#
cache.algorithm=com.opensymphony.oscache.base.algorithm.LRUCache
# cache.algorithm=com.opensymphony.oscache.base.algorithm.FIFOCache
# cache.algorithm=com.opensymphony.oscache.base.algorithm.UnlimitedCache

# THREAD BLOCKING BEHAVIOR
#
# When a request is made for a stale cache entry, it is possible that another thread is already
# in the process of rebuilding that entry. This setting specifies how OSCache handles the
# subsequent 'non-building' threads. The default behaviour (cache.blocking=false) is to serve
# the old content to subsequent threads until the cache entry has been updated. This provides
# the best performance (at the cost of serving slightly stale data). When blocking is enabled,
# threads will instead block until the new cache entry is ready to be served. Once the new entry
# is put in the cache the blocked threads will be restarted and given the new entry.
# Note that even if blocking is disabled, when there is no stale data available to be served
# threads will block until the data is added to the cache by the thread that is responsible
# for building the data.
#
#cache.blocking=true

# CACHE SIZE
#
# Default cache size in number of items. If a size is specified but not
# an algorithm, the cache algorithm used will be LRUCache.
#
cache.capacity=1000


# CACHE UNLIMITED DISK
# Use unlimited disk cache or not. The default value is false, which means
# the disk cache will be limited in size to the value specified by cache.capacity.
#
# cache.unlimited.disk=false


# JMS CLUSTER PROPERTIES
#
# Configuration properties for JMS clustering. See the clustering documentation
# for more information on these settings.
#
#cache.cluster.jms.topic.factory=java:comp/env/jms/TopicConnectionFactory
#cache.cluster.jms.topic.name=java:comp/env/jms/OSCacheTopic
#cache.cluster.jms.node.name=node1


# JAVAGROUPS CLUSTER PROPERTIES
#
# Configuration properites for the JavaGroups clustering. Only one of these
# should be specified. Default values (as shown below) will be used if niether
# property is set. See the clustering documentation and the JavaGroups project
# (www.javagroups.com) for more information on these settings.
#

#Jason Cheng Added
#The default value is 231.12.21.132, however you can use any class D IP address. 
#Class D address fall in the range 224.0.0.0 through 239.255.255.255

# If your cache is binding
# to 127.0.0.1 and not to a network ip. Your cache must be listening on a
# network ip to talk to other servers. You can test the clustered cache by
# running two portals on two machines. Do not attempt to run both portals on
# one machine because the multicast will not know to loopback.

cache.cluster.properties=UDP(mcast_addr=231.12.21.136;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)
#cache.cluster.multicast.ip=231.12.21.132



web.xml configuraion for the jsp cache:

	<!-- OSCache Configuration  -->
	<filter>
		<filter-name>CacheFilterStaticContent</filter-name>
		<filter-class>
			com.opensymphony.oscache.web.filter.CacheFilter
		</filter-class>
		<init-param>
			<param-name>expires</param-name>
			<param-value>time</param-value>
		</init-param>
	</filter>

	<!-- The mapping for the OSCache  -->
	<filter-mapping>
		<filter-name>CacheFilterStaticContent</filter-name>
		<url-pattern>*.jsp</url-pattern>
	</filter-mapping>
分享到:
评论

相关推荐

    jboss配置入门,jboss的初级配置

    * 配置日志文件:位于$JBOSS-HOME/server/default/conf下,用于配置日志的输出。 * 工作目录:位于$JBOSS-HOME/server/default/work下,用于存放JSP编译后的.java和.class文件。 负载均衡配置 负载均衡是一种常用的...

    JBoss篇:安装与配置

    四、JBoss 的配置 1. 日志文件设置:若需要修改 JBoss 默认的 log4j 设置,可修改 JBoss 安装目录下的 "server/default/conf" 文件夹中的 jboss-log4j.xml 文件。 2. web 服务的端口号的修改:这点在前文中有所提及...

    jboss热部署配置

    2. **配置部署目录**:默认情况下,JBoss会监控`deploy`目录下的文件变化。如果希望使用其他目录,可以在`jboss-service.xml`中更改`deploymentDir`属性值。 3. **禁用模块的TOMCAT类加载器**:某些模块可能使用了...

    MyEclipse中配置JBoss

    【标题】:“MyEclipse中配置JBoss” 在IT行业中,MyEclipse是一款深受开发者喜爱的集成开发环境(IDE),尤其对于Java EE项目开发来说,它提供了强大的支持。而JBoss则是一个开源的应用服务器,广泛用于部署和管理...

    windows jboss cluster

    windows jboss cluster,网络上收集的一些配置信息,共同参考!

    jboss服务器的详细配置

    JBoss连接数据库的配置通常位于`{jboss_home}\server\default\deploy`目录下的特定服务文件,如`mssql-service.xml`。要更改数据库连接,需要修改以下几个属性: 1. `ConnectionURL`:指定数据库服务器地址、端口和...

    在JBoss下配置EJB

    【在JBoss下配置EJB】 企业级JavaBean(Enterprise JavaBeans,简称EJB)是Java平台上的一个核心组件,用于构建可扩展、安全且事务处理能力强大的分布式应用程序。EJB标准经历了多个版本的发展,从早期的EJB 2.0到...

    Jboss配置虚拟路径

    1. **定位配置文件**:首先,需要找到位于`D:\jboss-4.2.2.GA\server\default\deploy\jboss-web.deployer`目录下的`server.xml`文件。此文件包含了JBoss服务器的主要配置信息。 2. **添加`&lt;Context&gt;`元素**:在`...

    JBOSS负载均衡配置

    - `%JBoss_Home%\server\all\deploy`和`%JBoss_Home%\server\default\deploy`目录下的`deploy.last`、`jboss-web-cluster.sar`、`cluster-service.xml`和`ejb3-clustered-sfsbcache-service.xml`。 5. **配置集群...

    linux 下 配置JBoss6.0+JDK7.0

    在Linux环境下配置JBoss6.0与JDK7.0是一项关键的任务,因为这两个组件是许多企业级Java应用的基础。JBoss是一个流行的开源应用服务器,它支持Java EE规范,而JDK则是运行Java应用程序和应用服务器所必需的开发工具包...

    JBoss 下配置 Oracle 数据源

    JBoss 下配置 Oracle 数据源 在 JBoss 中配置 Oracle 数据源是实现企业级应用程序的重要步骤。本文将详细介绍如何在 JBoss 中配置 Oracle 数据源,包括复制配置文件、编辑配置文件、设置数据源参数等步骤。 一、...

    JBOSS log4j 配置

    1. 配置 $JBOSS-HOME/server/default/deploy/jbossweb-tomcat55.sar/META-INF/jboss-service.xml 文件里的 Java2ClassLoadingCompliance 及 UseJBossWebLoader 为 false,如果应用程序下存在 WEB-INF/jboss-web.xml...

    Jboss安装配置手册

    Jboss 安装配置指南 本指南旨在指导用户安装和配置 Jboss 中间件,包括数据库产品的安装、初始化数据库、Jboss 中间件的安装和配置服务。以下是详细的安装和配置步骤: 一、数据库产品的安装 在安装 Jboss 之前,...

    jboss快速配置,简单配置使用

    该文件位于`{jboss_home}\server\default\deploy`目录下,用于配置Microsoft SQL Server数据库连接。 2. **修改数据库连接参数** 修改`&lt;config-property&gt;`标签内的属性值以匹配实际的数据库环境,例如: - `...

    JBoss在MyEclipse中的配置及说明

    - **Server Configuration**:这里可以配置JBoss的特定配置文件,如`standalone.xml`或`domain.xml`,以及相关的JVM参数。 - **Classpath**:定义服务器启动时的类路径,通常包括应用程序的库和依赖。 通过以上...

    jboss7ejb配置文件

    在没有提供具体的`ejb-jar.xml`和`jboss-ejb3.xml`内容的情况下,我们无法深入分析每个文件的详细配置,但以上已概述了它们在EJB部署中的基本作用和常用配置选项。如果你需要对特定配置进行深入理解,建议查阅官方...

    jboss 集群配置

    1. **修改JBOSS_HOME/server/all/deploy/jbossweb-tomcat55.sar/server.xml**:配置负载均衡器,如mod_jk或mod_cluster模块。 2. **配置jboss-service.xml**:添加集群相关的MBean,如ha-policy、jgroups配置等。 3....

Global site tag (gtag.js) - Google Analytics