Prerequisites
You will need:
Terracotta, 3.2
Tomcat, 6 (latest minor revision)
Java, 1.6_17 (recommended or add -XX:+MustCallLoadClassInternal)
Postgresql, 8.4
fping (optional)
Leemba
Preparing Postgres
Login as postgres and run:
create database leemba encoding 'UTF-8';
create user leemba password 'test';
grant all on database leemba to leemba;
Don’t forget, you may also need to give login access to the user leemba from the monitor server in pg_hba.conf.
Unpack
Unpack Terracotta and Tomcat. I have used /opt so all of the below paths will use that, too. In order for the scripts here to work, use the following layout. You can change all of this later but it’s helpful to start from a common base:
/opt/terracotta /opt/terracotta/tomcat
Copy LeembaMonitor.war to the /opt/terracotta/tomcat/webapps folder. Rename to ROOT.war and remove the existing ROOT folder.
Starting the Terracotta server
cd /opt/terracotta
Edit config. Make sure to use the permanent-store mode and remove the second <server> element if not needed. Use the sample tc-config.xml as a starting point if you’re unfamiliar with Terracotta. Otherwise, just make sure to add the <modules> needed to run Leemba.
Next we need to add the TIMs (Terracotta Integration Module) for Leemba. These modify Java code to work on the cluster without changing our source. This also allows us to run the same code off the cluster as on it, so we can test and develop without Terracotta and cluster later. Beware though, that without Terracotta Leemba may lose data during power loss.
cd /opt/terracotta/bin ./tim-get.sh install-for tc-config.xml
Next, copy the compass project jar to the platform/modules directory. The version used by Leemba can be found in the nightly folder.
./start-tc-server.sh
You should see “and is now ready for work” on the console. If there are errors during server startup, check tc-config.xml and the Terracotta documentation.
Starting Tomcat
Download start-tomcat.sh and stop-tomcat.sh and run `./start-tomcat.sh`. By default Tomcat sets up a connector on port 8080. That can be changed in Tomcat’s server.xml. These are copied from the Tomcat scripts with some modifications to add Terracotta. (Please note that due to crappy licensing from Terracotta, there’s an update to the war file in start-tomcat.sh.)
Leemba will ask for the Postgres details and will setup the database and other minimal requirements automatically. If you get stuck, please use the forums.
Happy monitoring!
Trackbacks/Pingbacks
[...] Over at leemba.com I’ve added some posts that I’m using sorta as running notes on how to setup Leemba on Terracotta. [...]