[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Messages posted by: pomelko  XML
Profile for pomelko -> Messages posted by pomelko [13]
Author Message
Yes it is. More details here

End of story.
I guess that you have already read this


As you can see, you have to set two terracotta properties:


to enable reconnection. If it's done, make sure that timeout you set is long enought. Because if is to short, client can't rejoin the cluster and have to be restarted.

I had this problem couple days ago. I changed timeout from 5000 to 30000.

I hope that it helps.
Is synchronousWrite param available in Terracotta 3.5.4 as described here? (terracotta-session 1.1.2)

I guess that not (I can't find it in Terracotta 3.5.3 documentation, but I just want to make sure.

Thanks in advance,
make sure that tomcat has permission to create dir in /usr/local/terracotta/client-logs

You can also use %(user.dir) property in dir definition
Is .tc.custom.log4j.properties available in Terracotta 3.5.4 as described here?

I already created .tc.custom.log4j.properties file (in user.home) as follow:

 log4j.appender.fileLogApp = org.apache.log4j.DailyRollingFileAppender
 log4j.appender.fileLogApp.File = /tmp/terracotta.log
 log4j.appender.fileLogApp.layout= org.apache.log4j.PatternLayout
 log4j.appender.fileLogApp.layout.ConversionPattern=%d %5p %c:%L %x - %m%n
 log4j.appender.fileLogApp.DatePattern = .yyyy-MM-dd

but the log file is not created.

We are using open-source Terracotta Server Array (3.5.4) as Distributed Cache. Webapps with ehcache are terracotta clients (deployed on Tomcats 6.0.20). In ehcache.xml we have defined cache region as follow:

 <cache name="cache.region" maxElementsInMemory="1" maxElementsOnDisk="30000" timeToLiveSeconds="600">
 		<nonstop timeoutMillis="10000">
 			<timeoutBehavior type="noop"/>

We are puting Product objects to that region. Here is a Product class definition:

 public class Product implements IProduct {
 	private static final long serialVersionUID = 8439118773143689889L;
 	private long id;
 	public long getId() {
 		return id;
 	public void setId(long id) {
 		this.id = id;		
 import java.io.Serializable;
 public interface IProduct extends Serializable {
 	long getId();
 	void setId(long id);

When we do some changes in class Product, and then deploying it on Tomcat, an exception occure when we are trying get object from cache:

 Aug 22 00:02:03 net.sf.ehcache.CacheException: java.lang.AssertionError: java.io.InvalidClassException: IProduct; local class incompatible: stream classdesc serialVersionUID = -57040766891247554, local class serialVersionUID = -3776498516536327490
 Aug 22 00:02:03 at net.sf.ehcache.constructs.nonstop.NonstopExecutorServiceImpl.execute(NonstopExecutorServiceImpl.java:96)
 Aug 22 00:02:03 at net.sf.ehcache.constructs.nonstop.store.ExecutorServiceStore.executeWithExecutor(ExecutorServiceStore.java:158)
 Aug 22 00:02:03 at net.sf.ehcache.constructs.nonstop.store.ExecutorServiceStore.executeWithExecutor(ExecutorServiceStore.java:127)
 Aug 22 00:02:03 at net.sf.ehcache.constructs.nonstop.store.ExecutorServiceStore.containsKeyInMemory(ExecutorServiceStore.java:720)
 Aug 22 00:02:03 at net.sf.ehcache.constructs.nonstop.store.NonstopStoreImpl.containsKeyInMemory(NonstopStoreImpl.java:287)
 Aug 22 00:02:03 at net.sf.ehcache.Cache.searchInStoreWithStats(Cache.java:1881)
 Aug 22 00:02:03 at net.sf.ehcache.Cache.get(Cache.java:1546)

Everything is back to normal after cache cleaning - cache.removeAll().

And now I have few questions:

1) Why there is an interface name (IProduct) in exception message instead of implementation (Product)?
2) Why both serialVersionUID from an exception, doesn't correspond with one defined in Product class?
3) Is there any automatic way to invalidate object in Terracotta after implementation changes, to prevent described exception?

Thanks in advance,

We are using open-source Terracotta Server Array (3.5.4) as java sessions store (using WebSessions, configured in Tomcat context.xml <Valve className="org.terracotta.session.TerracottaTomcat60xSessionValve" tcConfigUrl="localhost:9510">; more details here)

I guess that by default WebSessions write sessions to Terracotta asynchronously (and I don't want to use synchronousWrite params, becouse of performence). I found out that some changes on session are lost during Tomcat restart. Is it possible to make sure that all of changes are flushed from Tomcat to Terroctta, before Tomcat restart?

Thanks in advance

It's looks like there is still problem with mbean registration:

 Exception in thread "cacheManager" java.lang.NullPointerException
 	at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:922)
 	at org.hibernate.internal.SessionFactoryRegistry.getSessionFactory(SessionFactoryRegistry.java:140)
 	at org.hibernate.internal.SessionFactoryRegistry.getNamedSessionFactory(SessionFactoryRegistry.java:135)
 	at org.hibernate.cache.ehcache.management.impl.ProviderMBeanRegistrationHelper$RegisterMBeansTask.locateSessionFactory(ProviderMBeanRegistrationHelper.java:143)
 	at org.hibernate.cache.ehcache.management.impl.ProviderMBeanRegistrationHelper$RegisterMBeansTask.run(ProviderMBeanRegistrationHelper.java:117)
 	at java.util.TimerThread.mainLoop(Timer.java:555)
 	at java.util.TimerThread.run(Timer.java:505)

The issue you reported as https://hibernate.atlassian.net/browse/HHH-7562 is already fixed in Hibernate 4.1.7.

I'm using Hibernate 4.1.10 and the problem still occur.

It seems like registration is invoked too soon, and there is no sessionFactory in SessionFactoryRegistry map.

Comment added in https://hibernate.atlassian.net/browse/HHH-7518
Basically I wish to monitor as many statistic as we can. So could you describe me all of them (available via JMX)? Or give me a page address where it is already described? Thanks in advance!
Terracotta server expose several statistic via JMX. Could somebody explain me some of them (below)? Thanks in advance!


Munin plugins config (if it helps):

 graph_title Terracotta - ServerMapGetSizeRequestsRate
 graph_vlabel Rate
 graph_category terracottastats
 terracotta_global_server_map_get_size_requests_rate.label GlobalServerMapGetSizeRequestsRate
 terracotta_global_server_map_get_size_requests_rate.jmxObjectName org.terracotta:type=Terracotta Server,name=DSO
 terracotta_global_server_map_get_size_requests_rate.jmxAttributeName GlobalServerMapGetSizeRequestsRate
 terracotta_global_server_map_get_size_requests_rate.type GAUGE
 graph_title Terracotta - ServerMapGetSizeRequestsCount
 graph_vlabel Count
 graph_category terracottastats
 terracotta_global_server_map_get_size_requests_count.min 0
 terracotta_global_server_map_get_size_requests_count.label GlobalServerMapGetSizeRequestsCount
 terracotta_global_server_map_get_size_requests_count.jmxObjectName org.terracotta:type=Terracotta Server,name=DSO
 terracotta_global_server_map_get_size_requests_count.jmxAttributeName GlobalServerMapGetSizeRequestsCount
 terracotta_global_server_map_get_size_requests_count.type DERIVE
 graph_title Terracotta - ServerMapGetValueRequestsRate
 graph_vlabel Rate
 graph_category terracottastats
 terracotta_global_server_map_get_value_requests_rate.label GlobalServerMapGetValueRequestsRate
 terracotta_global_server_map_get_value_requests_rate.jmxObjectName org.terracotta:type=Terracotta Server,name=DSO
 terracotta_global_server_map_get_value_requests_rate.jmxAttributeName GlobalServerMapGetValueRequestsRate
 terracotta_global_server_map_get_value_requests_rate.type GAUGE
 graph_title Terracotta - ServerMapGetValueRequestsCount
 graph_vlabel Count
 graph_category terracottastats
 terracotta_global_server_map_get_value_requests_count.min 0
 terracotta_global_server_map_get_value_requests_count.label GlobalServerMapGetValueRequestsCount
 terracotta_global_server_map_get_value_requests_count.jmxObjectName org.terracotta:type=Terracotta Server,name=DSO
 terracotta_global_server_map_get_value_requests_count.jmxAttributeName GlobalServerMapGetValueRequestsCount
 terracotta_global_server_map_get_value_requests_count.type DERIVE
 graph_title Terracotta - CacheHitRatio
 graph_vlabel Hit Ratio
 graph_category terracottastats
 terracotta_cache_hitratio.label CacheHitRatio
 terracotta_cache_hitratio.jmxObjectName org.terracotta:type=Terracotta Server,name=DSO
 terracotta_cache_hitratio.jmxAttributeName CacheHitRatio
 terracotta_cache_hitratio.type GAUGE
When maxElementsInMemory is set to 0, there is a some warnings in logs:
Cache: CACHE_NAME has a maxElementsInMemory of 0. In Ehcache 2.0 this has been changed to mean a store with no capacity limit. Set it to 1 if you want no elements cached in memory

This is what I done, I set maxElementsInMemory to 1. So why I found cache.getMemoryStoreSize() with value greater then 1 (407)?
Thanks for your reply, but I need to know how it works in Ehcache 2.4.7.

Is it possible to store all elements in L2 (TSA), instead of L1?

Can some one else answer my question?

In ehcache 2.4.7 + terracotta 3.5.4 I have cache configuration as follow:

 <cache name="myCache"
 		<nonstop timeoutMillis="10000">
 			<timeoutBehavior type="noop" />

I expected that all elements (except one) will be stored in L2 (terracotta server). So I was supprised when in cache statistics I found

cache.getStatistics().getObjectCount() = 3769
cache.getStatistics().getDiskStoreObjectCount() = 3769
cache.getStatistics().getMemoryStoreObjectCount() = 407

Can somebody explain me this?

PS. What I need is to store all elements in L2 (TSA), instead of L1 (local app memory).

Thanks for help.
Profile for pomelko -> Messages posted by pomelko [13]
Go to:   
Powered by JForum 2.1.7 © JForum Team