2013-08-01 63 views
0

連接到兵馬俑Maven插件我有在POM以下Maven項目:不能用的Ehcache

<build> 
    <plugins> 
     <plugin> 
      <groupId>org.terracotta.maven.plugins</groupId> 
      <artifactId>tc-maven-plugin</artifactId> 
      <version>1.6.1</version> 

      <dependencies> 
       <dependency> 
        <groupId>org.terracotta</groupId> 
        <artifactId>terracotta-toolkit-1.3-runtime</artifactId> 
        <version>3.4.0</version> 
       </dependency> 
      </dependencies> 
     </plugin> 
     <plugin> 
    </plugins> 
</build> 

當我試着開始赤土比如,它似乎開始了罰款,我可以看到開發人員控制檯中的羣集。即使用:

mvn tc:start 

然後我運行我的應用程序,它有一個ehcache配置。兵馬俑URL設置(屬性得到正確替換):

<terracottaConfig url="${org.quartz.terracotta.tcConfigUrl}"/> 

但在控制檯上我得到如下:

2013-08-01 12:47:40,781 INFO net.sf.ehcache.terracotta.TerracottaClient  : Thread [main] [cacheManager: no name]: Creating new ClusteredInstanceFactory 
2013-08-01 12:47:41,471 INFO - Terracotta 3.5.4, as of 20111212-111224 (Revision 19290 by [email protected] from 3.5.4) 
2013-08-01 12:47:42,043 INFO - Successfully loaded base configuration from server at 'localhost:9510'. 
2013-08-01 12:47:42,135 INFO - Successfully loaded base configuration from file at '/var/folders/1k/kmzsymfj63b9jptfh4ywvplw6__lz7/T/tc-config3047796204629623347.xml'. 
2013-08-01 12:47:42,164 INFO - Log file: '/Users/james.mchugh/terracotta/client-logs/terracotta-client.log'. 
2013-08-01 12:47:42,184 WARN - Can't connect to server[10.194.194.133:9510:Tc-Group-0].Retrying... 

,並在其中只是坐在那裏嘗試重新連接和打印日誌每次執行以下操作:

2013-08-01 12:47:44,189 [main] INFO com.terracottatech.dso - Trying to get Groupname ID Map from http://10.194.194.133:9510/groupidmap 
2013-08-01 12:47:44,192 [main] WARN com.terracottatech.dso - Can't connect to [10.194.194.133:9510:Tc-Group-0]. 

沒有人有任何想法,爲什麼會發生這種事,我可以ping /遠程登錄到服務器兵馬俑得很好,但我不知道爲什麼它不會連接。我不太熟悉兵馬俑,所以在回答時請記住這一點。

乾杯。

回答

1

有一個IP不一致問題之間的「本地主機」和你的局域網IP 10.194.194.133(從日誌) 確保使用相同的IP兩個客戶(無論$ {} org.quartz.terracotta.tcConfigUrl解析爲 - 你使用了什麼?)和服務器(端口9510可能只綁定到IP 10.194.194.133) 運行「netstat -na」並檢查9510是否正在偵聽該IP ...可能只偵聽本地主機,或者你的局域網IP或者另一個IP(如果你的開發/服務器框上有2個網卡)

長篇故事:如果9510只綁定到IP 10.194.194.133,請確保$ {org.quartz .terracotta.tcConfigUrl} = 10.194.194.133。

或者,你也可以建立你自己的,可以由Maven插件加載TC-config.xml中(檢查http://forge.terracotta.org/releases/projects/tc-maven-plugin/configuration.html)...that方式,您可以細粒度設置網接口上赤土會工作。

。希望幫助

+0

我試圖使用相同的IP爲客戶端(即更改本地主機到10.194 ...),但我仍然得到相同的行爲。我會嘗試創建像你所建議的手動配置,但在此期間你有任何其他的想法嗎?奇怪的是開發人員控制檯terracotta使用localhost:9510連接到集羣罰款,所以我沒有看到什麼是preventi我的客戶。非常感謝。 – James