2012-11-09 35 views
6

我正在嘗試使用Hibernate Search,以便將所有從jgroupsSlave節點寫入Lucene索引的節點發送到jgroupsMaster節點,然後將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實例上運行。我可以從其他實例ping每個實例,它們都在同一個安全組中,它定義了組中的任何計算機之間的通信的以下規則。

爲ICMP 65535的所有端口的TCP 0-65535的UDP

因此,我不認爲這是一個安全組的配置問題。

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核心發行版(5.2.0.Beta3,但我也嘗試過5.1.4,我認爲它)複製這個。我改變的唯一東西是用我的s3_ping替換掉了,但是我又看到了寫入s3的節點,並且他們找到了對方,所以我不認爲這是問題所在。我還開始使用他們的環境變量的主/從,將jgroups.tcp.address設置爲他們的私有IP地址。我也嘗試了一些非常簡單但沒有任何成功的配置。

任何想法可能是什麼問題?我花了幾天時間玩它,這讓我瘋狂。我認爲它必須是與jgroups配置的東西,因爲它在本地工作,並且只是不能在EC2上交談。

任何其他信息,你們想幫助解決這個問題嗎?

回答

6

您有兩個JGroups通道正在啓動,因此需要指定兩個JGroups配置:一個用於Infinispan,一個用於後端工作人員通信。

無論是Infinispan還是jgroupsMaster都將使用它們的默認配置設置,除非您指定了一個,但默認情況下使用的多點傳送不適用於EC2。

看起來你有一個正確的Infinispan索引配置設置,但你必須重新配置jgroupsMaster worker以使用S3_PING或JDBC_PING;它可能會在本地爲您工作,因爲默認配置能夠使用多播自動發現對等點。

這種重複將由HSEARCH-882解決,我很期待它顯著簡化配置。

+1

如果可以通過互聯網親你,我會的。這是因爲把「hibernate.search.services.jgroups.configurationFile = JGroups的-ec2.xml」到我的hibernate.properties文件一樣簡單。它的工作基於我的輸出,但我也可以告訴它是有效的,因爲在S3上創建了第二個文件夾,這在以前的運行中並不存在。再次感謝! – dustincg

+0

我很高興聽到! – Sanne

相關問題