时雨先生 2017-10-01 00:19 采纳率: 0%
浏览 1707

项目中使用ehcahe +Terracotta时遇到的一个配置问题

使用ehcahe+Terracotta做项目缓存服务遇到tomcat启动报错,版本ehcahe-core2.6.11 Terracotta4.3.4报错内容如下:

 Caused by: java.lang.RuntimeException: com.tc.config.schema.setup.ConfigurationSetupException: 
*******************************************************************************
The configuration data in the base configuration from server at '127.0.0.1:9510' does not obey the Terracotta schema:
  [0]: Line 8, column 9: Expected element 'server' instead of 'mirror-group' here in element servers
  [1]: Line 27, column 9: Expected element 'server' instead of 'garbage-collection' here in element servers
  [2]: Line 32, column 9: Expected element 'server' instead of 'restartable' here in element servers
  [3]: Line 33, column 9: Expected element 'server' instead of 'client-reconnect-window' here in element servers

*******************************************************************************

    at com.terracotta.express.StandaloneL1Boot.resolveConfig(StandaloneL1Boot.java:140)
    at com.terracotta.express.StandaloneL1Boot.createConfigFile(StandaloneL1Boot.java:101)
    at com.terracotta.express.StandaloneL1Boot.call(StandaloneL1Boot.java:221)
    at com.terracotta.express.ClientImpl.<init>(ClientImpl.java:369)
    ... 138 more
Caused by: com.tc.config.schema.setup.ConfigurationSetupException: 
*******************************************************************************
The configuration data in the base configuration from server at '127.0.0.1:9510' does not obey the Terracotta schema:
  [0]: Line 8, column 9: Expected element 'server' instead of 'mirror-group' here in element servers
  [1]: Line 27, column 9: Expected element 'server' instead of 'garbage-collection' here in element servers
  [2]: Line 32, column 9: Expected element 'server' instead of 'restartable' here in element servers
  [3]: Line 33, column 9: Expected element 'server' instead of 'client-reconnect-window' here in element servers

*******************************************************************************

    at com.tc.config.schema.setup.StandardXMLFileConfigurationCreator.getConfigFromSourceStream(StandardXMLFileConfigurationCreator.java:510)
    at com.tc.config.schema.setup.StandardXMLFileConfigurationCreator.loadConfigurationData(StandardXMLFileConfigurationCreator.java:427)
    at com.tc.config.schema.setup.StandardXMLFileConfigurationCreator.loadConfigDataFromSources(StandardXMLFileConfigurationCreator.java:242)
    at com.tc.config.schema.setup.StandardXMLFileConfigurationCreator.loadConfigAndSetIntoRepositories(StandardXMLFileConfigurationCreator.java:129)
    at com.tc.config.schema.setup.StandardXMLFileConfigurationCreator.createConfigurationIntoRepositories(StandardXMLFileConfigurationCreator.java:111)
    at com.terracotta.express.StandaloneL1Boot.resolveEmbedded(StandaloneL1Boot.java:193)
    at com.terracotta.express.StandaloneL1Boot.resolveConfig(StandaloneL1Boot.java:138)
    ... 141 more

目测是tc-config.xml 配置错误。以下是我的tc-config.xml

 <tc:tc-config xmlns:tc="http://www.terracotta.org/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">  
  <tc-properties> 
    <property name="l1.cachemanager.enabled" value="false"/>  
    <property name="l1.cachemanager.leastCount" value="4"/> 
  </tc-properties>  
  <servers> 
    <mirror-group group-name="group1"> 
      <server host="127.0.0.1" name="server1" bind="127.0.0.1"> 
        <data>c:/terracotta/server-data</data>  
        <logs>c:/terracotta/server-logs</logs>  
        <index>c:/terracotta/server-index</index>  
        <tsa-port bind="127.0.0.1">9510</tsa-port>  
        <jmx-port bind="127.0.0.1">9520</jmx-port>  
        <tsa-group-port bind="127.0.0.1">9530</tsa-group-port>  
        <management-port bind="127.0.0.1">9540</management-port>  
        <authentication/>  
        <http-authentication> 
          <user-realm-file>c:/terracotta/realm.properties</user-realm-file> 
        </http-authentication> 
         <offheap>
        <enabled>false</enabled>
        <maxDataSize>1g</maxDataSize>
      </offheap>
      </server> 
    </mirror-group>  
    <garbage-collection> 
      <enabled>true</enabled>  
      <verbose>false</verbose>  
      <interval>3600</interval> 
    </garbage-collection>  
    <restartable enabled="false"/>  
    <client-reconnect-window>120</client-reconnect-window> 
  </servers>  
  <clients> 
    <logs>logs-%i</logs> 
  </clients> 
</tc:tc-config>

以上tc-config.xml配置,我的terracotta能正常启动。

  • 写回答

2条回答 默认 最新

  • 时雨先生 2017-10-01 00:30
    关注

    补充:按照上面tc-config.xml 我的terracotta能正常启动。通过查阅terracotta官网指导配置信息和结合报错信息,需要使用mirror-group方式配置,求大神帮忙指导!!!小弟感激不尽!!!

    评论

报告相同问题?

悬赏问题

  • ¥15 fesafe材料库问题
  • ¥35 beats蓝牙耳机怎么查看日志
  • ¥15 Fluent齿轮搅油
  • ¥15 八爪鱼爬数据为什么自己停了
  • ¥15 交替优化波束形成和ris反射角使保密速率最大化
  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统