我在 pom 中有一个 Maven 项目,其中包含以下内容:
<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>
当我尝试启动 terracotta 实例时,它似乎启动良好,我可以在开发人员控制台中看到集群。即使用:
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 cruise@rh5vmo100 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/telnet 进入兵马俑服务器就好了,但我不知道为什么它无法连接。我对兵马俑也不是很熟悉,所以在回答时请记住这一点。
干杯。