EHCache configuration for Clustered environment

View: New views
12 Messages — Rating Filter:   Alert me  

EHCache configuration for Clustered environment

by Nidhi.Sharma :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Could someone please give me pointers to EHCache configuration for Clustered environment; how to do this set up ?

 

-Nidhi


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
ehcache-list mailing list
ehcache-list@...
https://lists.sourceforge.net/lists/listinfo/ehcache-list

Re: EHCache configuration for Clustered environment

by gregluck :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

Please start with the documentation on the site. Let me know how you find it.


On 12/06/2008, at 5:54 AM, <Nidhi.Sharma@...> wrote:

Could someone please give me pointers to EHCache configuration for Clustered environment; how to do this set up ?
 
-Nidhi
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php_______________________________________________
ehcache-list mailing list
ehcache-list@...
https://lists.sourceforge.net/lists/listinfo/ehcache-list

Regards


Greg Luck


skype: gregrluck
yahoo: gregrluck
mobile: +61 408 061 622




-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
ehcache-list mailing list
ehcache-list@...
https://lists.sourceforge.net/lists/listinfo/ehcache-list

Re: EHCache configuration for Clustered environment

by Nidhi.Sharma :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Thanks for the reply Greg. I am looking at the documentation. http://ehcache.sourceforge.net/documentation/distributed_caching.html

I am a novice here; so please bear with me.
For automatic peer discovery setup; do I set the following values for multicastparameters ?
 multicastGroupAddress=230.0.0.1, multicastGroupPort=4446

 

Also, can I enable/disable distributed cache just by the use of a parameter ? As I want to use the same ehcache.xml for different environments but on some machines I want distributed cache; on others not; so I would like it to be enabled/disabled just by using some parameter/variable.

 

-Nidhi

 

From: Greg Luck [mailto:gluck@...]
Sent: Friday, June 13, 2008 6:54 AM
To: Nidhi Sharma
Cc: ehcache-list@...
Subject: Re: [ehcache-list] EHCache configuration for Clustered environment

 

Hi

 

Please start with the documentation on the site. Let me know how you find it.

 

 

On 12/06/2008, at 5:54 AM, <Nidhi.Sharma@...> wrote:



Could someone please give me pointers to EHCache configuration for Clustered environment; how to do this set up ?

 

-Nidhi

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php_______________________________________________
ehcache-list mailing list
ehcache-list@...
https://lists.sourceforge.net/lists/listinfo/ehcache-list

 

Regards

 

Greg Luck

 

skype: gregrluck

yahoo: gregrluck

mobile: +61 408 061 622

 



 


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
ehcache-list mailing list
ehcache-list@...
https://lists.sourceforge.net/lists/listinfo/ehcache-list

Re: EHCache configuration for Clustered environment

by gregluck :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Nidhi

On 14/06/2008, at 12:07 AM, <Nidhi.Sharma@...> wrote:

Thanks for the reply Greg. I am looking at the documentation. http://ehcache.sourceforge.net/documentation/distributed_caching.html
I am a novice here; so please bear with me.
For automatic peer discovery setup; do I set the following values for multicastparameters ?
 multicastGroupAddress=230.0.0.1, multicastGroupPort=4446
That should work. 

 
Also, can I enable/disable distributed cache just by the use of a parameter ? As I want to use the same ehcache.xml for different environments but on some machines I want distributed cache; on others not; so I would like it to be enabled/disabled just by using some parameter/variable.
 
In ehcache-1.5.0, you place tokens in the form ${token} in the ehcache.xml. The tokens are replaced with system properties. 

See 



which has 

    System property tokens can be specified in this file which are replaced when the configuration is loaded.
    For example multicastGroupPort=${multicastGroupPort} can be replaced with the System property either
    from an environment variable or a system property specified with a command line switch such as
     -DmulticastGroupPort=4446.


-Nidhi
 
From: Greg Luck [gluck@...] 
Sent: Friday, June 13, 2008 6:54 AM
To: Nidhi Sharma
Cc: ehcache-list@...
Subject: Re: [ehcache-list] EHCache configuration for Clustered environment
 
Hi
 
Please start with the documentation on the site. Let me know how you find it.
 
 
On 12/06/2008, at 5:54 AM, <Nidhi.Sharma@...> wrote:


