Monthly Archives: March 2012

Enterprise Tomcat

Overview

Tomcat Enterprise (tc Server) is a Web application server based on open-source Apache Tomcat. It preserves the best of Tomcat and adds many mission-critical operational capabilities that are unavailable in the open-source product. tc Server requires significantly fewer resources than conventional servers, which allows for greater server density in virtual and cloud environments.

Features

1-    All standard features as Apache Tomcat(including clustering for Scalability and Failover)
2-    Multiple runtime instances from a single binary installation
3-    New high-concurrency JDBC connection pool
4-    Preconfigured for JMX management
5-    Binary patch updates
6-    Unix boot scripts
7-    Enhanced Windows service wrapper
8-    Templated production-ready configuration out-of-the-box.
3-    Easy creation of multiple runtime instances using tcruntime-instance command script
5-    tc Runtime includes advanced, distributed management and monitoring capabilities through a centralized management console called Hyperic user interface

Environment Setup ( Ubuntu 11.10)

This setup assumes installation of Hyperic user interface for centralized management. Hyperic has a server and many agents. Hyperic Server can be on any tc cluster node or on a separate server where as each tc server node needs to have one Hyperic agent installed.

We choose /home/tcserver as installation location of tc server instances and /home/hyperic as location of Hyperic server and agents.

1-         Install java  

apt-get install openjdk-6-jdk  

        
2-         Set JAVA_HOME environment variable
3-         Setting users and groups for TC Server and Hyperic
           

addgroup spring
adduser --ingroup srping tcserver
adduser --ingroup srping hyperic

4-         Enabling Hyperic Agent Access to su or sudo
            a)         If Hyperic Agent is running as root
                       

sudo ln -s /sbin/su /bin/su

            b)         If Hyperic Agent is running as a non-root user
                       

sudo ln -s /usr/sbin/sudo /bin/sudo

            The user running Hyperic Agent needs permission to run the tcruntime-ctl.sh script as the tc Server user without having to enter a password. This is accomplished by editing the /etc/sudoers file as root and adding an entry. For example, if Hyperic Agent is running as user hyperic, tc Server runtime instances are running as user tcserver, and the tcruntime-ctl.sh script is in /home/tcserver/vfabric-tc-server-standard-2.6.3.RELEASE/tcruntime-ctl.sh, you would add the following entry to /etc/sudoers:

hyperic ALL=(tcserver) NOPASSWD: /home/tcserver/vfabric-tc-server-standard-2.6.3.RELEASE/tcruntime-ctl.sh

Installing tc Server

1-         Download tomcat enterprise archive from VMware website
           

vfabric-tc-server-standard-2.6.X.RELEASE.zip

2-         Create a directory for the tc Server installation(if not exists already).

           
mkdir /home/tcserver
chown -R tcserver:spring /home/tcserver

3-         Extract the tc Server distribution file into the new directory.
           

prompt$ cd /home/tcserver
prompt$ unzip vfabric-tc-server-standard-2.6.0-RELEASE.zip

4-         Creating tc Runtime Instances: Typical Steps

          
cd /home/tcserver/vfabric-tc-server-standard-2.6.0-RELEASE
./tcruntime-instance.sh create myserver

5-         Edit CATALINA_HOME/bin/init.d.sh , locate the line TC_RUNTIME_USER="tc-server" and set the the user you want to run tc Server as, in this case, ‘tcserver’
so it now looks TC_RUNTIME_USER="tcserver"

6-         Install the init.d.sh script in the /etc/init.d directory using a command like the following:
           

ln -s CATALINA_HOME/bin/init.d.sh /etc/init.d/myserver
/etc/init.d/myserver start|stop|restart|status

7-         Don’t forget to edit CATALINA_HOME/conf/Catalina.properties as per your needs e.g HTTP port etc

Installing the Hyperic Agent and Server

Hyperic is a performance management tool that provides visibility into applications and infrastructure across physical, virtual, and cloud environments. It consolidates discovery, monitoring, analysis and control of application, system, and network assets.

1-         Set HQ_JAVA_HOME environment variable
2-         Create a directory for the Hyperic installation(if not exists).

/home/hyperic
chown -R hyperic:spring /home/hyperic
su - hyperic
PathToInstaller/setup.sh –mode

Follow the instruction at http://pubs.vmware.com/vfabric5/index.jsp?topic=/com.vmware.vfabric.tc-server.2.6/getting-started/install.html

Note: Better to run everything as a single user – easy admin, no permission issues. Also better to give chmod g+rw cat_base if you experience any permissions issues.

Clustering for High Availability and Scalability

Clustering refers to grouping one or more tc Runtime instances so that they appear to work as a single server. A cluster provides Session Replication and Context Attribute Replication.

A tc Runtime cluster can be as small as two server instances hosted on the same computer to hundreds of tc Runtime instances hosted on many different computers of different operating systems.

Typically, tc Runtime cluster uses multicast for the communication between member servers. The cluster is then uniquely identified by the combination of its multicast IP address and port. Each member of the cluster must have the same multicast address and port configured so that the cluster can automatically discover each member and react appropriately if a member does not respond.

 

Create a tc Server cluster nodes 

tc Server provides a pre-packaged configuration template for clustering

1-   

cd /home/tcserver/vfabric-tc-server-standard-2.6.0-RELEASE

2-

./tcruntime-instance.sh create node1 –template cluster-node –version 6.0.35.A.RELEASE

Using cluster-node config template adds <cluster> element in server.xml

3-    Repeat step 2 for as many nodes you want to create whether on a single system or many over a network.
Remember to change http port if you are creating many nodes on single machine as default value is 8080. Also, node name has to be unique across a cluster whether its on a single machine or over a network. Edit these values in CATALINA_HOME/conf/Catalina.properties

Don’t forget

1-    Prepare Web applications so they can be deployed to a cluster and take full advantage of the tc Runtime clustering features
2-    Be sure that network is correctly configured to enable multicast, which is the typical method of communication between cluster members..
3-    Start cluster by starting all the tc Runtime instances that make up the cluster group.
4-    All-to-all session replication is not recommended for big clusters

Refer to “Tomcat 6 Clustering for further details

Array ( [marginTop] => 100 [pageid] => @techish1 [alignment] => left [width] => 292 [height] => 300 [color_scheme] => light [header] => header [footer] => footer [border] => true [scrollbar] => scrollbar [linkcolor] => #2EA2CC )