8.2.4.3. Customize the Default Cluster Configuration
Depending on the network requirements, you may need to customize your JGroups configuration.
Programmatic Configuration:
Use the following GlobalConfiguration code to specify the name of the file to use for JGroups configuration:
new GlobalConfigurationBuilder().transport().addProperty("configurationFile", "jgroups.xml")
.build()
new GlobalConfigurationBuilder().transport().addProperty("configurationFile", "jgroups.xml")
.build()
Replace
jgroups.xml with the desired file name.
The
jgroups.xml file is located at $Infinispan-Quickstart/clustered-cache/src/main/resources/.
Note
To bind JGroups solely to your loopback interface (to avoid any configured firewalls), use the system property
-Djgroups.bind_addr="127.0.0.1". This is particularly useful to test a cluster where all nodes are on a single machine.
Declarative Configuration:
Use the following XML snippet in the infinispan.xml file to configure the JGroups properties to use Red Hat JBoss Data Grid's XML configuration: