2012-11-09 8 views
6

jgroupsSlaveノードのLuceneインデックスへのすべての書き込みがjgroupsMasterノードに送信されるようにHibernate Searchを使用しようとしていて、LuceneインデックスがInfinispanと奴隷。すべてがローカルで動作しますが、ノードがEC2上で互いを発見している間は、通信していないように見えます。EC2上のJGroupsノードがお互いを見ても会話していない

彼らはお互いにメッセージを送信しています。

# master output sample 
86522 [LockBreakingService,localCache,archlinux-37498] DEBUG org.infinispan.transaction.TransactionTable - About to cleanup completed transaction. Initial size is 0 
86523 [LockBreakingService,LuceneIndexesLocking,archlinux-37498] DEBUG org.infinispan.transaction.TransactionTable - About to cleanup completed transaction. Initial size is 0 
87449 [Timer-4,luceneCluster,archlinux-37498] DEBUG org.jgroups.protocols.FD - sending are-you-alive msg to archlinux-57950 (own address=archlinux-37498) 
87522 [LockBreakingService,localCache,archlinux-37498] DEBUG org.infinispan.transaction.TransactionTable - About to cleanup completed transaction. Initial size is 0 
87523 [LockBreakingService,LuceneIndexesLocking,archlinux-37498] DEBUG org.infinispan.transaction.TransactionTable - About to cleanup completed transaction. Initial size is 0 

# slave output sample 
85499 [LockBreakingService,localCache,archlinux-57950] DEBUG org.infinispan.transaction.TransactionTable - About to cleanup completed transaction. Initial size is 0 
85503 [LockBreakingService,LuceneIndexesLocking,archlinux-57950] DEBUG org.infinispan.transaction.TransactionTable - About to cleanup completed transaction. Initial size is 0 
86190 [Timer-3,luceneCluster,archlinux-57950] DEBUG org.jgroups.protocols.FD - sending are-you-alive msg to archlinux-37498 (own address=archlinux-57950) 
86499 [LockBreakingService,localCache,archlinux-57950] DEBUG org.infinispan.transaction.TransactionTable - About to cleanup completed transaction. Initial size is 0 
86503 [LockBreakingService,LuceneIndexesLocking,archlinux-57950] DEBUG org.infinispan.transaction.TransactionTable - About to cleanup completed transaction. Initial size is 0 

セキュリティグループ

私は自分のEC2インスタンス上で実行していますことを、2瓶、マスターのための1、およびスレーブのための1つを持っています。私は各インスタンスを別のインスタンスにpingすることができ、それらは両方とも同じセキュリティグループに属しています。これは、グループ内のすべてのマシン間の通信に以下のルールを定義しています。

UDP

のためのTCP 0-65535ためのICMP 0-65535のすべてのポートは、だから私はそれがセキュリティグループの設定の問題ではないと思います。

hibernate.properties

# there is also a corresponding jgroupsSlave 
hibernate.search.default.worker.backend=jgroupsMaster 
hibernate.search.default.directory_provider = infinispan 
hibernate.search.infinispan.configuration_resourcename=infinispan.xml 
hibernate.search.default.data_cachename=localCache 
hibernate.search.default.metadata_cachename=localCache 

infinispan.xml

<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd" 
      xmlns="urn:infinispan:config:5.1"> 
    <global> 
     <transport clusterName="luceneCluster" transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport"> 
      <properties> 
       <property name="configurationFile" value="jgroups-ec2.xml" /> 
      </properties> 
     </transport> 
    </global> 

    <default> 
     <invocationBatching enabled="true" /> 
     <clustering mode="repl"> 

     </clustering> 
    </default> 

    <!-- this is just so that each machine doesn't have to store the index 
     in memory --> 
    <namedCache name="localCache"> 
     <loaders passivation="false" preload="true" shared="false"> 
      <loader class="org.infinispan.loaders.file.FileCacheStore" fetchPersistentState="true" ignoreModifications="false" purgeOnStartup="false"> 
       <properties> 
        <property name="location" value="/tmp/infinspan/master" /> 
        <!-- there is a corresponding /tmp/infinispan/slave in 
        the slave config --> 
       </properties> 
      </loader> 
     </loaders> 
    </namedCache> 
</infinispan> 

JGroupsの-ec2.xml

