One deployment option for Coherence*Web is to use Coherence*Extend to connect web container JVMs to the cluster via TCP/IP. This configuration should be considered if one of the following applies:
- The web tier JVMs are in a DMZ while the Coherence cluster is behind a firewall
- The web tier is in an environment that does not support UDP
- Web tier JVMs experience long and/or frequent GC pauses
- Web tier JVMs are restarted frequently
In this type of deployment, there are three participants:
- The web tier JVMs. These are Extend clients in this topology. They are not members of the cluster; rather, they connect to a proxy node in the cluster that will issue requests to the cluster on their behalf.
- The proxy JVMs. These nodes are storage-disabled members of the cluster that accept and manage TCP/IP connections from Extend clients. Requests that arrive from clients will be sent into the cluster, and responses will be sent back through the TCP/IP connections.
- The storage JVMs. These JVMs are used to store the actual session data in memory.
The steps to configure Extend are as follows:
- Configure Coherence*Web to use the Optimistic Locking mode
- Create a cache configuration file for the proxy and storage JVMs
- Modify the web tier cache configuration file to point to one or more of the proxy JVMs
Configure the Optimistic Locking Mode
To enable the Optimistic Locking mode for your web application, make sure the following Coherence*Web configuration parameters are set to the specified values:
Cache Configuration for Proxy and Storage JVMs
The attached session-cache-config-server.xml file is an example Coherence*Web cache configuration file that uses Coherence*Extend. This cache configuration file should be used by the proxy and server JVMs. It contains system property overrides that allow the same file to be used for both proxy and storage JVMS. When used by a proxy JVM, the following system properties should be specified:
| system property name |
value |
| tangosol.coherence.session.localstorage |
false |
| tangosol.coherence.session.proxy |
true |
| tangosol.coherence.session.proxy.localhost |
the host name or IP address of the NIC the proxy will bind to |
| tangosol.coherence.session.proxy.localport |
a unique port number the proxy will bind to |
When used by a storage JVM, the following system properties should be specified:
| system property name |
value |
| tangosol.coherence.session.localstorage |
true |
| tangosol.coherence.session.proxy |
false |
Cache Configuration for Web Tier JVMs
The attached session-cache-config-client.xml file is an example Coherence*Web cache configuration file that uses Coherence*Extend. This cache configuration file should be used by the web tier JVMs. To use and install this cache configuration file, do the following:
- Add proxy JVM hostnames/IP addresses and ports to the <remote-addresses/> section. In most cases, you should include the hostname/IP address and port of all proxy JVMs for load balancing and failover.
- Rename the file to session-cache-config.xml.
- Place the file in the WEB-INF/classes directory of your web application. If you used the WebInstaller to install Coherence*Web, replace the existing file that was added by the WebInstaller.