- 2
- 0
- 约1.68万字
- 约 61页
- 2018-12-24 发布于广西
- 举报
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 5-2:Jgroups集群模式 引入JGroups JGroups是一个可靠的组间通讯工具,进程可以加入一个通讯组,给组内所有的成员或单独的成员发送消息,同样,也可以从组中的成员处接收消息。 系统会记录组的每一个成员,在新成员加入或是现有的成员离开或是崩溃时,会通知组内的其他成员。 当我们更新集群中一个节点上的cache的时候,利用JGroups进行广播,其他的节点接收到广播,根据接收到的信息来更新自己的cache,这样达到了每个节点的cache同步。 5-3:单播方式 使用单播方式需要指定其它节点的主机地址和端口 cacheManagerPeerProviderFactory class=net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory properties=connect=TCP(start_port=7800): TCPPING(initial_hosts=host1[7800],host2[7800]; port_range=10;timeout=3000; num_initial_members=3;up_thread=true;down_thread=true): VERIFY_SUSPECT(timeout=1500;down_thread=false;up_thread=false): pbcast.NAKACK(down_thread=true;up_thread=true;gc_lag=100; retransmit_timeout=3000): pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false; print_local_addr=false;down_thread=true;up_thread=true) propertySeparator=:: / 5-4:多播方式 cacheManagerPeerProviderFactory class=net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory” properties=connect=UDP(mcast_addr=32;mcast_port=45567;ip_ttl=32; mcast_send_buf_size=150000;mcast_recv_buf_size=80000): PING(timeout=2000;num_initial_members=6): MERGE2(min_interval=5000;max_interval=10000): FD_SOCK:VERIFY_SUSPECT(timeout=1500): pbcast.NAKACK(gc_lag=10;retransmit_timeout=3000):UNICAST(timeout=5000):pbcast.STABLE(desired_avg_gossip=20000):FRAG: pbcast.GMS(join_timeout=5000;join_retry_timeout=2000; shun=false;print_local_addr=true) propertySeparator=:: / 使用多播方式配置如下: 5-5:命名缓存的配置 JGroups 方式对应命名缓存的配置信息如下:需要指定cacheEventListenerFactory cache name=“” maxElementsInMemory=“500 “ //基于内存的缓存可存放对象的最大数目 eternal=”false“ //缓存中对象是否为永久的,如果是,超时设置将被忽略,对象从不过期 timeToIdleSeconds=”120“ //允许对象处于空闲状态的最长时间(单位秒) timeToLiveSeconds=”120“ //对象允许在缓存中的最长时间(单位秒) overflowToDisk=true“ //内存不足时,是否启用磁盘缓存 cacheEventListenerFactory class=net.sf.ehca
您可能关注的文档
最近下载
- 离合器操纵机构设计-毕业论文(设计).docx VIP
- Unit 2 Travelling around the world 单词讲练 沪教版(2024)七年级英语下册.docx VIP
- 穿脱防护用品流程图.pdf VIP
- 变电站绝缘在线监测系统的研究.doc VIP
- 罗浩-肩关节镜下打结及缝线管理_肩关节培训班.pptx VIP
- (高清版)B/T 15831-2023 钢管脚手架扣件.pdf VIP
- 06MS201全集1-9 市政排水管道工程及附属设施.pdf VIP
- 病案信息技术(中级)考试试题题库8辑 .pdf VIP
- 工业水处理技术的应用.doc VIP
- 广东省2025年初中学业水平考试地理真题(含答案).pdf VIP
原创力文档

文档评论(0)