[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 
[Expert]
Messages posted by: pomelko  XML
Profile for pomelko -> Messages posted by pomelko [13]
Author Message
Yes it is. More details here

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

http://terracotta.org/documentation/4.0/terracotta-server-array/high-availability#77332

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

l2.l1reconnect.enabled
l2.l1reconnect.timeout.millis

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,
Paweł
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
<logs>/usr/local/terracotta/client-logs/%(user.dir)</logs>
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:

Code:
 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
 log4j.logger.com.tc.tcsession.ROOT=INFO,fileLogApp
 


but the log file is not created.
Hi,

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:

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


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

Code:
 public class Product implements IProduct {
 
 	private static final long serialVersionUID = 8439118773143689889L;
 
 	private long id;
 	
 	@Override
 	public long getId() {
 		return id;
 	}
 
 	@Override
 	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:

Code:
 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,
Paweł
Hi,

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
Paweł
Hi,

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

Code:
 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!

Code:
 GlobalServerMapGetSizeRequestsCount
 GlobalServerMapGetSizeRequestsRate
 GlobalServerMapGetValueRequestsCount
 GlobalServerMapGetValueRequestsRate
 CacheHitRatio
 


Munin plugins config (if it helps):

Code:
 service:jmx:rmi:///jndi/rmi://terracotta-server-host:9910/jmxrmi
 
 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:
Code:
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?
Hello,

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

Code:
 <cache name="myCache"
        maxElementsInMemory="1"
        maxElementsOnDisk="30000"
        timeToLiveSeconds="1200">
 	<terracotta>
 		<nonstop timeoutMillis="10000">
 			<timeoutBehavior type="noop" />
 		</nonstop>
 	</terracotta>
 </cache>
 


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