`
ginge
  • 浏览: 208374 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

JGroup配置笔记

阅读更多

JGroup TCP比较关键的配置参数

 

TCP

TCP(bind_addr=192.168.30.66;start_port=7800;end_port=7081)

 

start_port="7800"

本节点监听的端口,默认为7800,如设置为0,将会随机选定一个端口绑定

end_port

尝试监听的最大端口,如果在start_portend_port指定的范围内都找不到一个可用端口,则抛出一个BindException。如果不指定end_port,或者end_port<start_portend_port将没有上限,如果start_port=end_portJGroup将会只用该端口来绑定。

bind_addr="192.168.1.3"

JGroup监听的物理IP,如不指定,JGroup将会绑定到所有可用网络接口。当有多个网络接口时应该指定一个

TCPPING

TCPPING(initial_hosts=hosta[2300],hostb[3400],hostc[4500];             port_range=3;num_initial_members=2;timeout=3000)

   

 

initial_hosts="hosta[2300],hostb[3400],hostc[4500]"

初始成员列表,所有成员都应该列出来,否则在特定条件下会形成封闭节点。

port_range="3"

查找初始成员的端口范围,结合上述的initial_hosts配置,当前节点将查找的成员有hosta:2300, hosta:2301, hosta:2302, hostb:3400, hostb:3401, hostb:3402, hostc:4500, hostc:4501, hostc:4502.

num_initial_members="2"

等待最多初始成员回应的数量,但是不得超过timeout定义的毫秒时间。默认值为2

 

 

配置例子:

1) 假设有两个JGroup应用都在 192.168.30.66

TCP(bind_addr=192.168.30.66;start_port=7800;end_port=7081;loopback=true;recv_buf_size=20000000;send_buf_size=640000;discard_incompatible_packets=true;max_bundle_size=64000;max_bundle_timeout=30;use_incoming_packet_handler=true;enable_bundling=true;use_send_queues=false;sock_conn_timeout=300;skip_suspected_members=true;use_concurrent_stack=true;thread_pool.enabled=true;thread_pool.min_threads=1;thread_pool.max_threads=25;thread_pool.keep_alive_time=5000;thread_pool.queue_enabled=false;thread_pool.queue_max_size=100;thread_pool.rejection_policy=run;oob_thread_pool.enabled=true;oob_thread_pool.min_threads=1;oob_thread_pool.max_threads=8;oob_thread_pool.keep_alive_time=5000;oob_thread_pool.queue_enabled=false;oob_thread_pool.queue_max_size=100;oob_thread_pool.rejection_policy=run):TCPPING(timeout=3000;initial_hosts=192.168.30.66[7800];port_range=2;num_initial_members=2):MERGE2(max_interval=100000;min_interval=20000):FD_SOCK:FD(timeout=10000;max_tries=5;shun=true):VERIFY_SUSPECT(timeout=1500):BARRIER:pbcast.NAKACK(use_mcast_xmit=false;gc_lag=0;retransmit_timeout=300,600,1200,2400,4800;discard_delivered_msgs=true):pbcast.STABLE(stability_delay=1000;desired_avg_gossip=50000;max_bytes=400000):VIEW_SYNC(avg_send_interval=60000):pbcast.GMS(print_local_addr=true;join_timeout=3000;shun=true;view_bundling=true):FC(max_credits=2000000;min_threshold=0.10):FRAG2(frag_size=60000):pbcast.STREAMING_STATE_TRANSFER

 

 

 

2) 假设有后台应用和前端应用各两个, 后台应用在192.168.30.66192.168.30.76; 前端应用在on 192.168.30.69192.168.30.79

 

后台应用和前端应用都可以使用同一配置

 

TCP(start_port=7800;end_port=7800;loopback=true;recv_buf_size=20000000;send_buf_size=640000;discard_incompatible_packets=true;max_bundle_size=64000;max_bundle_timeout=30;use_incoming_packet_handler=true;enable_bundling=true;use_send_queues=false;sock_conn_timeout=300;skip_suspected_members=true;use_concurrent_stack=true;thread_pool.enabled=true;thread_pool.min_threads=1;thread_pool.max_threads=25;thread_pool.keep_alive_time=5000;thread_pool.queue_enabled=false;thread_pool.queue_max_size=100;thread_pool.rejection_policy=run;oob_thread_pool.enabled=true;oob_thread_pool.min_threads=1;oob_thread_pool.max_threads=8;oob_thread_pool.keep_alive_time=5000;oob_thread_pool.queue_enabled=false;oob_thread_pool.queue_max_size=100;oob_thread_pool.rejection_policy=run):TCPPING(timeout=3000;initial_hosts=192.168.30.66[7800],192.168.30.76[7800],192.168.30.69[7800],192.168.30.79[7800];port_range=1;num_initial_members=4):MERGE2(max_interval=100000;min_interval=20000):FD_SOCK:FD(timeout=10000;max_tries=5;shun=true):VERIFY_SUSPECT(timeout=1500):BARRIER:pbcast.NAKACK(use_mcast_xmit=false;gc_lag=0;retransmit_timeout=300,600,1200,2400,4800;discard_delivered_msgs=true):pbcast.STABLE(stability_delay=1000;desired_avg_gossip=50000;max_bytes=400000):VIEW_SYNC(avg_send_interval=60000):pbcast.GMS(print_local_addr=true;join_timeout=3000;shun=true;view_bundling=true):FC(max_credits=2000000;min_threshold=0.10):FRAG2(frag_size=60000):pbcast.STREAMING_STATE_TRANSFER

  

 

 

JGroup UDP比较关键的配置参数

主要配置参数

参数

描述

mcast_addr

多播地址

mcast_port

多播端口

 

配置例子:

对于TCP的两个例子都可以用以下配置

 

UDP(mcast_addr=224.0.0.161;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):UNICAST(timeout=5000):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=true;print_local_addr=true;reject_join_from_existing_member=false):FD(timeout=2000;max_tries=5;shun=true)

 

 

 

 

 

注意事项

l  LAN或者多个子网内建议使用TCP方式,因为不同子网中,UDP多播消息可能会给路由器丢弃

l  FDFD_SOCK同时有时会出现SocketCloesedException,这时要注意重启时间不宜过短

l  出现GMS Join Retry循环时也要注意重启时间不宜过短

 

 

官方文档

http://www.jboss.org/community/docs/DOC-10878

5
0
分享到:
评论
1 楼 yaoweinan 2012-09-06  
不错

相关推荐

Global site tag (gtag.js) - Google Analytics