【问题标题】:JGroups configuration for internet互联网的 JGroups 配置
【发布时间】:2017-03-10 14:26:53
【问题描述】:

我已经成功地让 JGroups 通过使用 TCP 的不同机器在本地网络上工作,我不能使用多播。我需要两个节点通过互联网进行通信的能力。将地址更改为公共地址似乎不起作用,需要额外的配置。 我看过http://www.jgroups.org/manual-3.x/html/protlist.html 并设置 external_addr 但可能还有更多设置。

如何将其设置为通过公共地址进行通信?

配置:

<config xmlns="urn:org:jgroups"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/jgroups-4.0.xsd">

<TCP bind_port="7800"
     recv_buf_size="${tcp.recv_buf_size:130k}"
     send_buf_size="${tcp.send_buf_size:130k}"
     max_bundle_size="64K"
     sock_conn_timeout="300"
client_bind_addr="GLOBAL"
     thread_pool.min_threads="0"
     thread_pool.max_threads="20"
     thread_pool.keep_alive_time="30000"/>

<TCPPING async_discovery="true"
         initial_hosts="${jgroups.tcpping.initial_hosts:52.211.80.63[7801]}"
         port_range="2"/>
<MERGE3  min_interval="10000"
         max_interval="30000"/>
<FD_SOCK/>
<FD timeout="3000" max_tries="3" />
<VERIFY_SUSPECT timeout="1500"  />
<BARRIER />
<pbcast.NAKACK2 use_mcast_xmit="false"
               discard_delivered_msgs="true"/>
<UNICAST3 />
<pbcast.STABLE desired_avg_gossip="50000"
               max_bytes="4M"/>
<pbcast.GMS print_local_addr="true" join_timeout="2000"
            view_bundling="true"/>
<MFC max_credits="2M"
     min_threshold="0.4"/>
<FRAG2 frag_size="60K"  />
<!--RSVP resend_interval="2000" timeout="10000"/-->
<pbcast.STATE_TRANSFER/>

</config>

【问题讨论】:

    标签: cluster-computing jgroups


    【解决方案1】:

    不,您不需要external_addr,除非您在 NAT 后面。你需要做的是:

    • 设置TCP.bind_addr(我建议删除TCP.client_bind_addr),例如到公共 IP 地址之一 (50.x.x.x)
    • TCPPING.initial_hosts 需要拥有所有(或大多数)成员的地址

    您当前的配置不起作用,因为 (1) bind_addr 未定义并且 (2) initial_hosts 在端口 7801 列出了一个成员,但 TCP.bind_port7800

    【讨论】:

    • 我在 NAT 后面,我在 AWS (NAT) 中有一个节点,在我的测试设置中有一个外部(非 NAT)节点。和你建议的有很大不同吗?谢谢。
    • 是的,对于 NAT 后面的节点,将 bind_addr 设置为内部 IP 地址,将 external_addr 设置为公共 IP 地址。在TCPPING.initial_hosts中,包含被nat节点的公共地址和其他节点的公共地址。
    猜你喜欢
    • 2015-05-25
    • 1970-01-01
    • 1970-01-01
    • 2021-05-08
    • 1970-01-01
    • 1970-01-01
    • 2015-05-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多