Oracle API Gateway (OAG) Distributed Cache is Using a Random Port Causing Problems When a Firewall is Present

(Doc ID 2136092.1)

Last updated on MAY 13, 2016

Applies to:

Oracle API Gateway - Version 11.1.2 and later
Information in this document applies to any platform.

Goal

On OAG 11.1.2.x-

Using a Oracle API Gateway (OAG) domain with 2 nodes and as a part of configuring high availability is to use distributed cache.
Distributed Cache was configured as per Oracle documentation:

Oracle API Gateway Administrator Guide (https://docs.oracle.com/cd/E55956_01/doc.11123/administrator_guide/content/index.html)
and
Oracle API Gateway User Guide (https://docs.oracle.com/cd/E55956_01/doc.11123/user_guide/content/index.html)


When testing the configuration with the environment firewall disabled, the information replicates successfully between the 2 nodes.
When testing with the firewall enabled, nothing is replicated, and the following exception is seen:

Exception on replication of putNotification. Exception creating connection to: XXXXXXXXXXX; nested exception is:
java.net.NoRouteToHostException: No route to host. Continuing...:
java.rmi.ConnectIOException: Exception creating connection to: XXXXXXXXXXX; nested exception is:
java.net.NoRouteToHostException: No route to host
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:631)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:129)
at net.sf.ehcache.distribution.RMICachePeer_Stub.put(Unknown Source)
at net.sf.ehcache.distribution.RMISynchronousCacheReplicator.replicatePutNotification(RMISynchronousCacheReplicator.java:149)
at net.sf.ehcache.distribution.RMISynchronousCacheReplicator.notifyElementUpdated(RMISynchronousCacheReplicator.java:187)
at net.sf.ehcache.event.RegisteredEventListeners.notifyListener(RegisteredEventListeners.java:294)
at net.sf.ehcache.event.RegisteredEventListeners.invokeListener(RegisteredEventListeners.java:272)
at net.sf.ehcache.event.RegisteredEventListeners.internalNotifyElementUpdated(RegisteredEventListeners.java:172)
at net.sf.ehcache.event.RegisteredEventListeners.notifyElementUpdated(RegisteredEventListeners.java:150)
at net.sf.ehcache.Cache.notifyPutInternalListeners(Cache.java:1444)
at net.sf.ehcache.Cache.putInternal(Cache.java:1438)
at net.sf.ehcache.Cache.put(Cache.java:1367)
at net.sf.ehcache.Cache.put(Cache.java:1339)

After some investigation, it was found that ehcache (OAG Cache) uses RMI to replicate the required information between nodes, and by default RMI communication uses any available port in communication which will be an issue if a firewall is enabled.

 

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms