terracottaConfig
The <terracottaConfig> element enables the distributed-cache client to identify a source of Terracotta configuration. It also allows a client to rejoin a cluster after disconnecting from that cluster and being timed out by a Terracotta server. For more information on the rejoin feature, see the BigMemory Max High-Availability Guide. In addition, the <terracottaConfig> element allows you to enable caches for WAN replication.
The client must load the configuration from a file or a Terracotta server. The value of the url attribute should contain a path to the file, a system property, or the address and TSA port (9510 by default) of a server.
Note:
In a Terracotta cluster, the application server is also known as the client.
For more information on client configuration, see the "Terracotta Configuration Parameters" in the BigMemory Max Administrator Guide.
Adding an URL Attribute
Add the url attribute to the <terracottaConfig> element as follows:
<terracottaConfig url="<source>" />
where <source> must be one of the following:
A path (for example,
url="/path/to/tc-config.xml")
An URL (for example,
url="http://www.mydomain.com/path/to/tc-config.xml)
A system property (for example,
url="${terracotta.config.location}"), where the system property is defined like this:
System.setProperty("terracotta.config.location","10.x.x.x:9510"");
A Terracotta host address in the form
<host>:<tsa-port> (for example,
url="host1:9510"). Note the following about using server addresses in the form
<host>:<tsa-port>:
The default TSA port is 9510.
In a multi-server cluster, you can specify a comma-delimited list (for example,
url="host1:9510,host2:9510,host3:9510").
If the Terracotta configuration source changes at a later time, it must be updated in configuration.
Adding the WAN Attribute
For each cache to be replicated, its ehcache.xml configuration file must include the wanEnabledTSA attribute set to "true" within the <terracottaConfig> element. Add the wanEnabledTSA attribute to the <terracottaConfig> element as follows:
<terracottaConfig wanEnabledTSA="true"/>
For more information, see the WAN Replication User Guide.
Embedding Terracotta Configuration
You can embed the contents of a Terracotta configuration file in ehcache.xml as follows:
<terracottaConfig>
<tc-config>
<servers>
<server host="server1" name="s1"/>
<server host="server2" name="s2"/>
</servers>
<clients>
<logs>app/logs-%i</logs>
</clients>
</tc-config>
</terracottaConfig>