2017-08-22 3 views
0
I am using jgroups with the default udp.xml to connect ApplicationA to Matlab. My problem is I run Matlab/ApplicationA on multiple machines as follows: 
HOST1: running Matlab and running ApplicationA 
HOST2: running Matlab and running ApplicationA 

Because of the multicast HOST1 Matlab/AppA establishes connections with HOST2 Matlab/AppA. I want to limit Matlab and AppA to only establishing connections on the host it is running, this sounds do able with the udp.xml but I cannot get it right. 

誰かがマルチキャストを使用しないようにudp.xml設定を表示して、実行中のホストでのみ接続を確立できますか?注記:実行ごとにudp.xmlを変更できますが、一般的なもので特定のホスト名を持つudp.xmlを変更することなく任意のホストで作業することをお勧めします。jgroups udp.xml例なしmcast

<!-- 
    Default stack using IP multicasting. It is similar to the "udp" 
    stack in stacks.xml, but doesn't use streaming state transfer and flushing 
    author: Bela Ban 
--> 

<config xmlns="urn:org:jgroups"`enter code here` 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="urn:org:jgroupshttp://www.jgroups.org/schema/jgroups.xsd"> 
    <UDP 
     mcast_port="${jgroups.udp.mcast_port:45588}" 
     ip_mcast="false" 
     ip_ttl="0" 
     tos="8" 
     ucast_recv_buf_size="5M" 
     ucast_send_buf_size="5M" 
     mcast_recv_buf_size="5M" 
     mcast_send_buf_size="5M" 
     max_bundle_size="64K" 
     enable_diagnostics="true" 
     thread_naming_pattern="cl" 

     thread_pool.min_threads="0" 
     thread_pool.max_threads="20" 
     thread_pool.keep_alive_time="30000"/> 

    <PING /> 
    <MERGE3 max_interval="30000" 
      min_interval="10000"/> 
    <FD_SOCK/> 
    <FD_ALL/> 
    <VERIFY_SUSPECT timeout="1500" /> 
    <BARRIER /> 
    <pbcast.NAKACK2 xmit_interval="500" 
        xmit_table_num_rows="100" 
        xmit_table_msgs_per_row="2000" 
        xmit_table_max_compaction_time="30000" 
        use_mcast_xmit="false" 
        discard_delivered_msgs="true"/> 
    <UNICAST3 xmit_interval="500" 
       xmit_table_num_rows="100" 
       xmit_table_msgs_per_row="2000" 
       xmit_table_max_compaction_time="60000" 
       conn_expiry_timeout="0"/> 
    <pbcast.STABLE desired_avg_gossip="50000" 
        max_bytes="4M"/> 
    <pbcast.GMS print_local_addr="true" join_timeout="2000" 
       view_bundling="true"/> 
    <UFC max_credits="2M" 
     min_threshold="0.4"/> 
    <MFC max_credits="2M" 
     min_threshold="0.4"/> 
    <FRAG2 frag_size="60K" /> 
    <RSVP resend_interval="2000" timeout="10000"/> 
    <pbcast.STATE_TRANSFER /> 
    <!-- pbcast.FLUSH /--> 
</config> 

答えて

0

これを達成するための複数の方法があります:

  • はあなたのクラスターを分離するために、各展開のための異なる値にmcast_addrmcast_portを設定します。これは、システムのプロパティを使って行うことができます。 mcast_addr=${my-mcast-addr:232.1.1.1}を入力してから-Dmy-mcast-addr = x.x.x.xを使用します。デフォルトの設定よりも優先されます。
  • ip_ttlUDPに設定します。これにより、IPマルチキャストパケットがローカルボックスを離れないようになります。
  • ループバックインターフェイスにバインドします。 に設定して:bind_addr=loopback
+0

ありがとうございます。それぞれの弾丸は他の弾丸とは独立していますか? ip_mcastフラグを設定する必要はありますか? "ip_ttl"は最も単純な変更のように聞こえる。注:私はmcast addrの変更を試みましたが、私はその方法を試してみるとjgroupエラーが発生していました。私はbind_addrがどこに行く必要があるか分からなかった。ファイアウォールの設定を変更する必要がないようにこのファイルを変更することができれば、マルチキャストのためにファイアウォールの設定を変更する必要がありました。 – Jim

+0

はい、いずれかの箇条書き項目を選択します。いいえ、別の項目として 'ip_mcast'をfalseに設定できますが、' PING'を他の発見プロトコルに変更する必要があります。 'MPING'。ファイアウォールルールを変更しないために 'TCP'を使うことができますが、' TCPPING'や 'FILE_PING'などのディスカバリプロトコルを使うことができます。 –

関連する問題