本站首页    管理页面    写新日志    退出


«August 2025»
12
3456789
10111213141516
17181920212223
24252627282930
31


公告
 本博客在此声明所有文章均为转摘,只做资料收集使用。

我的分类(专题)

日志更新

最新评论

留言板

链接

Blog信息
blog名称:
日志总数:1304
评论数量:2242
留言数量:5
访问次数:7591681
建立时间:2006年5月29日




[JBoss]配置JBossCache集群(转载)
软件技术

lhwork 发表于 2006/12/26 16:36:56

为了使用Hiberante的二级缓存支持集群,可以选择OSCache和JBossCache等,这里我们选择了JBossCache.JBossCache可以在这里找到http://www.jboss.org/developers/projects/jboss/cache/。1.Hibernate的配置(1)在hibernate.cfg.xml中加入下在面的语句,如果有使用了其它的cache请注掉<property name="hibernate.cache.provider_class">net.sf.hibernate.cache.TreeCacheProvider</property>(2)在hibernate的映射文件中,在需要缓存的类定义中加入类似下面的语句<cache usage="nonstrict-read-write"/>,应该改为<cache usage="read-only | transactional"/>usage这个属性根据需要可以改为对应的值(另注:以前这里主要的错误是使用了nonstrict-read-write,而根据HIBERNATE的文档,只能用read-only或taransactional,我记得当时我用了read-wirte,可奇怪得是没有发生问题,郁闷,哪位高人知道请通知我一下)至此,Hibernate的配置做完2.JBossCache的配置首先需要建一个名为treecache.xml的文件,对于web应用,放在WEB-INF下面就行,内容类似下面的内容代码内容<?xml version="1.0" encoding="UTF-8"?> <server> <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache"> <attribute name="IsolationLevel">REPEATABLE_READ</attribute> <!--如果需要集群应该使用REPL_ASYNC或REPL_SYNC,前者是异步复制,而后者是同步复制--> <attribute name="CacheMode">REPL_SYNC</attribute> <attributename="ClusterName">clumsterName</attribute> <attribute name="ClusterConfig"> <config> <!--在这里配置Jgroup的相关属性,特别要注意的是mcast_addr,这是一个多播地址,这里使用224.0.0.1,是网络中所有支持多播的地址(今天又试了一下,发现可以直接指定有效的多播地址,系统会自动注册这个地址) bind_addr是本机的IP--> <UDP mcast_addr="224.0.0.1" mcast_port="45566" ip_ttl="64" ip_mcast="true" mcast_send_buf_size="150000" cast_recv_buf_size="80000" ucast_send_buf_size="150000" ucast_recv_buf_size="80000" loopback="false" bind_addr="192.168.0.2"/> <PING timeout="2000" num_initial_members="3" up_thread="false" down_thread="false"/> <MERGE2 min_interval="10000" max_interval="20000"/> <FD shun="true" up_thread="true" down_thread="true"/> <VERIFY_SUSPECT timeout="1500"  up_thread="false" down_thread="false"/> <pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800" up_thread="false" down_thread="false"/> <pbcast.STABLE desired_avg_gossip="20000" up_thread="false" down_thread="false"/> <UNICAST timeout="600,1200,2400" window_size="100" min_threshold="10" down_thread="false"/> <FRAG frag_size="8192" down_thread="false" up_thread="false"/> <pbcast.GMS join_timeout="5000" join_retry_timeout="2000" shun="true" print_local_addr="true"/> <pbcast.STATE_TRANSFER up_thread="false" down_thread="false"/> </config> </attribute> <attribute name="MaxCapacity">20000</attribute> <attribute name="InitialStateRetrievalTimeout">20000</attribute>  <attribute name="SyncReplTimeout">10000</attribute> <attribute name="LockAcquisitionTimeout">15000</attribute> <attribute name="LockLeaseTimeout">60000</attribute> <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>  <attribute name="EvictionPolicyConfig"> <config> <attribute name="wakeUpIntervalSeconds">15</attribute>  <region name="/_default_"> <attribute name="maxNodes">5000</attribute>  <attribute name="timeToIdleSeconds">1000</attribute>  </region> </config> </attribute> </mbean> </server>


阅读全文(7334) | 回复(1) | 编辑 | 精华
 


Queen's Day
软件技术

mulberry handbags(游客)发表评论于2010/4/3 19:46:57

"There's always a party in Amsterdam" "The Biggest Party Ever"Is Queen's Day and it's on the 30th of April. Queen's Day, or"Koninginnedag" started as Queen Juliann's Birthday in 1949 and itestablished itself as the most celebrated holiday in Holland. It is amust experience of street party, tourists , backpackers and carnivallovers.When it's Dutch, it's fun! the best day to visit the canaledcityAmsterdam has always been know for its vibrant life style and funloving people. As they say, "There's always a party in Amsterdam".Queen's Day is no exception. Actually, in my opinion, it is the bestday to visit the Canaled city. The party starts on the night beforewith many squares filled with people celebrating the holiday andpreparing for the following day.On Queen's day, the most noticable change in the city is the canalsfilled with various and numerous boats. These boats are mostly filledwith locals that are wearing the national orange color and cruise thewhole City while playing there own music as loud as they can andcheering everybody in the streets. If you are lucky, you might even beinvited on one, just for wearing orange!At every corner of the city ,in apartments , hotels and houseboatsthere is another smaller or bigger party taking its own direction. Itis truly grand. Just imagine, almost every apartment, houseboat,square, restaurant or bar has its family, friends and customerscelebrating. In addition, the Dutch don't spare any expense when itcomes to having a good time on Qu...


个人主页 | 引用回复 | 主人回复 | 返回 | 编辑 | 删除
 


» 1 »

发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.063 second(s), page refreshed 144752729 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号