[Logo] Terracotta Discussion Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Ports needed for RMI synchronization  XML
Forum Index -> Ehcache
Author Message
jacekf

neo

Joined: 03/23/2010 10:54:53
Messages: 5
Offline

Is there some docs on which ports needs to be open for the RMI cache synchronization to work?

Obviously the two ports defined in cacheManagerPeerProviderFactory(multicastGroupPort) and in cacheManagerPeerListenerFactory(port), but are those two the only ports that need to be open?

Our OPS team is super strict on open ports and they won't anything go into prod without explicitly knowing which ports need to be open.
zeeiyer

consul

Joined: 05/24/2006 14:28:28
Messages: 493
Offline

Yes those ones need to be open. Also, if you are specifying RMI URLs in your ehcache.xml - then those would need to be open as well.

Sreeni Iyer, Terracotta.
Not a member yet - Click here to join the Terracotta Community
jacekf

neo

Joined: 03/23/2010 10:54:53
Messages: 5
Offline

Yes, but are those the only ports I need?

or are there others? I was reading somewhere that RMI caching uses any random port from 1024 to 65536 or something alone those lines...do I need to have those wide open by our OPS team?
gluck

qaestor

Joined: 09/15/2009 18:01:23
Messages: 179
Location: Brisbane, Australia
Offline

You are correct that RMI, by default does use portmap and therefore random, non-root ports.

However that does not suit many production environments.

To lock it down you specify the port and remoteObjectPort as shown below (note this is in the sample ehcache.xml which ships with ehcache or is available straight off the home page, if you were looking for it)

Code:
 <cacheManagerPeerListenerFactory
         class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
         properties="hostName=fully_qualified_hostname_or_ip,
                     port=40001,
                     remoteObjectPort=40002,
                     socketTimeoutMillis=120000"
                     propertySeparator="," />
 
     All properties are optional. They are:
     * hostName - the hostName of the host the listener is running on. Specify
       where the host is multihomed and you want to control the interface over which cluster
       messages are received. Defaults to the host name of the default interface if not
       specified.
     * port - the port the RMI Registry listener listens on. This defaults to a free port if not specified.
     * remoteObjectPort - the port number on which the remote objects bound in the registry receive calls.
                          This defaults to a free port if not specified.
 


The other thing you want to specify is the multicast IP and port:
Code:
 <cacheManagerPeerProviderFactory
                         class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
                         properties="hostName=fully_qualified_hostname_or_ip,
                                     peerDiscovery=automatic, multicastGroupAddress=230.0.0.1,
                                     multicastGroupPort=4446, timeToLive=32"/>
 
rajoshi

seraphim

Joined: 07/04/2011 04:36:10
Messages: 1465
Offline

Issue seems to be resolved.Please let us know if more information is required.

Rakesh Joshi
Terracotta.
 
Forum Index -> Ehcache
Go to:   
Powered by JForum 2.1.7 © JForum Team