Tuesday, April 24, 2007

Terracotta on FC6

Terracota makes clustering simpler by providing a shared VM concept, where the application programmer need not worry about any kind of clustering API's and assume that her code will be executed across multiple JVMs. Its a novel approach for clustering any application without the need of changing much code.

Its driven by a XML based configuration file called tc-config.xml file which can control the classes you want to share across multiple JVM. By sharing it is not the usual serialized way of sharing, instead Terracotta sends the difference between the objects and thus is more efficient.
The sample applications provided with Terracotta are very neat and show the power of Terracotta and it just works out of the box. While I was trying to download Terracotta on my Mac, I did not see any Mac binaries in the download page. I remember seeing the demos in different videos [1] used Mac. Ofcourse it is based on Java and it will work on Mac, but I was annoyed to see only three links when I clicked on the download link. Later I found out that it has been fixed with the new version 2.3-stable1 build which is a generic build and can be used in most unix like platform. Its available as a separate tab in the download page and was hard to notice. I did download the generic 2.3-stable version and got it working without any problems. I had to set my JAVA_HOME to /System/Library/Frameworks/JavaVM.framework/Home/


I dual boot Mac and Linux FC6 - unfortunately I have a few issues in Linux (battery, hibernate and sound related) and have to boot in Mac quite often. But being a Linux fan and with Terracotta giving me a reason to boot into my Linux again, I booted in FC6 got all the Linux binaries - the three binaries listed in the download site (DSO, Spring and Session). Untarred them to a terrocotta directory and ran the demos. For a start DSO is good and untarring that alone would be better.

#bash# cd terracotta/terracotta-2.2.1/dso/bin
#bash# ./tc-welcome.sh

FC6 has some issues with 3d Desktop effects and swing. The swing applications like JTable demo did not show up and it was not because of Terracotta - any swing application in FC6 did not work. I thought it was related to gcj java and I tried to remove all the gcj related packages. While removing gcj, I had to loose almost all the important packages like eclipse and open office which are dependent on libgcj. After loosing all my good applications, I tried running Terracotta again and still saw the same blank JTable frame. Then I had to google to find the solution to the problem and then I discovered that it was the 3d desktop effects (XGL) that was causing the problem. I was using Jdk 1.6 and it seems that the issue has been fixed in a newer jdk. For now I am happy running my swing applications without the 3d desktop! The JTable application and the Shared editor application worked just as shown in the video [1] and the introductory video at Terracotta.com.

Overall I was really impressed by the product. As with any rapidly developed open source (or commercial product) the documentation was really scattered around and there were lot of things to read.

[1] Google Video - Terracotta presentation