Deprecation

This document is DEPRECATED.

Please consider any information here as out of date. DO NOT use this document.

Instead, refer to http://infinispan.org/documentation.

Please update your bookmarks accordingly.

Skip to end of metadata
Go to start of metadata

Infinispan ships with pre-configured JGroups stacks that make it easy for you to jump-start a clustered configuration.

Using an external JGroups file

If you are configuring your cache programmatically, all you need to do is:

and if you happen to use an XML file to configure Infinispan, just use:
In both cases above, Infinispan looks for jgroups.xml first in your classpath, and then for an absolute path name if not found in the classpath.

Use one of the pre-configured JGroups files

Infinispan ships with a few different JGroups files (packaged in infinispan-core.jar) which means they will already be on your classpath by default.  All you need to do is specify the file name, e.g., instead of jgroups.xml above, specify jgroups-tcp.xml.

The configurations available are:

  • jgroups-udp.xml - Uses UDP as a transport, and UDP multicast for discovery.  Usually suitable for larger (over 100 nodes) clusters or if you are using replication or invalidation.  Minimises opening too many sockets.
  • jgroups-tcp.xml - Uses TCP as a transport and UDP multicast for discovery.  Better for smaller clusters (under 100 nodes) only if you are using distribution, as TCP is more efficient as a point-to-point protocol
  • jgroups-ec2.xml - Uses TCP as a transport and S3_PING for discovery.  Suitable on Amazon EC2 nodes where UDP multicast isn't available.

Fine-tuning JGroups settings

The settings above can be further tuned without editing the XML files themselves.  Passing in certain system properties to your JVM at startup can affect the behaviour of some of these settings.  The table below shows you which settings can be configured in this way.  E.g.,

jgroups-udp.xml

System Property Description Default Required?
jgroups.udp.mcast_addr IP address to use for multicast (both for communications and discovery).  Must be a valid Class D IP address, suitable for IP multicast. 228.6.7.8 No
jgroups.udp.mcast_port Port to use for multicast socket 46655 No
jgroups.udp.ip_ttl Specifies the time-to-live (TTL) for IP multicast packets. The value here refers to the number of network hops a packet is allowed to make before it is dropped 2 No

jgroups-tcp.xml

System Property Description Default Required?
jgroups.tcp.address IP address to use for the TCP transport. 127.0.0.1 No
jgroups.tcp.port Port to use for TCP socket 7800 No
jgroups.udp.mcast_addr IP address to use for multicast (for discovery).  Must be a valid Class D IP address, suitable for IP multicast. 228.6.7.8 No
jgroups.udp.mcast_port Port to use for multicast socket 46655 No
jgroups.udp.ip_ttl Specifies the time-to-live (TTL) for IP multicast packets. The value here refers to the number of network hops a packet is allowed to make before it is dropped 2 No

jgroups-ec2.xml

System Property Description Default Required?
jgroups.tcp.address IP address to use for the TCP transport. 127.0.0.1 No
jgroups.tcp.port Port to use for TCP socket 7800 No
jgroups.s3.access_key The Amazon S3 access key used to access an S3 bucket   No
jgroups.s3.secret_access_key The Amazon S3 secret key used to access an S3 bucket   No
jgroups.s3.bucket Name of the Amazon S3 bucket to use.  Must be unique and must already exist   No

Further reading

JGroups also supports more system property overrides, details of which can be found on this page: SystemProps

In addition, the JGroups configuration files shipped with Infinispan are intended as a jumping off point to getting something up and running, and working.  More often than not though, you will want to fine-tune your JGroups stack further to extract every ounce of performance from your network equipment.  For this, your next stop should be the JGroups manual which has a detailed section on configuring each of the protocols you see in a JGroups configuration file.

Labels:
infinispan infinispan Delete
configuration configuration Delete
cluster cluster Delete
jgroups jgroups Delete
amazon amazon Delete
ec2 ec2 Delete
aws aws Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Jul 11, 2012

    Actually you will need to do:

    if you don't want to lose a few hours trying to figure out why XML works and programmatically doesn't.