[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: dominus  XML
Profile for dominus -> Messages posted by dominus [9]
Author Message
Hi Folks!


We are interested in use of BigMemoryGo for our application, but we are uncertain of whether BigMemoryGo licence supports our use case. We have:
- one Terracotta Server (open source version)
- two instances of application which are using EHcache each running on different Tomcat server. We use Terracotta with EHcache for distributed cache and for clustering of HTTP sessions.


We are uncertain whether we can use Terracotta with BigMemoryGo for having similar set up:
- one Terracotta server
- two Tomcat instances with application using BigMemoryGo (distributed cache)


Is this usecase supported by a BigMemoryGo licence or should we consider BigMemoryMax instead?


Regards
Marek Dominiak

Some additional information:

We are using:
- Terracotta 3.5.4 (Express)
- Spring 3.1.0
- Spring Security 3.1.0
- Spring WebFlow 2.3.0
- Tomcat 6.0.35 (two nodes)

As we understand, Terracotta Express does not need any additional configuration (enabling TIM-modules, adding configuration related to DSO) to enable clustering of SpringSecurity/SpringWebFlow. Is that correct?

Terracotta config:
Code:
 <?xml version="1.0" encoding="UTF-8"?>
 <tc:tc-config xmlns:tc="http://www.terracotta.org/config"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.terracotta.org/schema/terracotta-4.xsd">
 
 <tc-properties>
     <property name="l2.db.factory.name" value="com.tc.objectserver.storage.derby.DerbyDBFactory" />
 
     <!-- Terracotta Server (L1) -> Terracotta Client (L2) -->
     <property name="l1.healthcheck.l2.ping.enabled" value="true" />
     <property name="l1.healthcheck.l2.ping.idletime" value="5000" />
     <property name="l1.healthcheck.l2.ping.interval" value="1000" />
     <property name="l1.healthcheck.l2.ping.probes" value="3" />
     <property name="l1.healthcheck.l2.socketConnect" value="true" />
     <property name="l1.healthcheck.l2.socketConnectTimeout" value="5" />
     <property name="l1.healthcheck.l2.socketConnectCount" value="10" />
 
     <!-- Terracotta Client (L2) -> Terracotta Server (L1) -->
     <property name="l2.healthcheck.l1.ping.enabled" value="true" />
     <property name="l2.healthcheck.l1.ping.idletime" value="5000" />
     <property name="l2.healthcheck.l1.ping.interval" value="1000" />
     <property name="l2.healthcheck.l1.ping.probes" value="3" />
     <property name="l2.healthcheck.l1.socketConnect" value="true" />
     <property name="l2.healthcheck.l1.socketConnectTimeout" value="5" />
     <property name="l2.healthcheck.l1.socketConnectCount" value="10" />
 </tc-properties>
 
   <system>
     <configuration-model>production</configuration-model>
   </system>
   <servers>
    <server name="localhost" host="localhost">
       <data>%(user.home)/terracotta35/server-data</data>
       <logs>%(user.home)/terracotta35/server-logs</logs>
       <statistics>%(user.home)/terracotta35/server-statistics</statistics>
       <dso-port>9510</dso-port>
       <jmx-port>9520</jmx-port>
       <index>%(user.home)/terracotta35/server-data/index</index>
       <dso>
        <client-reconnect-window>120</client-reconnect-window>
         <persistence>
           <mode>temporary-swap-only</mode>
         </persistence>
         <garbage-collection>
           <enabled>true</enabled>
           <verbose>false</verbose>
           <interval>3600</interval>
         </garbage-collection>
       </dso>
     </server>
 </servers>
   <clients>
     <logs>%(user.home)/terracotta35/client-logs%D</logs>
   </clients>
   <application>
     <dso>
       <web-applications>
         <web-application>webapp</web-application>
       </web-applications>
      </dso>
   </application>
 </tc:tc-config>
 




Regards
Marek Dominiak
Hi Dear Terracotta forum,

In short:
____________________________________________________________________
My question is: How should configuration for clustering Spring WebFlow/Security for Terracotta Express look like? (We have problems with finding documentation/examples/anything).
____________________________________________________________________

A little bit longer:
____________________________________________________________________
It seems that this question is still unanswered (see http://forums.terracotta.org/forums/posts/list/6143.page), so I will repeat it. We need this reply desperately...

1. SpringWebFlow issues: when I am taking down one server on which one user was inside a flow (spring web flow) and after the other server will take over, the user will get an exception after next request inside in a flow (first one which is going to the second server). Which looks like that spring-web-flow is not clustered.

2. SpringSecurity issues: it seems that SessionRegistry is not clustered. With only one server it is impossible to log in to our application from two different browsers (one of the sessions will be invalidated). But when running two nodes, it is sometimes possible to do that -> Probably SessioRegistry on first node knows nothing about the SessionRegistry on the other instance. Which implies that Security related beans are not clustered.

My questions are:
1. How should configuration for clustering Spring WebFlow/Security for Terracotta Express look like?
2. How can we verify that Spring bean are clustered? Can we user Terracotta Developer console to do that?
3. Where can I find any working example (or documentation) of clustering Spring based application for Terracotta Express (Standard). The only resource I could find was this:
http://docs.terracotta.org/confluence/display/docs35/Clustering+the+Spring+Framework
but this is related to Terracotta DSO which we are not using.
4. Is it possible to enable some debugging information in Terracotta which will show me what modules are enabled and what is actually clustered?
____________________________________________________________________

Any input and ideas are welcome!

Best regards
Marek Dominiak
Hi,

I'm using Terracotta 3.5.4 (Standard) and Spring (Spring Security, Spring Web Flow) in our application. I would like to clarify the issue of clustering Spring Security and SpringWebFlow. My current configuration is not working and I don't know how to find what is wrong.

When I am taking down one server on which one user was inside a flow (spring web flow) and after the other server will take over, the user will get an exception after next request inside in a flow (first one which is going to the second server). Which looks like that spring-web-flow is not clustered.

This is my current configuration. Could you tell me what is wrong with this configuration (what is missing)?

<?xml version="1.0" encoding="UTF-8"?>
<tc:tc-config xmlns:tc="http://www.terracotta.org/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.terracotta.org/schema/terracotta-4.xsd">

<tc-properties>
<property name="l2.db.factory.name" value="com.tc.objectserver.storage.derby.DerbyDBFactory" />
</tc-properties>

<system>
<configuration-model>production</configuration-model>
</system>
<servers>
<server name="localhost" host="localhost">
<data>%(user.home)/terracotta35/server-data</data>
<logs>%(user.home)/terracotta35/server-logs</logs>
<statistics>%(user.home)/terracotta35/server-statistics</statistics>
<dso-port>9510</dso-port>
<jmx-port>9520</jmx-port>
<index>%(user.home)/terracotta35/server-data/index</index>
<dso>
<client-reconnect-window>120</client-reconnect-window>
<persistence>
<mode>temporary-swap-only</mode>
</persistence>
<garbage-collection>
<enabled>true</enabled>
<verbose>false</verbose>
<interval>3600</interval>
</garbage-collection>
</dso>
</server>
</servers>
<clients>
<logs>%(user.home)/terracotta35/client-logs%D</logs>
</clients>
<application>
<dso>
<web-applications>
<web-application>webapp</web-application>
</web-applications>
</dso>
</application>
</tc:tc-config>

Regards
Marek Dominiak
Dear Terracotta Forum,


We are working with integrating our existing Spring/Hibernate/Lucene/HibernateSearch based application to the cluster environment with help of Terracotta (standard). Most of our problems are solved now but some load testing showed us that we are not yet prepared to go into production with our changes.

We have troubles with a good strategy to cluster our Lucene index. We were trying to use simplest solution for now (only one Lucene index stored on the NFS shared among all of the nodes), it was a good match for us because our application relies on Index being synchronized all the time between nodes. Unfortunatelly some load-testing showed us that our Index can be corrupted very easy with 10-15 concurrent users writing to the Index. We stumbled upon problems related to Locking Lucene Index.


We would like ask you what is the optimal Lucene index clustering strategy for these requirements:
- we need our index be allways up to date on all nodes (master-slave strategy from hibernate-search docs is not good for us because of this point)
- we would like to use a strategy which matches our application stack, that is: Hibernate 3.6.4, Hibernate Search 3.5.0, Lucene 3.1, Terracotta 3.5.4,
-the best would be if we don't have to add any big libraries for this purpose
- our Lucene index is about 10-15GB big and will grow with the time


We have read quite a lot about clustering of Lucene but it is really hard to make a decision which will be optimal for ours requirements.

For now I can see a couple of different solutions but everyone of them looks like not a good match:
1. Use Inifinispan as DirectoryProvider - we don't what to include Infinispan to our application because we are already using Terracotta for our 2nd level cache and it seems that the same stuff should be possible to do in Terracotta (or maybe this is ok to do?)
2. Use Compass for clustering Lucene index - we are already using HibernateSearch extensively in our application and we don't see reason why we should include library which is a competitor to HibernateSearch (or maybe this is ok to do?)
3. Use some other solution e.g. home-made - http://linhtech.wordpress.com/2010/10/06/hibernate-search-clustering-with-jms-topic-implementation/ - it is always a little bit hard to tell whether this kind of solution will work for us
4. Are there any more solutions?

What are your experience with clustering Lucene index with Terracotta based cluster application?
What would you recommend for us?


Regards
Marek Dominiak
Thank you very much for all links and clarification about versioning.


Regards
Marek Dominiak
Hi,

Is there possibility to see the documentation for terracotta 3.5.4 and ehcache 2.4.7 ?

On main pages I can see only the documentation for the newest version which we cannot use at the moment for our application. We would like to find the documentation for all ehcache cache properties and their meaning in distributed cache cluster.

Thank you in advance for any links/tips pointing to the documentation for terracotta 3.5.4 and ehcache 2.4.7 .


Regards
Marek Dominiak
Thank you very much for your prompt response!
Your suggestion helped me to get up and run my server.


I still have a minor issues though: In server logs I see a NPE every second (the application is working though):

This is a stacktrace:

ERROR ProviderMBeanRegistrationHelper - Error locating Hibernate Session Factory
java.lang.NullPointerException
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:36)
at sun.reflect.UnsafeQualifiedObjectFieldAccessorImpl.get(UnsafeQualifiedObjectFieldAccessorImpl.java:20)
at java.lang.reflect.Field.get(Field.java:358)
at org.hibernate.cache.ehcache.management.impl.ProviderMBeanRegistrationHelper$RegisterMBeansTask.locateSessionFactory(ProviderMBeanRegistrationHelper.java:152)
at org.hibernate.cache.ehcache.management.impl.ProviderMBeanRegistrationHelper$RegisterMBeansTask.run(ProviderMBeanRegistrationHelper.java:117)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)


