首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用ehcache连接到terracotta maven插件

无法使用ehcache连接到terracotta maven插件
EN

Stack Overflow用户
提问于 2013-08-01 20:03:47
回答 1查看 723关注 0票数 0

我在pom中有一个包含以下内容的maven项目:

代码语言:javascript
复制
<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实例时,它似乎启动得很好,并且我可以在开发人员控制台中看到集群。即使用:

代码语言:javascript
复制
mvn tc:start

然后我运行我的应用程序,它有一个ehcache配置。terracotta URL已设置(属性正在正确替换):

代码语言:javascript
复制
<terracottaConfig url="${org.quartz.terracotta.tcConfigUrl}"/>

但在控制台上,我得到了以下内容:

代码语言:javascript
复制
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... 

在日志中,它只是停在那里,试图重新连接,并每次打印以下内容:

代码语言:javascript
复制
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到terracotta服务器,但是我不知道为什么它不能连接。我对terracotta也不是很熟悉,所以在回答的时候尽量记住这一点。

干杯。

EN

回答 1

Stack Overflow用户

发布于 2013-08-02 04:10:49

在"localhost“和你的局域网IP 10.194.194.133 (从你的日志中)之间存在IP不一致的问题,请确保两个客户端使用相同的IP (无论${org.quartz.terracotta.tcConfigUrl}解析为什么-你使用了什么?)和服务器(端口9510可能只绑定到IP 10.194.194.133)运行"netstat -na“并检查9510正在侦听的IP...might是否只在本地主机上侦听,或者您的局域网IP,或者可能是另一个IP (如果您的设备/服务器上有2个NIC)

长话短说:如果9510仅绑定到IP 10.194.194.133,请确保${org.quartz.terracotta.tcConfigUrl} = 10.194.194.133。

或者,您也可以构建自己的tc-config.xml,它可以由maven插件加载(查看http://forge.terracotta.org/releases/projects/tc-maven-plugin/configuration.html)...that的方式,您可以细粒度地设置terracotta将在其上工作的网络接口。

希望这能有所帮助。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17993544

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档