我想使用 terracotta + Shiro 来实现 SSO。当我尝试对其进行测试时,出现错误:
The configuration data in the base configuration from server at 'localhost:9510' does not obey the Terracotta schema:
[0]: Line 4, column 5: Expected elements 'tc-properties servers clients' instead of 'system' here in element tc-config@http://www.terracotta.org/config
[1]: Line 16, column 13: Expected elements 'offheap authentication http-authentication data-backup tsa-port jmx-port tsa-group-port security' instead of 'statistics' here in element server
[2]: Line 19, column 13: Expected elements 'offheap authentication http-authentication data-backup tsa-port jmx-port tsa-group-port security' instead of 'dso-port' here in element server
[3]: Line 21, column 13: Expected elements 'offheap authentication http-authentication data-backup tsa-port tsa-group-port security' instead of 'l2-group-port' here in element server
[4]: Line 32, column 13: Expected elements 'offheap http-authentication data-backup tsa-port tsa-group-port security' instead of 'dso' here in element server
[5]: Line 50, column 9: Expected elements 'server mirror-group update-check garbage-collection restartable client-reconnect-window' instead of 'mirror-groups' here in element servers
[6]: Line 63, column 9: Expected elements 'server mirror-group update-check garbage-collection restartable client-reconnect-window' instead of 'ha' here in element servers
[7]: Line 86, column 5: Element not allowed: application in element tc-config@http://www.terracotta.org/config
谁能帮我找出问题所在?
这是我的配置:
tc 客户端上的 ehcache.xml:
<ehcache name="Plugin_Ehcache"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd"
updateCheck="false" monitoring="autodetect"
dynamicConfig="false">
<diskStore path="java.io.tmpdir/shiro-ehcache"/>
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="false"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120">
<terracotta/>
</defaultCache>
<cache name="shiro-activeSessionCache"
maxElementsInMemory="10000"
eternal="true"
timeToLiveSeconds="0"
timeToIdleSeconds="0"
diskPersistent="false"
overflowToDisk="false"
diskExpiryThreadIntervalSeconds="600">
<terracotta/>
</cache>
<terracottaConfig url="localhost:9510"/>
</ehcache>
tc 服务器上的 tc-config.xml
<tc:tc-config xsi:schemaLocation="http://www.terracotta.org/schema/terracotta-8.xsd"
xmlns:tc="http://www.terracotta.org/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tc-properties>
<property name="l2.l1reconnect.enabled" value="true"/>
<property name="l2.l1reconnect.timeout.millis" value="5000"/>
<property name="sigar.enabled" value="false"/>
<property name="search.use.commit.thread" value="false"/>
<property name="search.lucene.use.ram.directory" value="true"/>
<property name="search.query.wait.for.txns" value="false"/>
<property name="logging.maxLogFileSize" value="100"/>
<property name="logging.maxBackups" value="10"/>
</tc-properties>
<system>
<configuration-model>development</configuration-model>
</system>
<servers>
<server host="localhost" name="Terracotta Server1">
<!-- Specify the path where the server should store its data. -->
<data>C:\Program Files\Terracotta\terracotta-3.7.5\server\server-data</data>
<logs>C:\Program Files\Terracotta\terracotta-3.7.5\server\server-logs</logs>
<index>C:\Program Files\Terracotta\terracotta-3.7.5\server\server-index</index>
<statistics>C:\Program Files\Terracotta\terracotta-3.7.5\server\server-statistics</statistics>
<!-- Specify the port where the server should listen for client
traffic. -->
<dso-port bind="127.0.0.1">9510</dso-port>
<jmx-port bind="127.0.0.1">9520</jmx-port>
<l2-group-port bind="localhost">9530</l2-group-port>
<!--jmx-port bind="xxx.xxx.xxx.xxx">9520</jmx-port>
<tsa-port>9510</tsa-port>
<tsa-group-port>9530</tsa-group-port-->
<!-- Enable BigMemory on the server. -->
<!--offheap>
<enabled>true</enabled>
<maxDataSize>4g</maxDataSize>
</offheap-->
<authentication/>
<dso>
<client-reconnect-window>120</client-reconnect-window>
<persistence>
<mode>permanent-store</mode>
<!--mode>temporary-swap-only</mode-->
<!--<offheap>
<enabled>false</enabled>
<maxDataSize>450m</maxDataSize>
</offheap>-->
</persistence>
<garbage-collection>
<enabled>true</enabled>
<verbose>false</verbose>
<interval>300</interval>
</garbage-collection>
</dso>
</server>
<mirror-groups>
<mirror-group group-name="group1">
<members>
<member>Terracotta Server1</member>
</members>
<ha>
<mode>networked-active-passive</mode>
<networked-active-passive>
<election-time>5</election-time>
</networked-active-passive>
</ha>
</mirror-group>
</mirror-groups>
<ha>
<mode>networked-active-passive</mode>
<networked-active-passive>
<election-time>5</election-time>
</networked-active-passive>
</ha>
<update-check>
<enabled>false</enabled>
</update-check>
<!-- Add the restartable element for Fast Restartability (optional). -->
<!--restartable enabled="true"/-->
</servers>
<clients>
<logs>logs-%i</logs>
</clients>
</tc:tc-config>