It looks like the MBean for Hibernate cannot be created , so I probably can't look at statistics in Terracotta Developer Console for Hibernate.

- Could it be because of my Hibernate/Ehcache/JPA2.0/Terracotta config?
- Is it ok to use ehcache 2.5.0 with Hibernate 4.0.1.Final
- Is it ok to use Terracotta 3.6 with ehcache 2.5.0 and Hibernate 4.0.1.Final
- Can I ignore the MBean registration failure and expects that everything else is working?

My config is here:

pom.xml:

...
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.2.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<exclusions>
<exclusion>
<groupId>org.hibernate</groupId>
<artifactId>ejb3-persistence</artifactId>
</exclusion>
</exclusions>
<version>4.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.0.1.Final</version>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.0.1.Final</version>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
<version>4.0.1.Final</version>
<exclusions>
<exclusion>
<artifactId>ehcache-core</artifactId>
<groupId>net.sf.ehcache</groupId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<artifactId>ehcache-core</artifactId>
<groupId>net.sf.ehcache</groupId>
<version>2.5.0</version>
</dependency>

<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-terracotta</artifactId>
<version>2.5.0</version>
</dependency>

<dependency>
<groupId>org.terracotta</groupId>
<artifactId>terracotta-toolkit-1.4-runtime</artifactId>
<version>4.0.0</version>
</dependency>
...


persistence.xml:
...
<property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.ehcache.EhCacheRegionFactory"/>
<property name="hibernate.cache.use_second_level_cache" value="true" />
<property name="hibernate.cache.use_structured_entries" value="true" />
<property name="hibernate.cache.use_query_cache" value="true" />
....


I hope you can help me.

Regards
Marek Dominiak
Hi,

I am intrested in using Terracotta but it seems that in our application we are using Hibernate 4.0.0.Final which i suspect is not (yet) working with newest Terracotta.

Is there any way of integrating Hibernate 4.0.0.Final and Terracotta distributed cache?

Now when starting application I get an exception which tells me that terracotta would like to use class from Hibernate which does not exist anymore. I hope someone can help me with this problem.


_______________________________________
Caused by: java.lang.NoClassDefFoundError: org/hibernate/cache/CacheProvider
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:295)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:138)
at org.hibernate.cfg.SettingsFactory.createRegionFactory(SettingsFactory.java:386)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:251)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2270)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2266)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1735)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:84)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:889)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:257)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
... 51 more
_______________________________________



Regards
Marek Dominiak
 
Profile for dominus -> Messages posted by dominus [9]
Go to:   
Powered by JForum 2.1.7 © JForum Team