Could someone please give me pointers to EHCache configuration for Clustered environment; how to do this set up ?
 
-Nidhi
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php_______________________________________________
ehcache-list mailing list
ehcache-list@...
https://lists.sourceforge.net/lists/listinfo/ehcache-list
 
Regards
 
Greg Luck
 
skype: gregrluck
yahoo: gregrluck
mobile: +61 408 061 622
 


 

Regards


Greg Luck


skype: gregrluck
yahoo: gregrluck
mobile: +61 408 061 622




-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
ehcache-list mailing list
ehcache-list@...
https://lists.sourceforge.net/lists/listinfo/ehcache-list

Distributed cache : Exception Connection refused to host: 127.0.0.1

by Nidhi.Sharma :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

I have the Distributed cache set up for ehcache.

I have 2 servers on the network; apollo and logos .

 

On Apollo ehcache settings are :

<cacheManagerPeerProviderFactory

 class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"

 properties="peerDiscovery=automatic, multicastGroupAddress=230.0.0.1,

 multicastGroupPort=4446, timeToLive=32"/>

 

<cacheManagerPeerListenerFactory

  class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"

   properties="hostName=apollo, port=40001,

 socketTimeoutMillis=2000"/>

 

<cache name="<theClass>"

        maxElementsInMemory="10000"

        eternal="false"

        timeToIdleSeconds="300"

        timeToLiveSeconds="600"

        overflowToDisk="true">

 

        <cacheEventListenerFactory

            class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>

     </cache>

 

On logos settings are :

 

<cacheManagerPeerProviderFactory

 class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"

 properties="peerDiscovery=automatic, multicastGroupAddress=230.0.0.1,

 multicastGroupPort=4446, timeToLive=32"/>

 

 <cacheManagerPeerListenerFactory

 class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"

  properties="hostName=logos, port=40001,

socketTimeoutMillis=2000"/>

 

<cache name="<theClass>"

        maxElementsInMemory="10000"

        eternal="false"

        timeToIdleSeconds="300"

        timeToLiveSeconds="600"

        overflowToDisk="true">

 

        <cacheEventListenerFactory

            class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>

     </cache>

 

I get the following exception a few min. after the servers start up

 

WARN [Replication Thread] RMIAsynchronousCacheReplicator.flushReplicationQueue(324) | Unable to send message to remote peer.  Message was: Connection refused to host: 127.0.0.1; nested exception is:

        java.net.ConnectException: Connection refused

java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:

        java.net.ConnectException: Connection refused

        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:574)

        at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)

        at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)

        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:94)

        at net.sf.ehcache.distribution.RMICachePeer_Stub.send(Unknown Source)

        at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator.flushReplicationQueue(RMIAsynchronousCacheReplicator.java:313)

        at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator.replicationThreadMain(RMIAsynchronousCacheReplicator.java:122)

        at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator.access$100(RMIAsynchronousCacheReplicator.java:55)

        at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator$ReplicationThread.run(RMIAsynchronousCacheReplicator.java:372)

Caused by: java.net.ConnectException: Connection refused

        at java.net.PlainSocketImpl.socketConnect(Native Method)

        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)

        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)

        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)

        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)

 

 


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
ehcache-list mailing list
ehcache-list@...
https://lists.sourceforge.net/lists/listinfo/ehcache-list

Re: Distributed cache : Exception Connection refused to host: 127.0.0.1

by gregluck :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Nidhi

On Apollo, if you ping logos what do you get? 127.0.0.1? That is the localhost address so it makes no sense.

Remember that 40001 will be the RMI Registry port. The server will open a new port for each remote object (this can be hardcoded in ehcache 1.5).

You will need to have your firewall accept all ports from 1024 to 65536 for RMI to work properly.

But your first problem is working out why RMI is trying to talk to localhost.

If you have errors in your DNS try removing the hostName= entry. That way ehcache will use the default interface.


On 19/06/2008, at 6:35 AM, <Nidhi.Sharma@...> wrote:

I have the Distributed cache set up for ehcache.
I have 2 servers on the network; apollo and logos .
 
