Thursday, September 23, 2010

Terracotta EhCache 3.3 Installation

The installation steps are for RHEL 5

1) Create user
#useradd -m cacheadm
#passwd cacheadm
Login an cacheadm

2) Install Java environment
Download JDK 1.6 update latest from 
http://java.sun.com/javase/downloads/index.jsp
Copy to /opt or install folder
#./jdk-6u21-linux-i586.bin
This should install Java under directory jdk1.6.0_21
Note: You can also install JRE alone the same way. JDK comes with utilities such as jar, jconsole, jstack are not available in JRE

3) Set Java runtime
Edit your profile file to set system runtime variables.
# vi /home/cacheadm/.bash_profile
Update your profile file to read as the following.
# cat /home/jbossadm/.bash_profile
PATH=$PATH:$HOME/bin
JAVA_HOME=/opt/jdk1.6.0_21
export PATH=$JAVA_HOME/bin:$PATH

Exit the shell and re-login for the changes to take effect

4) Verify Java path and version
#which java
#java -version

5) Install Terracotta Distribute Cache
Download terracotta-3.3.0-ee-installer.jar from http://www.terracotta.org/
Copy to /opt or install folder
# export DISPLAY={ip}:0.0
# java -jar terracotta-3.3.0-ee-installer.jar
Set the installation path as /opt/terracotta/terracotta-3.3.0-ee
Complete the installation
Download the license key from Terracotta website and copy it to /opt/terracotta/terracotta-3.3.0-ee directory.

6) Update ~/.bash_profile file
JAVA_HOME=/opt/jdk1.6.0_21
TERRACOTTA_HOME=/opt/terracotta/terracotta-3.3.0-ee
export PATH=$JAVA_HOME/bin:$TERRACOTTA_HOME/bin:$PATH
7) Start Terracotta
Java home is not properly recoginzed the start script. I edited $TERRACOTTA_HOME/bin/start-tc-server.sh and added JAVA_HOME at the beginning.
JAVA_HOME=/opt/jdk1.6.0_21

Execute ./start-tc-server.sh

If the license file (product.key) does not exist, the following error will be reported.
2010-09-23 14:13:34,732 INFO - Terracotta Enterprise 3.3.0, as of 20100716-160738 (Revision 7871-15922 by cruise@su10mo5 from 3.3)
2010-09-23 14:13:35,144 INFO - Successfully loaded base configuration from Java resource at '/com/tc/config/schema/setup/default-config.xml', relative to class com.tc.config.schema.setup.StandardXMLFileConfigurationCreator.
2010-09-23 14:13:35,351 INFO - Log file: '/home/cacheadm/terracotta/server-logs/terracotta-server.log'.
2010-09-23 14:13:35,355 FATAL - Product key does not exist at /opt/terracotta/terracotta-3.3.0-ee/bin/./../product.key

On successful start, the following message will  be written.
INFO - Terracotta Server instance has started up as ACTIVE node on 0:0:0:0:0:0:0:0:9510 successfully, and is now ready for work.

8) Launch console
Java home is not properly recoginzed the start script. I edited $TERRACOTTA_HOME/bin/dev-console.sh and added JAVA_HOME at the beginning.
# export DISPLAY={ip}:0.0
Right click on Terracotta cluster and connect/
If you see console with login window, please specify the following
Server host: localhost or server name
JMX port: 9520

9) Setup Cluster Config
Replicate the above steps on each participating server .
Create a file tc-config.xml and copy to /opt/terracotta/config on each server.

<?xml version="1.0" encoding="UTF-8"?>
<!-- All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved. -->
<tc:tc-config xsi:schemaLocation="http://www.terracotta.org/schema/terracotta-5.xsd"
xmlns:tc="http://www.terracotta.org/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 
  <servers>
    <!-- Sets where the Terracotta server can be found. Replace the value of host with the server's IP address. -->
    <server host="{ip}" name="{hostname}">
      <data>/opt/terracotta/server-data</data>
      <logs>/opt/terracotta/server-logs</logs>
    </server>
    <!-- If using a standby Terracotta server, also referred to as an ACTIVE-PASSIVE configuration, add the second server here. -->
    <server host="{ip}" name="{hostname}">
      <data>/opt/terracotta/server-data</data>
      <logs>/opt/terracotta/server-logs</logs>
  </server>
<!-- If using more than one server, add an <ha> section. -->
    <ha>
      <mode>networked-active-passive</mode>
      <networked-active-passive>
        <election-time>5</election-time>
      </networked-active-passive>
    </ha>
  </servers>
  <!-- Sets where the generated client logs are saved on clients. Note that the exact location of Terracotta logs on client machines may vary based on the value of user.home and the local disk layout. --> 
  <clients>
    <logs>/opt/terracotta/client-logs</logs>
  </clients>
</tc:tc-config>

10) Setup ehcache config
Update /opt/terracotta/terracotta-3.3.0-ee/ehcache/ehcache.xml with the following.
     <terracottaConfig url="{server1-ip}:9510,{server2-ip}:9510"/>
11) Start the server
$TERRACOTTA_HOME/bin/start-tc-server.sh -f /opt/terracotta/config/tc-config.xml -n {hostname or alias specified in tc-confg.xml}

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home

Newer›