<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-3.2.xsd"> 
    <TCP 
      bind_addr="${jgroups.tcp.address:127.0.0.1}" 
      bind_port="${jgroups.tcp.port:7800}" 
      loopback="true" 
      port_range="30" 
      recv_buf_size="20000000" 
      send_buf_size="640000" 
      max_bundle_size="64000" 
      max_bundle_timeout="30" 
      enable_bundling="true" 
      use_send_queues="true" 
      sock_conn_timeout="300" 
      enable_diagnostics="false" 

      bundler_type="old" 

      thread_pool.enabled="true" 
      thread_pool.min_threads="2" 
      thread_pool.max_threads="30" 
      thread_pool.keep_alive_time="60000" 
      thread_pool.queue_enabled="false" 
      thread_pool.queue_max_size="100" 
      thread_pool.rejection_policy="Discard" 

      oob_thread_pool.enabled="true" 
      oob_thread_pool.min_threads="2" 
      oob_thread_pool.max_threads="30" 
      oob_thread_pool.keep_alive_time="60000" 
      oob_thread_pool.queue_enabled="false" 
      oob_thread_pool.queue_max_size="100" 
      oob_thread_pool.rejection_policy="Discard" 
      /> 
    <S3_PING secret_access_key="removed_for_stackoverflow" access_key="removed_for_stackoverflow" location="jgroups_ping" /> 

    <MERGE2 max_interval="30000" 
      min_interval="10000"/> 
    <FD_SOCK/> 
    <FD timeout="3000" max_tries="3"/> 
    <VERIFY_SUSPECT timeout="1500"/> 
    <pbcast.NAKACK2 
      use_mcast_xmit="false" 
      xmit_interval="1000" 
      xmit_table_num_rows="100" 
      xmit_table_msgs_per_row="10000" 
      xmit_table_max_compaction_time="10000" 
      max_msg_batch_size="100" 
      become_server_queue_size="0"/> 
    <UNICAST2 
      max_bytes="20M" 
      xmit_table_num_rows="20" 
      xmit_table_msgs_per_row="10000" 
      xmit_table_max_compaction_time="10000" 
      max_msg_batch_size="100"/> 
    <RSVP /> 
    <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000" 
        max_bytes="400000"/> 
    <pbcast.GMS print_local_addr="false" join_timeout="7000" view_bundling="true"/> 
    <UFC max_credits="2000000" min_threshold="0.10"/> 
    <MFC max_credits="2000000" min_threshold="0.10"/> 
    <FRAG2 frag_size="60000"/> 
</config> 

私はこれを最新のinfinispan-coreディストリビューション(5.2.0.Beta3から直接コピーしましたが、5.1.4と思っていました)。私が変更したのはs3_pingを私のものに置き換えただけですが、やはりノードがs3に書き込まれているのを見て、彼らはお互いを見つけて、それが問題だとは思わないのです。私は自分のプライベートIPアドレスに設定されたjgroups.tcp.addressの環境変数でマスター/スレーブを開始しています。私もいくつかのconfigsを大幅に単純化して成功しなかった。

どのような問題が発生する可能性がありますか?私は数日間それを遊んで過ごしました、そして、それは私を夢中にしています。私はそれがローカルで動作し、ちょうどEC2で話すことができないので、それがjgroups設定で何かでなければならないと思う。

これを理解するのに役立つ情報がありますか?

答えて

6

開始する2つのJGroupsチャネルがあるため、Infinispan用とバックエンドワーカー通信用の2つのJGroups構成を指定します。

Infinispanとjgroupsマスターは、指定しない限りデフォルトの設定を使用しますが、デフォルトではEC2で動作しないマルチキャストが使用されます。

Infinispanインデックスを正しく設定しているようですが、S3_PINGまたはJDBC_PINGも使用するには、jgroupsマスターワーカーを再設定する必要があります。既定の構成ではマルチキャストを使用してピアを自動検出できるため、ローカルで作業している可能性があります。

この複製はHSEARCH-882で解決されますので、構成を大幅に簡素化することを楽しみにしています。

+1

インターネットであなたとキスすることができたら、私はそうです。私のhibernate.propertiesファイルに "hibernate.search.services.jgroups.configurationFile = jgroups-ec2.xml"を入れるのは簡単でした。私の出力に基づいて動作しましたが、以前の実行では存在しなかったS3上に2つ目のフォルダが作成されたため、動作しているとも言えます。再度、感謝します! – dustincg

+0

私はそれを聞いて非常にうれしいです! – Sanne

関連する問題