jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Smuts, Aaron" <Aaron.Sm...@travelocity.com>
Subject RE: JCS cluster on a single box
Date Thu, 04 Aug 2005 19:33:51 GMT
There is no tcp port range feature, but one could be made.  There is a
udp lateral plugin, but it is too unreliable under high load.  

You can either have different cache.ccf files for each node or you can
programmatically configure the cache and specify the port in some other
way.  You could pass the value at the command line -Dcachetcpport=1100
or put it in jndi if you are in a container.  They you can have some
intitialization code or a startup servlet initialize the cache.  

Rather than call cache.getInstance, you would need to configure it with
a properties file.  You should load the cache.ccf, and replace the
"jcs.auxiliary.LTCP.attributes.TcpListenerPort" value with whatever you
passed in at the command line. 

Something like this would work:



    public void initializeCache()
    {
        //ex.  -Dcachetcpport=1101
        String portSystemPropName = "cachetcpport";
        String cachePropName =
"jcs.auxiliary.LTCP.attributes.TcpListenerPort"; 
        String propFileName = "/cache.ccf";
        Properties props = new Properties();

        InputStream is = getClass().getResourceAsStream( propFileName );

        try
        {
            props.load( is );

        }
        catch ( IOException ex )
        {
            //log.error( "Failed to load properties", ex );
        }
        finally
        {
            try
            {
                is.close();
            }
            catch ( Exception ignore )
            {
                // Ignored
            }
        }
        
        // get the port from the system properties
        String port = System.getProperty( portSystemPropName );
        
        // replace the port
        props.put( cachePropName, port );
        
        CompositeCacheManager cacheMgr =
CompositeCacheManager.getUnconfiguredInstance();
        cacheMgr.configure( props );
    }


















> -----Original Message-----
> From: Andre Kovacs [mailto:andreok@mail.com]
> Sent: Thursday, August 04, 2005 3:11 PM
> To: jcs-users@jakarta.apache.org
> Subject: JCS cluster on a single box
> Importance: High
> 
> I would like to know if there's a way to configure JCS to run on
multiple
> nodes on a single box.
> 
> I'm using Lateral UDP Discovery, but JCS forces using TCP as
transmission
> type and a port that must be specified in the config file.
> 
> Here's my Lateral Cache config:
>
"jcs.auxiliary.LTCP=org.apache.jcs.auxiliary.lateral.LateralCacheFactory
>
jcs.auxiliary.LTCP.attributes=org.apache.jcs.auxiliary.lateral.LateralCa
ch
> eAttributes
> jcs.auxiliary.LTCP.attributes.TransmissionTypeName=TCP
> jcs.auxiliary.LTCP.attributes.TcpListenerPort=1110
> jcs.auxiliary.LTCP.attributes.PutOnlyMode=true
> jcs.auxiliary.LTCP.attributes.UdpDiscoveryAddr=224.10.10.10
> jcs.auxiliary.LTCP.attributes.UdpDiscoveryPort=5555
> jcs.auxiliary.LTCP.attributes.UdpDiscoveryEnabled=true
> jcs.auxiliary.LTCP.attributes.Receive=true"
> 
> Is there a way to do automatic tcp listener port binding, instead of
> adding the TcpListenerPort attribute? Or use UDP as the transmission
> protocol?
> 
> Thanks,
>        Andre Kovacs
> 
> --
> ___________________________________________________________
> Sign-up for Ads Free at Mail.com
> http://promo.mail.com/adsfreejump.htm
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jcs-users-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org


Mime
View raw message