On Apollo ehcache settings are :
<cacheManagerPeerProviderFactory
 class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
 properties="peerDiscovery=automatic, multicastGroupAddress=230.0.0.1,
 multicastGroupPort=4446, timeToLive=32"/>
 
<cacheManagerPeerListenerFactory
  class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
   properties="hostName=apollo, port=40001,
 socketTimeoutMillis=2000"/>
 
<cache name="<theClass>"
        maxElementsInMemory="10000"
        eternal="false"
        timeToIdleSeconds="300"
        timeToLiveSeconds="600"
        overflowToDisk="true">
 
        <cacheEventListenerFactory
            class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>
     </cache>
 
On logos settings are :
 
<cacheManagerPeerProviderFactory
 class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
 properties="peerDiscovery=automatic, multicastGroupAddress=230.0.0.1,
 multicastGroupPort=4446, timeToLive=32"/>
 
 <cacheManagerPeerListenerFactory
 class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
  properties="hostName=logos, port=40001,
socketTimeoutMillis=2000"/>
 
<cache name="<theClass>"
        maxElementsInMemory="10000"
        eternal="false"
        timeToIdleSeconds="300"
        timeToLiveSeconds="600"
        overflowToDisk="true">
 
        <cacheEventListenerFactory
            class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>
     </cache>
 
I get the following exception a few min. after the servers start up
 
WARN [Replication Thread] RMIAsynchronousCacheReplicator.flushReplicationQueue(324) | Unable to send message to remote peer.  Message was: Connection refused to host: 127.0.0.1; nested exception is:
        java.net.ConnectException: Connection refused
java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
        java.net.ConnectException: Connection refused
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:574)
        at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
        at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:94)
        at net.sf.ehcache.distribution.RMICachePeer_Stub.send(Unknown Source)
        at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator.flushReplicationQueue(RMIAsynchronousCacheReplicator.java:313)
        at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator.replicationThreadMain(RMIAsynchronousCacheReplicator.java:122)
        at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator.access$100(RMIAsynchronousCacheReplicator.java:55)
        at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator$ReplicationThread.run(RMIAsynchronousCacheReplicator.java:372)
Caused by: java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
 
 

Regards


Greg Luck


skype: gregrluck
yahoo: gregrluck
mobile: +61 408 061 622




-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
ehcache-list mailing list
ehcache-list@...
https://lists.sourceforge.net/lists/listinfo/ehcache-list

Re: Distributed cache : Exception Connection refused to host: 127.0.0.1

by Nidhi.Sharma :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Thanks Greg, I removed the hostname entry; now I don’t see any exceptions; but I don’t even see any logs for EHCache; also I tried to verify cache replication;

 

I created an object; I see it on Apollo as <tomcat>/temp/XML file but I don’t see it on logos.

 

From: Greg Luck [mailto:gluck@...]
Sent: Wednesday, June 18, 2008 9:47 PM
To: Nidhi Sharma
Cc: ehcache-list@...
Subject: Re: Distributed cache : Exception Connection refused to host: 127.0.0.1

 

Nidhi

 

On Apollo, if you ping logos what do you get? 127.0.0.1? That is the localhost address so it makes no sense.

 

Remember that 40001 will be the RMI Registry port. The server will open a new port for each remote object (this can be hardcoded in ehcache 1.5).

 

You will need to have your firewall accept all ports from 1024 to 65536 for RMI to work properly.

 

But your first problem is working out why RMI is trying to talk to localhost.

 

If you have errors in your DNS try removing the hostName= entry. That way ehcache will use the default interface.

 

 

On 19/06/2008, at 6:35 AM, <Nidhi.Sharma@...> wrote:



I have the Distributed cache set up for ehcache.

I have 2 servers on the network; apollo and logos .

 

On Apollo ehcache settings are :

<cacheManagerPeerProviderFactory

 class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"

 properties="peerDiscovery=automatic, multicastGroupAddress=230.0.0.1,

 multicastGroupPort=4446, timeToLive=32"/>

 

<cacheManagerPeerListenerFactory

  class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"

   properties="hostName=apollo, port=40001,

 socketTimeoutMillis=2000"/>

 

<cache name="<theClass>"

        maxElementsInMemory="10000&