このコンテンツは選択した言語では利用できません。
8.2.4.4. Configure the Replicated Data Grid
Red Hat JBoss Data Grid's replicated mode ensures that every entry is replicated on every node in the data grid.
This mode offers security against data loss due to node failures and excellent data availability. These benefits are at the cost of limiting the storage capacity to the amount of storage available on the node with the least memory.
Programmatic Configuration:
Use the following code snippet to programmatically configure the cache for replication mode (either synchronous or asynchronous):
Declarative Configuration:
Edit the infinispan-replication.xml file to include the following XML code to declaratively configure the cache for replication mode (either synchronous or asynchronous):
Use the following code to initialize and return a DefaultCacheManager with the XML configuration file:
private static EmbeddedCacheManager createCacheManagerFromXml() throws IOException {
return new DefaultCacheManager("infinispan-replication.xml");}
private static EmbeddedCacheManager createCacheManagerFromXml() throws IOException {
return new DefaultCacheManager("infinispan-replication.xml");}
Note
JBoss EAP includes its own underlying JMX. This can cause a collision when using the sample code with JBoss EAP and display an error such as
org.infinispan.jmx.JmxDomainConflictException: Domain already registered org.infinispan.
To avoid this, configure global configuration as follows:
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow