Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
31.2. Configure Cross-Datacenter Replication
31.2.1. Configure Cross-Datacenter Replication (Remote Client-Server Mode) Link kopierenLink in die Zwischenablage kopiert!
Procedure 31.1. Set Up Cross-Datacenter Replication
Set Up RELAY
Add the following configuration to thestandalone.xml
file to set upRELAY
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow TheRELAY
protocol creates an additional stack (running parallel to the existingTCP
stack) to communicate with the remote site. If aTCP
based stack is used for the local cluster, twoTCP
based stack configurations are required: one for local communication and one to connect to the remote site. For an illustration, see Section 31.1, “Cross-Datacenter Replication Operations”Set Up Sites
Use the following configuration in thestandalone.xml
file to set up sites for each distributed cache in the cluster:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure Local Site Transport
Add the name of the local site in thetransport
element to configure transport:<transport executor="infinispan-transport" lock-timeout="60000" cluster="LON" stack="udp"/>
<transport executor="infinispan-transport" lock-timeout="60000" cluster="LON" stack="udp"/>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
31.2.2. Configure Cross-Data Replication (Library Mode) Link kopierenLink in die Zwischenablage kopiert!
31.2.2.1. Configure Cross-Datacenter Replication Declaratively Link kopierenLink in die Zwischenablage kopiert!
relay.RELAY2
protocol creates an additional stack (running parallel to the existing TCP
stack) to communicate with the remote site. If a TCP
-based stack is used for the local cluster, two TCP
based stack configurations are required: one for local communication and one to connect to the remote site.
Procedure 31.2. Setting Up Cross-Datacenter Replication
Configure the Local Site
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add the
site
element to theglobal
element to add the local site (in this example, the local site is namedLON
). - Cross-site replication requires a non-default JGroups configuration. Add the
transport
element and set up the path to the configuration file as theconfigurationFile
property. In this example, the JGroups configuration file is namedjgroups-with-relay.xml
. - Configure the cache in site
LON
to back up to the sitesNYC
andSFO
. - Configure the back up caches:
- Configure the cache in site
NYC
to receive back up data fromLON
. - Configure the cache in site
SFO
to receive back up data fromLON
.
Add the Contents of the Configuration File
As a default, Red Hat JBoss Data Grid includes JGroups configuration files such asdefault-configs/default-jgroups-tcp.xml
anddefault-configs/default-jgroups-udp.xml
in theinfinispan-embedded-{VERSION}.jar
package.Copy the JGroups configuration to a new file (in this example, it is namedjgroups-with-relay.xml
) and add the provided configuration information to this file. Note that therelay.RELAY2
protocol configuration must be the last protocol in the configuration stack.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the relay.xml File
Set up therelay.RELAY2
configuration in therelay.xml
file. This file describes the global cluster configuration.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the Global Cluster
The filejgroups-global.xml
referenced inrelay.xml
contains another JGroups configuration which is used for the global cluster: communication between sites.The global cluster configuration is usuallyTCP
-based and uses theTCPPING
protocol (instead ofPING
orMPING
) to discover members. Copy the contents ofdefault-configs/default-jgroups-tcp.xml
intojgroups-global.xml
and add the following configuration in order to configureTCPPING
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace the hostnames (or IP addresses) inTCPPING.initial_hosts
with those used for your site masters. The ports (7800
in this example) must match theTCP.bind_port
.For more information about theTCPPING
protocol, see Section 26.2.1.3, “Using the TCPPing Protocol”
31.2.2.2. Configure Cross-Datacenter Replication Programmatically Link kopierenLink in die Zwischenablage kopiert!
Procedure 31.3. Configure Cross-Datacenter Replication Programmatically
Identify the Node Location
Declare the site the node resides in:globalConfiguration.site().localSite("LON");
globalConfiguration.site().localSite("LON");
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure JGroups
Configure JGroups to use theRELAY
protocol:globalConfiguration.transport().addProperty("configurationFile", jgroups-with-relay.xml);
globalConfiguration.transport().addProperty("configurationFile", jgroups-with-relay.xml);
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set Up the Remote Site
Set up JBoss Data Grid caches to replicate to the remote site:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Configure the Backup Caches
JBoss Data Grid implicitly replicates data to a cache with same name as the remote site. If a backup cache on the remote site has a different name, users must specify abackupFor
cache to ensure data is replicated to the correct cache.Note
This step is optional and only required if the remote site's caches are named differently from the original caches.- Configure the cache in site
NYC
to receive backup data fromLON
:ConfigurationBuilder NYCbackupOfLon = new ConfigurationBuilder(); NYCbackupOfLon.sites().backupFor().remoteCache("lon").remoteSite("LON");
ConfigurationBuilder NYCbackupOfLon = new ConfigurationBuilder(); NYCbackupOfLon.sites().backupFor().remoteCache("lon").remoteSite("LON");
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Configure the cache in site
SFO
to receive backup data fromLON
:ConfigurationBuilder SFObackupOfLon = new ConfigurationBuilder(); SFObackupOfLon.sites().backupFor().remoteCache("lon").remoteSite("LON");
ConfigurationBuilder SFObackupOfLon = new ConfigurationBuilder(); SFObackupOfLon.sites().backupFor().remoteCache("lon").remoteSite("LON");
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Add the Contents of the Configuration File
As a default, Red Hat JBoss Data Grid includes JGroups configuration files such asdefault-configs/default-jgroups-tcp.xml
anddefault-configs/default-jgroups-udp.xml
in theinfinispan-embedded-{VERSION}.jar
package.Copy the JGroups configuration to a new file (in this example, it is namedjgroups-with-relay.xml
) and add the provided configuration information to this file. Note that therelay.RELAY2
protocol configuration must be the last protocol in the configuration stack.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the relay.xml File
Set up therelay.RELAY2
configuration in therelay.xml
file. This file describes the global cluster configuration.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the Global Cluster
The filejgroups-global.xml
referenced inrelay.xml
contains another JGroups configuration which is used for the global cluster: communication between sites.The global cluster configuration is usuallyTCP
-based and uses theTCPPING
protocol (instead ofPING
orMPING
) to discover members. Copy the contents ofdefault-configs/default-jgroups-tcp.xml
intojgroups-global.xml
and add the following configuration in order to configureTCPPING
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace the hostnames (or IP addresses) inTCPPING.initial_hosts
with those used for your site masters. The ports (7800
in this example) must match theTCP.bind_port
.For more information about theTCPPING
protocol, see Section 26.2.1.3, “Using the TCPPing Protocol”