cloud‎ > ‎

JGroups MPING vs TCPPING in TCP

posted Jun 20, 2010, 7:39 PM by Kuwon Kang
JGroups TCP사용시 Clustering 방식을 2가지 제공합니다. 예를 들어 하나의 Machine에서 서로 다른 도메인 영역에 각각 2개씩 JGroups Channel을 사용한다면 이를 각각 2개의 단위로 Clustering해야 합니다. 이를 가능하게 하기 위해서는 MPING을 사용합니다. MPING을 Multicast를 통해 처리되기 때문에 OSI Layer중 MulticastSocket 을 통한 처리가 가능하므로 2개의 서로 다른 Clustering구조를 지원하게 됩니다. 17.1.2.4. MPING The MPING protocol is a multicast ping over TCP. It works almost the same way as PING works on UDP. It does not require external processes (GossipRouter) or static configuration (initial host list). Here is an example of the MPING configuration element in the JGroups Config element.
<MPING timeout="2000"
    bind_to_all_interfaces="true"
    mcast_addr="228.8.8.8"
    mcast_port="7500"
    ip_ttl="8"
    num_initial_members="3"/>
The available attributes in the MPING element are listed below.
  • timeout specifies the maximum number of milliseconds to wait for any responses.
  • num_initial_members specifies the maximum number of responses to wait for.
  • bind_addr specifies the interface on which to send and receive multicast packets.
  • bind_to_all_interfaces overrides the bind_addr and uses all interfaces in multihome nodes.
mcast_addr, mcast_port, ip_ttl attributes are the same as related attributes in the UDP protocol configuration. 17.1.2.3. TCPPING The TCPPING protocol takes a set of known members and ping them for discovery. This is essentially a static configuration. It works on top of TCP. Here is an example of the TCPPING configuration element in the JGroups Config element.
<TCPPING timeout="2000"
    initial_hosts="192.168.5.1[7800],192.168.0.2[7800]"
    port_range="2"
    num_initial_members="3"/>
The available attributes in the TCPPING element are listed below.
timeout specifies the maximum number of milliseconds to wait for any responses. num_initial_members specifies the maximum number of responses to wait for. initial_hosts is a comma-seperated list of addresses (e.g., host1[12345],host2[23456]) for pinging. port_range specifies the range of ports to ping on each host in the initial_hosts list. That is because multiple nodes can run on the same host. In the above example, the cluster would ping ports 7800, 7801, and 7802 on both hosts.
Comments