Getting Started with tc Server

tc Server

2.1


Table of Contents

1. Copyright Notice
2. Quick Start Instructions
3. Overview of tc Server
3.1. Features of tc Server
3.2. Comparing tc Runtime and Apache Tomcat
3.3. tc Server Editions
3.4. How tc Server and Hyperic Work Together
3.5. Links to Additional Documentation
4. Release Notes
4.1. New Versioning Process
4.2. What's New and Changed in This Release?
4.3. Supported Configurations
4.4. Restrictions
4.5. Fixed Issues
5. What Are the Main Steps Required to Get Going?
5.1. Before You Begin
5.2. Installing tc Server and Creating a New tc Runtime Instance
5.3. Starting the Components and Doing Initial Configuration
5.4. Exploring the Features of tc Server
6. Installing tc Server
6.1. Before You Begin: System Requirements
6.2. Installing tc Server: Main Steps
6.3. Overview of tc Server Directories, Variables, and Configuration Files
7. Post-Installation Tasks
7.1. Creating a New tc Runtime Instance
7.2. Starting and Stopping tc Runtime Instances
7.3. Windows: Installing the HQ Server and Agents as Windows Services
7.4. Starting and Stopping the HQ Server and Agents
7.5. Getting Started with the HQ User Interface
7.6. Deploying Applications to tc Runtime Instances
7.7. Uninstalling tc Server: Typical Steps
8. Upgrade and Migration Guide
8.1. Upgrading a 2.0.X tc Server Installation to 2.1.X
8.2. Upgrading a 2.1.X tc Runtime to the Latest Version
9. Tutorial: Using HQ to Configure and Manage tc Runtime Instances
9.1. Before You Begin
9.2. Restart a tc Runtime Instance
9.3. Reconfigure a tc Runtime Instance
9.4. Deploy a Web Application to a tc Server Runtime Instance
9.5. Add tc Runtime Instances to the Favorite Resources Portlet
9.6. Create an HQ Group of Multiple tc Runtime Instances
9.7. Monitoring tc Runtime Instances
9.8. Manage the Preconfigured Deadlock Detected Alert
10. Tutorial: Very Simple Helloworld Web Application
10.1. Before You Begin
10.2. Creating and Deploying the Helloworld Web Application
10.3. Java Source of the Hello.java Servlet
10.4. JSP Source for the hello.jsp JSP
10.5. Sample web.xml File
10.6. Sample Default index.html File
10.7. Ant Build File to Compile and Package the Example
11. Troubleshooting
11.1. tc Runtime: ClassNotFoundException when Starting a 6.0 Instance
11.2. HQ: Resources Not Showing up in the HQ User Interface
11.3. HQ: Errors When Trying to Add an Auto-Discovered Resource
11.4. HQ Agent: Errors When Starting on Solaris
11.5. tc Runtime: Hot Redeploy/Stop/Undeploy on Windows Fails
11.6. tc Runtime: Error When Running a Web Application on tc Runtime and Using SpringSource Tool Suite
11.7. tc Runtime: JVM Performing a Full GC

1. Copyright Notice

You can find the most up-to-date technical documentation on the VMware Web site at:

http://www.vmware.com/support

The VMware Web site also provides the latest product updates.

If you have comments about this documentation, submit your feedback to: docfeedback@vmware.com

© 2008 VMware, Inc. All rights reserved. Protected by one or more of U.S. Patent Nos. 6,397,242, 6,496,847, 6,704,925, 6,711,672, 6,725,289, 6,735,601, 6,785,886, 6,789,156, 6,795,966, 6,880,022, 6,944,699, 6,961,806, 6,961,941, 7,069,413, 7,082,598, 7,089,377, 7,111,086, 7,111,145, 7,117,481, 7,149,843, 7,155,558, 7,222,221, 7,260,815, 7,260,820, 7,269,683, 7,275,136, 7,277,998, 7,277,999, 7,278,030, 7,281,102, 7,290,253, 7,356,679, 7, 409,487, 7,412,492, and 7,412,702; patents pending.

VMware, the VMware "boxes" logo and design, Virtual SMP, and VMotion are registered trademarks or trademarks of VMware, Inc. in the United States and/or other jurisdictions. Microsoft is a registered trademark of Microsoft Corporation in the United States and other countries. All other marks and names mentioned herein may be trademarks of their respective companies.

2. Quick Start Instructions

This section provides quick start instructions for installing tc Server Standard Edition and the vFabric Hyperic management components (HQ Server and Agent) on the same computer, creating a tc Runtime instance, and starting all components. The instructions install the tc Runtime component in a separate directory from the HQ management components.

Note: tc Runtime is the runtime component of tc Server.

It is assumed that you are installing version 4.5 of vFabric Hyperic; this version includes the tc Server HQ plug-in in all standard distributions.

If you want to install the Developer or Spring Editions of tc Server; install different components on different computers; or simply want more detailed installation instructions, see Installing tc Server. It is assumed that you are installing tc Server from scratch; if you are upgrading an existing tc Server installation, see the upgrade documentation.

To install all tc Server components:

  1. Download and install a JDK or JRE on your local computer. See Required Software: JDK or JRE.

  2. Open a terminal (Unix) or command prompt (Windows) and create two new directories: one that will contain the tc Runtime component (such as /home/tcserver) and one that will contain the HQ Agent and the HQ Server (such as /home/hyperic.) For example, on Unix:

    prompt$ mkdir /home/tcserver
    prompt$ mkdir /home/hyperic
  3. From the SpringSource Download Center, download the springsource-tc-server-standard-2.1.X.RELEASE.zip file and unzip the contents into the tc Runtime directory you created in the preceding step.

    This action is all that is required to install tc Runtime; there is no installer program.

    For example, if you created a directory called /home/tcserver in the preceding step, and downloaded the Standard Edition file in the /home/Downloads directory:

    prompt$ cd /home/tcserver
    prompt$ unzip /home/Downloads/springsource-tc-server-standard-2.1.0-RELEASE.zip

    After you unzip the ZIP file you will have a directory called /home/tcserver/springsource-tc-server-standard. This directory contains all the tc Runtime files and directories.

  4. From the Hyperic Download Center, download the Hyperic HQ EE (Enterprise Edition) distribution and unpack it into a temporary directory.

    Be sure you download version 4.5 of HQ which automatically includes the tc Server HQ plug-in. Download both the HQ Server and Agent components. You can download a distribution for your particular platform, such as Windows or Linux, or you can download a platform-neutral distribution that does not contain a JDK or database (labelled noJRE.) If you download the latter distribution, you must also install a database server, such as Oracle or Postgres, because the platform-neutral version of HQ does not include one. The platform-specific versions include a evaluation database server to get you started.

    See the vFabric Hyperic Documentation for details.

  5. From your terminal window or command prompt, change to the temporary directory in which you unpacked the HQ distribution and execute the setup.sh (Unix) or setup.bat (Windows) script.

    For example, if you downloaded and unpacked the HQ distribution into the /home/Downloads directory, you will have a sub-directory called hyperic-hq-installer:

    prompt$ cd /home/Downloads/hyperic-hq-installer
    prompt$ ./setup.sh

    After accepting the terms of agreement, enter 1,2 to install both the HQ Server and HQ Agent. The script asks a few more questions, such as an encryption key for encrypting the database-user password and the directory in which you will install HQ Server and Agent (/home/hyperic in our example.) If you are installing a platform-specific version of HQ, the setup.sh script might ask you to run another script as the root user. If you are installing the platform-neutral version of HQ, the script asks for information about your database, including the database URL, name and password of the user that connects to the database. For more information, see the vFabric Hyperic Documentation.

    When the setup.sh script completes, HQ Server is installed in /home/hyperic/server-4.5.X.X-EE and the HQ Agent is installed in the directory /home/hyperic/agent-4.5.X.X-EE.

To create a tc Runtime instance and start all components:

  1. From your terminal window or command prompt, change to the tc Runtime directory and execute the tcruntime-instance command to create a basic tc Runtime instance (called myserver in the example):

    prompt$ cd /home/tcserver/springsource-tc-server-standard
    prompt$ ./tcruntime-instance.sh create myserver
  2. Execute the tcruntime-ctl command to start the new tc Runtime instance:

    prompt$ ./tcruntime-ctl.sh myserver start

    To ensure that the tc Runtime instance actually started, invoke its welcome page in a browser. Use the URL http://host:8080, where host is the computer on which the tc Runtime instance is running (localhost if local):

    http://localhost:8080
  3. Start the HQ Server:

    prompt$ cd /home/hyperic/server-4.5.X.X-EE
    prompt$ bin/hq-server.sh start 
  4. Start the HQ Agent:

    prompt$ cd /home/hyperic/agent-4.5.X.X-EE
    prompt$ bin/hq-agent.sh start

    The first time you start the HQ Agent, it prompts for information about the HQ Server to which it will connect. Assuming this is a non-production installation, you can usually take the default values. When the script prompts you for the HQ server IP address, enter 127.0.0.1 or localhost; this is because this Quick Start section installs both the HQ Server and Agent on the same computer (host). The default HQ login/password is hqadmin/hqadmin.

  5. Invoke the HQ server console using the URL http://host:7080 in your browser, where host is the computer on which the HQ server is running (localhost if local):

    http://localhost:7080

    Username and password, by default, are both hqadmin.

    The tc Runtime instance should show up automatically in the auto-discovery portlet; it is called tc Runtime servername. Other resources might also show up, such as the HQ Agent itself and a database server. Click the Add to Inventory button so you can begin to manage and monitor the tc Runtime instance.

    Click the Help link on the HQ server console for online help.

3. Overview of tc Server

3.1 Features of tc Server

SpringSource 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:

For a detailed comparison between SpringSource tc Server and Apache Tomcat, see Comparing tc Runtime and Apache Tomcat.

tc Server Enhancements to Apache Tomcat

The tc Server runtime component, known as tc Runtime, offers substantial usability enhancements over the open-source Apache Tomcat server:

  • Improved out-of-the-box configuration. In most cases, you can use tc Server immediately after you install it, with no additional configuration.

  • Easy creation of a tc Runtime instance with the tcruntime-instance command script. You can leverage additional (optional) configuration features by specifying prepackaged templates when you create a tc Runtime instance, such as automatically configuring clustering or SSL.

  • Easy and intuitive to start a tc Runtime instance on both UNIX and Windows platforms.

  • Default configuration of high-concurrency JDBC connection pool in new tc Runtime instances.

  • Tunable local standard configuration files using the catalina.properties file.

Easy Configuration and Monitoring with Hyperic

Hyperic is a comprehensive enterprise application management tool for managing and monitoring tc Runtime instances, Spring-powered applications, and a variety of non-SpringSource platforms and application servers such as Apache Tomcat. The server instances and applications can be running on multiple computers. Hyperic provides a single console with powerful dashboards through which you can easily check the health of your applications. With Hyperic , you can:

  • Manage the lifecycle of tc Runtime instances by starting, stopping, and restarting a local or remote instance.

  • Similarly manage the lifecycle of a group of tc Runtime instances that are distributed over a network of computers.

  • Configure a single instance of tc Runtime. Configuration options include the various port numbers to which the tc Runtime instance listens, JVM options such as heap size and enabling debugging, default server values for JSPs and static content, JDBC datasources, various tc Runtime connectors, and so on.

  • Deploy a Web application from an accessible file system, either local or remote. You can deploy to a single tc Runtime instance or to a predefined group of servers.

  • Manage the lifecycle of applications deployed to a single tc Runtime instance or group of servers. Application lifecycle operations include start, stop, redeploy, undeploy, and reload.

In addition to the preceding tc Runtime-specific Hyperic tasks, you perform the standard tasks :

  • Inventory the resources on your network.

  • Monitor resources.

  • Receive alerts on problems with resources. The tc Server HQ plug-in includes a variety of preconfigured alerts.

  • Control resources.

Enhanced Diagnostics

SpringSource tc Server includes a full set of diagnostic features that makes it easy for you to troubleshoot problems with a tc Runtime instance or the applications that you deploy to tc Runtime instances. These diagnostic features include:

  • Thread diagnostics. When you deploy and start a Web application on a tc Runtime instance, and then clients begin connecting and using the application, you might find that the clients occasionally run into problems such as slow or failed requests. By default, tc Runtime logs errors in the log files; however, it is often difficult to pinpoint the exact source of the error and how to fix it. With thread diagnostics enabled, tc Runtime provides additional troubleshooting information.

  • Deadlock detection. The tc Server HQ plug-in automatically detects whether a thread deadlock occurs in a tc Runtime instance or an application deployed to the instance.

  • Time in Garbage Collection.The tc Server HQ plug-in has a new metric that represents the percentage of process up time (0 -100) that a tc Runtime instance has spent in garbage collection.

  • Tomcat JDBC DataSource monitoring. A new tc Server HQ plug-in service represents the high-concurrency Tomcat JDBC datasources you have configured for your tc Runtime instance. This service monitors the health of the datasource, such as whether its connection to the database has failed or was abandoned, and whether the JDBC queries that clients execute are taking too long.

For some diagnostics features, the tc Server HQ plug-in includes one or more preconfigured alerts that make it easy for you to monitor the tc Runtime instance, as well as manage the various thresholds at which an alert is triggered. For additional information about these diagnostic features, and information about managing the associated Hyperic alerts, see tc Server Administration Guide, under Managing tc Runtime-Related Hyperic Alerts.

tc Server Command-Line Interface and Command Scripts

You can use the command-line interface (CLI) tcsadmin to:

  • List servers, groups, and deployed applications.

  • Deploy applications

  • Configure tc Runtime instances and groups

  • Control tc Runtime instances and groups

3.2 Comparing tc Runtime and Apache Tomcat

The runtime component of SpringSource tc Server (tc Runtime) is an enterprise version of Apache Tomcat. tc Runtime is a drop-in replacement for Apache Tomcat 6, ensuring a seamless upgrade path for existing custom-built and commercial software applications already certified for Tomcat. Maintaining this level of compatibility enables customers to add the functionality they need to run and manage their applications more effectively with the least amount of effort.

SpringSource tc Runtime also adds many business-critical features to standard Apache Tomcat. The following sections compare the two:

Standard Application Server Features

SpringSource tc Runtime and Apache Tomcat share key standard features of application servers.

Table 3.1. Standard Application Server Feature Comparison

Application Server FeaturesSpringSource tc RuntimeApache Tomcat
Servlet 2.5 supportYesYes
Java Server Pages (JSP) 2.1 supportYesYes
HTTP session clusteringYesYes
Advanced I/O featuresYesYes
Pre-built advanced non-blocking I/O componentsYesYes
Basic Windows service wrapperYesYes

Enterprise Application Server Features

Because SpringSource tc Runtime is based on Apache Tomcat 6, it provides a powerful yet lightweight platform that is compatible with existing Tomcat-based applications and with Web applications that run on other Java EE application servers such as IBM WebSphere or Oracle WebLogic. Applications can be seamlessly moved from Apache Tomcat to SpringSource tc Runtime to gain the benefits that SpringSource tc Runtime provides beyond the base Apache Tomcat.

Table 3.2. Enterprise Application Server Feature Comparison

Enterprise Application Server FeaturesSpringSource tc RuntimeApache Tomcat
Multiple runtime instances from a single binary installationYesNo
New high-concurrency JDBC connection pool`YesNo
Preconfigured for JMX managementYesNo
Includes latest security vulnerability and bug fixesYesRebuild Tomcat yourself to apply incremental fixes.
Binary patch updatesYesBinary patches are not provided by Tomcat community.
Unix boot scriptsYesNo
Enhanced Windows service wrapperYesNo

SpringSource tc Runtime has a number of advanced configuration features that Apache Tomcat does not.

Table 3.3. Advanced Configuration Feature Comparison

Advanced Configuration FeaturesSpringSource tc RuntimeApache Tomcat
Templated production-ready configuration out-of-the-box.YesNo
Create Tomcat single server configuration.YesNo
Modify general server configuration including JVM startup parameters.YesNo
Modify context container configuration.YesNo
Modify server defaults for JSPs and static content.YesNo
Add, modify, and delete JDBC datasources.YesNo
Modify HTTP and AJP connector settings.YesNo
Create and view general services.YesNo
Modify general engine configuration.YesNo
Pre-tuned JVM options.YesNo

Business-Critical Operational Features

SpringSource tc Runtime includes advanced, distributed management and monitoring capabilities through a centralized management console called Hyperic user interface.

The tables in this section list the capabilities that SpringSource tc Runtime provides over and above the base Apache Tomcat and also notes the features that Hyperic provides for existing Apache Tomcat environments.

SpringSource tc Runtime provides a wide range of capabilities that enable developers, administrators, and operators to centrally diagnose, measure, and monitor the distributed application infrastructure.

Table 3.4. Diagnostics, Metrics, and Monitoring Feature Comparison

Diagnostics, Metrics, and Monitoring FeaturesSpringSource tc RuntimeApache Tomcat
Application deadlock detectionYesNo
Uncaught exception detectionYesNo
Garbage collection metrics, including throughput and countYesNo
SQL query time monitoring metrics.YesNo
Enhance response time monitoring metricsYesNo
Enhanced connection pool health metricsYesNo
Enhanced thread pool health metricsYesNo
Role-based customizable dashboardYesYes (via Hyperic)
Automated inventory of application servers and software resourcesYesYes (via Hyperic)
Real-time metric collection and monitoring of tc Runtime, Tomcat, Apache Web server, Apache ActiveMQ, underlying JVM, operating system, and other resourcesYesYes (via Hyperic)
Charting and graphing performanceYesYes (via Hyperic)
Advanced alerting: multi-conditional, availability, event, and recovery alerts, group-based alerting, and escalation schemes.YesYes (via Hyperic)
Log file tracing, alerts on event levelsYesYes (via Hyperic)
Alerts based on configuration file updatesYesYes (via Hyperic)
Performance baselining for alert thresholdsYesYes (via Hyperic)

SpringSource tc Runtime provides a centralized, secure dashboard that enables administrators and operators to organize, operate, and control their distributed applications and infrastructure.

Table 3.5. Centralized Operations and Management Feature Comparison

Centralized Operations and Management FeaturesSpringSource tc RuntimeApache Tomcat
Secure, distributed, JMX-based server managementYesNo
Create application server groupsYesYes (via Hyperic)
Application server start/stop/restart from central consoleYesYes (via Hyperic)
List deployed applications and current statusYesNo
Application deploy/undeploy/reload/start/stopYesNo
Security and access/authorization controlYesYes (via Hyperic)
Scheduled control: maintenance activities, on-demand actions, scheduled remediation actions, or scheduled responses to alert conditionsYesYes (via Hyperic)

SpringSource tc Runtime provides scripting support for administrators and operators who prefer to create and run scripts to handle distributed configuration and deployment steps.

Table 3.6. Scripting Feature Comparison

Scripting FeaturesSpringSource tc RuntimeApache Tomcat
List deployed servers.YesNo
Create server groups.YesNo
Add and delete servers to and from groups.YesNo
List deployed applications, including current status.YesNo
Deploy application WAR file.YesNo
Undeploy application.YesNo
Start, stop, and reload deployed applications.YesNo
Get (download) configuration files and JVM parameters from a server.YesNo
Modify configuration files on an individual server.YesNo
Set (push) configuration files and JVM parameters to a server group.YesNo
Start, stop, and restart a server or group of serversYesNo

3.3 tc Server Editions

SpringSource tc Server is available in the following editions:

Developer Edition

The Developer Edition of tc Server is geared towards the application developer. It contains the tc Runtime, along with utilities that make it easy to create and start tc Runtime instances and a set of templates that make it easy to quickly create specific preconfigured tc Runtime instances, such as cluster-node ready and SSL-enabled.

This edition also includes Spring Insight, an application that provides real-time visibility into the behavior and performance of your user applications. The Developer Edition contains a template called insight that includes the Spring Insight application. You use this template to create new tc Runtime instances that also have Spring Insight. (Developer Edition does not include access to Hyperic Server and Agent.)

The Developer Edition is distributed as either a ZIP or compressed TAR file with the following names:

  • springsource-tc-server-developer-2.1.X.RELEASE.zip
  • springsource-tc-server-developer-2.1.X.RELEASE.tar.gz

Standard Edition

The Standard Edition of tc Server is geared towards the administrator. Similar to the Developer Edition, the Standard Edition contains the tc Runtime, scripts to easily create and start tc Runtime instances, and templates to quickly create specific types of tc Runtime instances (such as cluster-node ready or SSL-enabled.) This edition does not include Spring Insight, which is a developer tool.

With the Standard Edition, you have access to the vFabric Hyperic management system, which (as of version 4.5) includes the tc Server HQ plugin in the general distribution. Install vFabric Hyperic if you want to use Hyperic to configure and manage the tc Runtime. If you do not want to use Hyperic to manage tc Runtime instances and want to use the tc Runtime on its own, install only the tc Runtime.

The Standard Edition is distributed as either a ZIP or compressed TAR file with the following names:

  • springsource-tc-server-standard-2.1.X.RELEASE.zip
  • springsource-tc-server-standard-2.1.X.RELEASE.tar.gz

To download an evaluation of Hyperic, go to the Hyperic download page.

Spring Edition

The Spring Edition of tc Server includes the Standard Edition and Hyperic management components, plus production optimizations for Spring-based applications in the form of instrumented JARs for the following Spring technologies: Spring Framework, Spring Security, Spring Web Flow, and Spring Web Services.

3.4 How tc Server and Hyperic Work Together

SpringSource tc Server is available in a variety of editions, based on whether you are a developer or an administrator. The Standard and Spring editions of tc Server, because they are targeted at administrators, include the Hyperic management capabilities. This section shows how the runtime component of tc Server (called the tc Runtime) and the Hyperic components (Hyperic Server and Hyperic Agents) work together, and possible configurations that you can install on one or more computers.

The simplest scenario is where you install all components (tc Runtime, Hyperic Agent, and Hyperic Server) on the same computer. In this case, the computer acts as a host for the tc Runtime instances and their deployed applications as well as a host to the Hyperic Server and Hyperic Agent, which are used to manage the tc Runtime instances.

Figure 3.1. Installing on One Computer

Installing on One Computer


In the preceding figure, the Hyperic Server is managing just one tc Runtime instance. The Hyperic server can, of course, manage multiple instances, as well as manage other kinds of servers. Because the tc Runtime instances are all on one computer, you only need to install one Hyperic Agent.

Figure 3.2. Multiple tc Runtime Instances on One Computer

Multiple tc Runtime Instances on One Computer


A slightly more complicated scenario is where you create multiple tc Runtime instances on one computer, say computerA, and the Hyperic Server on computerB. In this case, you must install the Hyperic Agent on computerA so that the Hyperic Server is able to manage the tc Runtime instances on computerA from computerB. SpringSource refers to computerA as a managed node.

Figure 3.3. Installing on Two Computers

Installing on Two Computers


In another scenario, you host the Hyperic Server on computerB, but want to install tc Runtime on many computers, possibly of different platforms such as Unix and Windows. In this case you must also install the Hyperic Agent on each computer (managed node) that hosts the tc Runtime instances.

In the following figure, for example, computerC might be a Windows platform while all the rest of the computers are Unix. Also note that each computer has a different set of tc Runtimes installed, but only one Hyperic Agent. In the figure, all computers except computerB are managed nodes.

Figure 3.4. Installing on Multiple Computers

Installing on Multiple Computers


3.5 Links to Additional Documentation

Because tc Runtime is based on Apache Tomcat, much of the documentation about using tc Runtime itself is provided by Apache.

The Hyperic management component of tc Server provides monitoring and management for your Web infrastructure. You can use it to streamline operations, manage infrastructure complexity, and drive service level improvements. The Hyperic user interface includes online-help for both generic Hyperic functionality, as well as tc Server related functionality. For detailed documentation about Hyperic:

The following links provide additional documentation for programmers who develop Web applications using the Spring Framework and standard Java EE technologies such as servlets and JSPs:

4. Release Notes

The following sections contain release-specific information about tc Server.

4.1 New Versioning Process

Beginning with tc Server 2.0.x, the bundle itself will have a version number separate from the underlying components. The 2.0 release represents the second major revision of the tc Server product bundle. Minor revisions, maintenance updates, and service releases of any set of underlying components will likewise increment the fully qualified bundle version. As of the 2.0 release, the bundle contains the following separately versioned components. The initial major version of each component is noted. Specific downloads will have fully qualified version information on each component.

  • tc Runtime: Apache Tomcat-based runtime container, major version 6.0. The fully qualified version of the tc Runtime is a combination of the underlying Apache Tomcat version and an alphabetic modifier to track maintenance updates on the same underlying Tomcat version, for example, 6.0.29.B-RELEASE .

  • tc Server HQ Plug-In: Hyperic HQ plug-in that enables advanced management and monitoring, major version 2.1.

  • Hyperic HQ Agent: Agent portion of bundle, major version 4.5.

  • Hyperic HQ Server: HQ Server, preconfigured with the tc Server HQ plug-in, major version 4.5.

4.2 What's New and Changed in This Release?

2.1.2

The 2.1.2 release of tc Server does not contain any new features with respect to version 2.1.1. See Fixed Issues for the list of issues that were fixed in this maintenance release.

2.1.1.SR01

The 2.1.1.SR01 release of tc Server contains no new features or fixed issues since release 2.1.1. The only change is to update the version of Tomcat used by tc Runtime to version 6.0.32.A. This is a security release to pick up changes since version 6.0.29C of Tomcat. See the Apache Tomcat Changelog for a list of the changes to Tomcat.

2.1.1

The 2.1.1 release of tc Server does not contain any new features with respect to version 2.1.0. See Fixed Issues for the list of issues that were fixed in this maintenance release.

  • Tomcat version: SpringSource tc Runtime 2.1.1 uses version 6.0.29.C of Tomcat as its core.

  • HQ version: tc Server 2.1.1 supports version 4.5.1 of the HQ Server and Agent which in turn contains version 2.1.1 of the tc Server HQ Plugin.

    If you upgrade your existing tc Runtime instances to version 2.1, you will also need to upgrade your HQ Server and Agent(s) to version 4.5. The 4.2.x versions of the HQ Server and Agent will not monitor a tc Runtime instance that has been upgraded to 2.1.

2.1.0

The following features are new or changed in tc Server 2.1.0.

  • Tomcat version: SpringSource tc Runtime 2.1.0 uses version 6.0.29.B of Tomcat as its core.

  • HQ version: tc Server 2.1.0 supports version 4.5.0 of the HQ Server and Agent.

    If you upgrade your existing tc Runtime instances to version 2.1, you will also need to upgrade your HQ Server and Agent(s) to version 4.5. The 4.2.x versions of the HQ Server and Agent will not monitor a tc Runtime instance that has been upgraded to 2.1.

  • Spring Insight: Spring Insight (Developer Edition) is GA in 2.1.0. In addition to a new look-and-feel, the GA version of Spring Insight includes the following new major features since the M3 release:

    • All trace information is now persisted to disk, so you can view old information for a time range that has already passed. You can purge this persisted data at any time.

    • There is a new Administration tab from which you can perform a variety of administrative tasks. For example, customize the acceptable tolerated threshold of an Endpoint, purge the persisted data, or view information about the Spring Insight application itself.

    • You can filter the list of trace details for a particular trace based on the plug-ins currently installed in Spring Insight. For example, you can filter based on whether the trace details are JDBC calls, general database calls, Web requests, and so on.

    • The navigation of Spring Insight has been improved so that it displays the trace and metric information in more useful and intuitive ways. For example, Spring Insight uses smart collapse, which means it intelligently collapses large trace detail navigation trees so only the most interesting details are displayed by default. It now displays multiple yet related sets of data on the same graph so you can easily compare related data for a particular endpoint or application. For example, the throughput and response time trends for an Endpoint are now displayed in a single graph rather than in two separate ones. The new Related To feature allows you to easily view the endpoint and application in which a particular trace detail occurred.

    • You can now export and import traces.

    See Using Spring Insight.

  • GemFire templates for HTTP session replication: vFabric GemFire 6.5 provides tc Server templates that make it easy to configure HTTP session replication in a 2.1 tc Runtime instance without requiring any application changes. These templates are not provided by default in the 2.1 tc Server distribution; rather, you must download and install them into the templates directory separately. But once you do that, you can then use the templates to create tc Runtime instances that are automatically enabled with this feature.

    For detailed information, see HTTP Session Management Module on the GemStone Community WIKI.

  • Changes in terminology for instance layouts: Terminology has changed in regard to the layout you use when creating an instance:

    • What used to be called the "SpringSource layout" is now called the "separate layout." In this layout, the instance's CATALINA_HOME and CATALINA_BASE point to separate directories so that multiple instances can share a set of tc Runtime binaries.

    • What used to be called the "ASF layout" is now called the "combined layout." In this layout, the instance's CATALINA_HOME and CATALINA_BASE point to the same directory, which means that the tc Runtime binaries are bundled within the instance directory and are not shared with multiple instances.

    You can now easily create an instance using the combined layout by specifying the --layout combined option of tcruntime-instance. However, SpringSource does not recommend you do this unless you absolutely have to. See Differences Between the Separate and Combined Layouts.

  • Managed Node package of Standard Edition is no longer available: As of version 2.1, tc Server is available in two packages only: Developer Edition and Standard Edition. The Standard Edition includes only the tc Runtime, and not the HQ Agent. Before version 2.1, Standard Edition was itself packaged in two ways: Runtime package and Managed Node package, where the Managed Node package included a tc Server-ready version of the HQ Agent. This package is no longer required because the generic 4.5 HQ distributions now automatically include the tc Server HQ plug-in. This means that if you want to use the Management components of tc Server you simply install the standard 4.5 HQ Server and Agent.

    See tc Server Editions for information on the 2.1 tc Server editions and packages.

  • No preconfigured Spring Insight instance in Developer Edition: The Developer Edition of tc Server no longer includes a preconfigured tc Runtime instance (previously called spring-insight-instance). You must now create your own tc Runtime instance using the new insight template, which automatically configures the instance with Spring Insight.

    See Installing Developer Edition for details.

  • Changed syntax of tcruntime-instance script: The syntax of the tcruntime-instance script has changed with the aim to make the script more intuitive and easier to use. The changes are not backward compatible with the syntax in 2.0.X and previous versions.

    The script supports four commands (create, modify-version, list, and help), and each command has its own set of available options. Additionally, some options in 2.0.x are no longer supported, and there are new options. Also, for clarity, the examples in this documentation use the long form of the options.

    For example, the simplest command to create a tc Runtime instance has changed from:

    prompt$ ./tcruntime-instance.sh -s myserver

    to:

    prompt$ ./tcruntime-instance.sh create myserver

    The command to modify the version of tc Runtime used by an instance (and thus pin it to the version) changed from:

    prompt$ ./tcruntime-instance.sh -s myserver -m -v 6.0.29.A-RELEASE

    to:

    prompt$ ./tcruntime-instance.sh modify-version myserver --version 6.0.29.A-RELEASE

    The following 2.0.X options are no longer supported:

    • --architecture : tc Runtime auto-detects the architecture based on the 32-bit or 64-bit nature of the JVM, so this option is no longer needed.

    • --tcruntimedir : It is now assumed that you run the tcruntime-instance script from the directory in which it is located.

    • --jrehome : Use --java-home to point to both a JDK or JRE.

    • --ports : Use the new --property option to specify the ports, as well as other configuration properties.

    The create command has two new options: --property and --properties-file . Use these to specify any configuration property of the instance at the command line when you create the instance, rather than defaulting to the default values.

    For complete documentation on the new syntax of the tcruntime-instance script, see Creating a New tc Runtime Instance.

  • Changes to use of templates: You can now specify multiple templates when you create a tc Runtime instance using the --template option of the tcruntime-instance script; the script merges all changes, deletions, or updates to the server.xml or context.xml file so that all features in the templates are enabled in the single instance.

    Because of this change, the structure of the out-of-the-box templates has changed. For example, instead of a conf/server.xml file, which previously would overwrite the base server.xml file of the instance, there is now a conf/server-fragment.xml file that the script merges with the base file.

    If you use the --template option to specify a template that does not add a <Connector> element in the server.xml file, then the tcruntime-instance script adds a Blocking IO (BIO) Connector; if your template does include a Connector, then the script does not add the BIO Connector.

    You can no longer specify an existing tc Runtime instance as a template.

    The name of some of the out-of-the-box templates has changed, and there are new templates. For complete documentation, see Creating a tc Runtime Instance with a Template and Templates Provide by tc Runtime.

  • ServiceabilityLifecycleListener no longer supported: Support for the ServiceabilityLifecycleListener Listener has been removed from version 2.1 of tc Server. This means that you may run into an error if you try to start a 6.0 instance in the 2.1 runtime. For additional details and a workaround, see tc Runtime: ClassNotFoundException when Starting a 6.0 Instance.

4.3 Supported Configurations

The sections that follow list the configurations supported by version 2.1.X of the tc Runtime component.

For the equivalent information about versions 2.0.x of tc Server, see Supported Configurations.

For supported configuration information about the Hyperic Server and Agent, see Installation Requirements.

Supported Java EE Specifications

SpringSource tc Runtime supports:

Supported JRE Versions

SpringSource tc Runtime runs on versions 1.5 and 1.6 of the Java Runtime Environment (JRE.)

Supported Configurations: tc Runtime

The following table lists the supported configurations for running the tc Runtime.

Because you typically install and run the Hyperic Agent on the same computer as the tc Runtime, you should also consult HQ Agent Requirements.

SpringSource recommends that you follow the guidance of your operating system or JVM vendor when deciding which patch levels should be applied to your computer. In general, the latest patch update levels are recommended.

Table 4.1. Supported Configurations

Operating SystemMajor VersionChip ArchitectureJVMtc Runtime Version
RedHat Enterprise Linux (RHEL)V4x86 32/64 bitSun Hotspot 1.5, 1.62.1.X
RedHat Enterprise Linux (RHEL)V5x86 32/64 bitSun Hotspot 1.5, 1.62.1.X
Debian Linux5.0x86 32 bitSun Hotspot 1.62.1.X
SUSE Linux Enterprise Server (SLES)V11x86 64 bitSun Hotspot 1.5, 1.62.1.X
Windows2008 Serverx86 32/64 bitSun Hotspot 1.5, 1.62.1.X
Windows2003 Server (SP1 and newer)x86 32/64 bitSun Hotspot 1.5, 1.62.1.X
Solaris9SparcSun Hotspot 1.5, 1.62.1.X
Solaris10
  • Sparc

  • Intel 32/64 bit

Sun Hotspot 1.5, 1.62.1.X
AIX5.3PowerPC 32/64 bitIBM JVM 1.5, 1.62.1.X
AIX6.1PowerPC 32/64 bitIBM JVM 1.5, 1.62.1.X
Mac OSX10.5x86 64 bitApple 1.52.1.X
Mac OSX10.6x86 64 bitApple 1.62.1.X

Tested Configurations: tc Runtime

The following tables list specifically tested patch update levels for the latest 2.1.X version of tc Runtime. This table is updated as new configurations are tested.

Table 4.2. Tested Configurations

Operating SystemMajor VersionChip Architecture (Tested)Fully Qualified of JVM Version (Tested)Version of tc Runtime (Tested)
RedHat Enterprise Linux (RHEL)V4x86 32 bit
  • Sun Hotspot 1.5.0_22

  • Sun Hotspot 1.6.0_20

2.1.0
RedHat Enterprise Linux (RHEL)V4x86 64 bit
  • Sun Hotspot 1.5.0_22

  • Sun Hotspot 1.6.0_20

2.1.0
RedHat Enterprise Linux (RHEL)V5x86 32 bit
  • Sun Hotspot 1.5.0_22

  • Sun Hotspot 1.6.0_20

2.1.0
RedHat Enterprise Linux (RHEL)V5x86 64 bit
  • Sun Hotspot 1.5.0_22

  • Sun Hotspot 1.6.0_20

2.1.0
Windows2008 Server (SP2)x86 32 bit
  • Sun Hotspot 1.5.0_22

  • Sun Hotspot 1.6.0_18

2.1.0
Windows2008 Server (SP2)x86 64 bit
  • Sun Hotspot 1.5.0_22

  • Sun Hotspot 1.6.0_18

2.1.0
Windows2003 Server (SP2)x86 32 bit
  • Sun Hotspot 1.5.0_22

  • Sun Hotspot 1.6.0_18

2.1.0
Windows2003 Server (SP2)x86 64 bit
  • Sun Hotspot 1.5.0_22

  • Sun Hotspot 1.6.0_20

2.1.0
Solaris10Intel 64 bit
  • Sun Hotspot 1.5.0

  • Sun Hotspot 1.6.0_21

2.1.0

4.4 Restrictions

You can use the HQ application management features that are specific to tc Server only with the runtime component of tc Server (also called tc Runtime); these features do not work with standard Apache Tomcat. The HQ application management features include deploy, undeploy, start, stop, and reload of Web applications.

4.5 Fixed Issues

The following table lists the product issues that were fixed in the 2.1.1 maintenance release.

Table 4.3. Issues Fixed in 2.1.2

Issue IDDescription
TCS-1531The documentation incorrectly references the --javahome option of the tcruntime-instance command. The correct option is --java-home.
TCS-1635Quoting in the AGENT_PATHS and JAVA_AGENTS variables causes tc Server startup failure on Unix sytems.
TCS-1642tcruntime-instance.sh fails with a NoClassDefFoundError when installing with a path containing spaces and run from another directory.
TCS-164When trying to specify an instance directory containing spaces using -i or --instance-directory, tcruntime-instance.sh displays the usage message and does not run.
TCS-1644There is a typo in the description of --java-home in tcruntime-instance usage message: "to bse used" should be "to be used".
TCS-1646Configuration prompts for property place holders in setenv.properties must have their property names prefixed with the template's name to resolve properly
TCS-1649Auto-discovery scan is performed after a restart, even though the JMX configuration has not changed.
TCS-16502.1.1 tc Runtime instance failed to start on AIX 6.1.
TCS-1676When creating an instance without any template that adds a connector, the default connector is added to the instance. If this is done in interactive mode, the custom prompts are not found and the default prompts are used instead.
TCS-1686The tcruntime-instance.sh usage message for every command indicates that the -h option prints usage information for the create command.
TCS-1698Starting a tc server with a slash before the name causes problems when trying to restart later.
TCS-1743If the base template is specified when creating an instance with tcruntime-instance.sh, several warning messages are displayed as the template is applied a second time.
TCS-1767The JMX authenticator accepts an encoded password in addition to the clear password. The authenticator should require a clear password. For more on this fixed vulnerability, see CVE-2011-0527 at the SpringSource Security Team Web site.
TCS-1800When running Hyperic HQ behind a load balancer and choosing the tc Server "Server Configuration" view, the Dashboard is displayed instead of the Server Configuration view.
TCS-1811The tcsadmin restart command fails when called with the --serverid or --servername options.

Table 4.4. Issues Fixed in 2.1.1

Issue IDDescription
TCS-1440When using the Hyperic user interface to manage a tc Runtime instance, the host name restrictions are not enforced. The restrictions on host names is that they can be comprised of only letters, numbers, and the symbol -, and they must be case insensitive. The user interface is not currently enforcing these restrictions.
TCS-1451The tc Runtime templating mechanism does not recognize when two JVM properties are the same when the two properties differ in their use of upper- or lower-case.

For example, the templating mechanism does not recognize that -Xmx102m is the same as -Xmx1024M due to the final M in the property being of different case. This creates the potential for incorrect or duplicate entries in the setenv.sh|bat file.

TCS-1456When starting a tc Runtime instance that uses the combined layout, the tc Runtime version that's shown in the startup message is always the latest available version, irrespective of the version that was specified when creating the instance.
TCS-1458The tcruntime-ctl.sh script uses the name of an instance from its symlinked directory rather than its absolute directory name, causing problems when attempting to control the instance with the script.
TCS-1493When you cold deploy a Web application using the Hyperic user interface and you provide a context that is different from the name of the Web application, the UI ignores this context and instead deploys the Web application using the name of the WAR file as the context (which is the default behavior if you do not provide a context.)
TCS-1508The tcsadmin command-line interface returns an error if you try to use it to start, stop, or restart a tc Runtime instance.
TCS-1523The error message you get when you attempt to add a duplicate tc Runtime instance to a Hyperic group using the tcsadmin command-line interface is confusing and does not provide information about the real problem. The confusing error returned by tcsadmin in this case is: Could not execute JDBC batch update>
TCS-1524If you attempt to configure the JVM_OPTS variable (using either the tcsadmin command-line interface or the Hyperic user interface) when the existing setenv.sh does not contain the CATALINA_OPTS variable, then the end result is that the JVM_OPTS variable is removed from the setenv.sh script.
TCS-1525Error returned when you attempt to use the put-file command of the tcsadmin command-line interface together with the --servername option.
TCS-1526The error you get when you try to use the tcsadmin command-line interface to control, add a server to, or remove a server from a non-existent group is not helpful and does not describe the actual problem.
TCS-1527If you use the tcsadmin command-line interface to deploy an application, and the deployment fails for some reason, the resulting error message is not helpful and does not describe the actual problem.
TCS-1530The location of the tomcat-juli.jar file in the CATALINA_BASE directory of each tc Runtime instance (instead of the more general CATALINA_HOME directory) makes it difficult to run tools like JspC.
TCS-1538If you use the set-jvm-options or list-jvm-options command of the tcsadmin command-line interface but specify an invalid --serverid value, the resulting error message is not helpful and does not describe the actual problem.
TCS-1539If you use the put-file or get-file command of the tcsadmin command-line interface but specify an invalid --serverid value, the resulting error message is not helpful and does not describe the actual problem.
TCS-1540If you use the put-file command of the tcsadmin command-line interface but specify an invalid --groupid value, the resulting error message is not helpful and does not describe the actual problem.
TCS-1541Attempting to use the set-jvm-options --servername command/option of the tcsadmin command-line interface returns an error because the CLI thinks the servername does not exist when in fact it does.
TCS-1542Attempting to use the list-jvm-options --servername command/option of the tcsadmin command-line interface returns an error because the CLI thinks the servername does not exist when in fact it does.
TCS-1543Attempting to use the list-jvm-options command of the tcsadmin command-line interface with the --serverid option returns an unhelpful error, irrespective of whether the serverid is valid or not. The error is: Failed to execute command list-jvm-options. Reason: Unable to convert resource: 0:1.
TCS-1555The error message returned when you attempt to use the tcsadmin command-line interface to delete a group that doesn't exist is incorrect. It includes a confusing and incorrect double-negative (Can't delete group bogusname because it doesn't not exist).
TCS-1564When you use the tcsadmin command-line interface with any of the commands to list/deploy/stop/start/reload/undeploy an application but you also specify an invalid --groupname value, the error message is unhelpful and does not describe the actual problem.
TCS-1565If you attempt to use the modify-server command of the tcsadmin command-line interface to rename a tc Runtime instance, but you specify an invalid --serverid, the resulting error message is unhelpful and does not describe the actual problem .
TCS-1566The error message when running the revert-to-previous-configuration command of the tcsadmin CLI but specifying an invalid server is badly written and confusing.

5. What Are the Main Steps Required to Get Going?

This chapter provides a roadmap to the high-level steps you perform to get tc Server up and running. Each step points to a more targeted procedure in this guide, such as installing tc Server, starting up the components, and using the HQ user interface to configure and manage a tc Runtime instance or group.

5.1 Before You Begin

You install tc Server by installing its components: the tc Runtime and the management components (HQ Server and Agent.) If you are installing only the Developer Edition of tc Server, you install only the tc Runtime. If you are installing the Standard Edition, which includes access to Hyperic HQ to manage and monitor tc Server, you install the tc Runtime, the HQ Server, and the HQ Agent. See tc Server Editions for details about the available editions. Each edition comes in ZIP and compressed TAR formats.

When installing both the runtime and management components, you can install all components on the same computer or on multiple computers. Typically, you install a single HQ Server, and then install the tc Runtime and HQ Agent on one or more computers. You then create one or more tc Runtime instances.

[Note]Note

It is assumed in this section that you are installing tc Server for the first time. If you have already installed a previous version of tc Server, created one or more tc Runtime instances, and now want to upgrade all the components to the latest version, see Upgrade and Migration Guide.

It is also assumed in most of this documentation that you will use the separate layout for tc Runtime instances, rather than the combined layout (which is similar to the standard Apache Tomcat layout.) In the separate layout, CATALINA_HOME and CATALINA_BASE point to separate directories; in the combined layout they point to the same directory. The default when you create an instance is to use the separate layout because it offers many benefits over the combined layout, although you can of course use the latter if you wish by specifying the --layout option of the tcruntime-instance script. See Differences Between the Separate and Combined Layouts for more information. Unless otherwise specified, the rest of the documentation assumes the separate layout.

5.2 Installing tc Server and Creating a New tc Runtime Instance

In sum, this high-level installation step includes the following sub-steps:

  1. Install the tc Runtime on one or more computers. You perform this step for all editions of tc Server: Developer, Standard, and Spring.

    See Installing tc Server: Main Steps.

  2. If you want to install the HQ management components, you install the HQ Server once.

    See Installing Standard Edition (Including HQ Management Components) .

  3. I you want to install the HQ management components, install the HQ Agent on all computers on which you installed the tc Runtime.

    See Installing Standard Edition (Including HQ Management Components) .

  4. Create a new tc Runtime instance on the computers on which you installed the tc Runtime.

    See Creating a New tc Runtime Instance.

5.3 Starting the Components and Doing Initial Configuration

After you install tc Server, you start the components. Depending on how you have configured tc Server, you perform the following sub-steps on the computers on which you have installed the particular components.

  1. Start the tc Runtime instance(s) on each computer on which you installed the tc Runtime.

    See Starting and Stopping tc Runtime Instances.

  2. Start the HQ Server on the computer on which you installed it.

    See Starting and Stopping the HQ Server and Agents.

  3. Start the HQ Agent on all computers on which you installed it. Typically these are the same as the computers on which you installed the tc Runtime.

    See Starting and Stopping the HQ Server and Agents.

  4. Invoke the HQ user interface in your browser, log in, and be sure it is configured for you to start managing tc Runtime instances.

    See Getting Started with the HQ User Interface.

5.4 Exploring the Features of tc Server

After you start all components of tc Server, log into the HQ user interface, and add the tc Runtime instances to the inventory, you are now ready to explore the features of tc Server.

  1. Run through the HQ tutorial which describes typical tasks you perform on tc Runtime instances, such as deploying applications, configuring servers, and creating and using HQ groups.

    See Tutorial: Using HQ to Configure and Manage tc Runtime Instances.

  2. If you are completely new to programming Web applications, and want to learn how to create a very simple one, run through the Simple Web Application tutorial.

    See Tutorial: Very Simple Web Application Development.

  3. If you installed the Developer Edition of tc Server, try out Spring Insight, which gives you real-time visibility into the behavior and performance of your existing user applications. See Using Spring Insight.

    Using the Spring Insight Development Kit, you can create your own Spring Insight plug-ins that are tailored to the specific needs of your applications. See Using Spring Insight.

  4. If you want to deploy existing Web applications without using the HQ user interface, you can use static deployment.

    See Deploying Applications to a tc Runtime Instance for details.

  5. Learn about more advanced administration tasks, such as creating and using tc Runtime clusters and using the tc Server command-line interface by reading the tc Server Administration Guide

6. Installing tc Server

This chapter describes how to install the various editions of tc Server.

6.1 Before You Begin: System Requirements

This section includes topics that discuss tc Server software requirements, such as the required Java Development Kit (JDK) or Java Runtime Environment (JRE) and database server. Read this section before you begin the tc Server installation.

For HQ Server and Agent requirements, see Installation Requirements on the Hyperic documentation Web site.

Required Software: JDK or JRE

No editions of tc Server bundle a JDK or JRE. Before you install tc Server, download and install a JDK or JRE on each computer on which you will install the tc Runtime component of tc Server. If you are installing the HQ components, the JDK or JRE requirement depends on whether you install the platform-specific or platform-neutral version; only the latter requires a JDK or JRE because the former bundles one. See Supported Configurations for platform-specific details of the JDK or JRE versions that are supported and have been tested.

For most platforms you can download and install the Sun JDK or JRE, although for IBM computers you might want to install the IBM-specific JDK or JRE. The following links point to download Web sites:

After you install the JDK or JRE, set your JAVA_HOME environment variable to point to your installation and update your PATH environment variable to point to the JAVA_HOME/bin directory.

Windows only. If you are installing the management components of tc Server (HQ Server and Agent), then you must also set the HQ_JAVA_HOME system environment variable to point to the location of your JDK or JRE. Set HQ_JAVA_HOME as a system environment variable; if you set it as a user environment variable, the HQ Agent aborts on startup.

Possibly Required Software: Database Server

This section applies only if you are using the Standard or Spring editions of tc Server and you want to also install the HQ Server and Agents management components using the platform-neutral version of the HQ distribution.

The HQ Server uses a database to store its metadata. The platform-neutral version of HQ Server does not, however, bundle a database. This means that if you do not have a database server already installed on either the computer on which you are going to install HQ Server or on an accessible remote computer, then you must download and install one. The platform-specific versions of the HQ distribution bundle a non-production database for you to get started, although it is not recommended that you use this database for production purposes.

Use Oracle 10g/11g, PostgreSQL, or MySQL 5.x with HQ Server. During the installation of HQ Server, you will provide the database URL for JDBC connection and the database username and password.

To set up one of these databases for use with HQ Server, see Set Up Hyperic Database.

Installing on Unix Platforms: Important Notes

This section contains notes about installing tc Server on Unix systems.

tar Command Compatibility

If you are installing tc Server on Unix and have downloaded the compressed TAR file format (*.tar.gz), be sure that the tar command on your computer is compatible with the one required by the tc Server. Open a terminal window and enter:

prompt$ tar --help

Search the help output for a -z option (which filters the output through gzip); if the tar command on your computer supports this option, then it is compatible with the one required by tc Server and you can begin the installation.

If, however, your tar command does not supports this option, then you must install GNUtar (gtar) from an external source. For example, the Web site Sunfreeware.com includes many free downloads for the Solaris platform, including GNUtar.

After you install GNUtar, update the PATH environment variable (either of the user installing tc Server or the system-wide environment variable) to include the location of the gtar command. The location depends on the directory in which you installed GNUtar.

If you have installed GNUtar, then substitute the command gtar for any references to tar in the following install procedure.

Spaces in File and Directory Names

On Unix systems, the -javaagent and -agentpath options cannot specify directory paths containing spaces. These options are used when running a tc Server instance created with the Elastic Memory for Java (EM4J) template, which is used when running tc Server in a VMware vSphere virtual machine. Because of this limitation, installing tc Server in a directory with spaces in the full pathname or creating tc Server instances with spaces in the name is not supported when using the EM4J template.

6.2 Installing tc Server: Main Steps

This section describes how to install tc Server. It is divided into sub-sections, depending on the edition of tc Server you are going to install. Be sure to read tc Server Editions for information about each edition, what they contain, and the names of the *.zip or *.tar.gz files into which each edition is packaged.

The procedures cover both Unix and Windows installation. Most of the instructions, however, are for Unix. If you are installing on Windows, change the forward slashes (/) to back slashes (\); other differences in the installation are called out.

[Note]Note

It is assumed that you are installing tc Server for the first time. If you have already installed a previous version of tc Server, have created one or more tc Runtime instances, and now want to upgrade all the components to the latest version, see Upgrade and Migration Guide. The upgrade guide also describes how to upgrade an existing pre-4.5 HQ installation so that it can manage tc Runtime instances.

Installing Developer Edition

  1. Download and install a JDK or JRE, if you do not already have one installed on your computer. See Before you Begin: System Requirements.

  2. Download the tc Server Developer Edition distribution from the SpringSource Download Center.

    The Developer Edition is distributed as either a ZIP or compressed TAR file with the following names:

    • springsource-tc-server-developer-2.1.X.RELEASE.zip
    • springsource-tc-server-developer-2.1.X.RELEASE.tar.gz
  3. Open a terminal (Unix) or command window (Windows) and create the main tc Server installation directory, such as /home/tcserver. For example, on Unix:

    prompt$ mkdir /home/tcserver
  4. Unzip or untar the tc Server distribution file into the new directory.

    This creates a directory called springsource-tc-server-developer in the main tc Server installation directory that contains the tc Runtime utility scripts, the templates directory, the tomcat-version directory, and so on.

    The templates directory in turn contains a template called insight that contains the Spring Insight feature.

    See Overview of tc Server Directories, Variables, and Configuration Files for details.

  5. Create a tc Runtime instance that contains Spring Insight by specifying the insight template. The exact steps depend on your platform (Unix or Windows.

    Unix: Change to the /home/tcserver/springsource-tc-server-developer directory and execute the tcruntime-instance.sh script to create an instance. For example:

    prompt$ cd /home/tcserver/springsource-tc-server-developer
    prompt$ ./tcruntime-instance.sh create insight-instance -t insight

    Windows: Change to the c:\home\tcserver\springsource-tc-server-developer directory and execute the tcruntime-instance.bat script to create an instance:

    prompt> cd c:\home\tcserver\springsource-tc-server-developer
    prompt> tcruntime-instance.bat create insight-instance -t insight
  6. Start the new tc Runtime instance. The exact steps depend on your platform (Unix or Windows.)

    Unix: Execute the tcruntime-ctl.sh script to start the instance. For example:

    prompt$ ./tcruntime-ctl.sh insight-instance start

    Windows: Execute the tcruntime-ctl.bat script to first install the tc Runtime instance as a Windows service and then start it:

    prompt> tcruntime-ctl.bat insight-instance install
    prompt> tcruntime-ctl.bat insight-instance start

    Subsequently, Springsource recommends that you start and stop the tc Runtime instance by using the Windows Services console. The tc Runtime instance is displayed in the console with the name SpringSource tc Runtime - unique-name, where unique-name is a unique combination of server name and server directory.

  7. After the tc Runtime instance starts, invoke Spring Insight in your browser:

    http://host:8080/insight

    where host refers to the computer on which it is running; if this is the same computer as the browser, you can use localhost:

    http://localhost:8080/insight

See Using Spring Insight for overview and usage information about Spring Insight as well as information about creating plug-ins that extend Spring Insight.

For general tc Server post-installation tasks discussed in this section, such as creating tc Runtime instances and starting them, see Next Steps.

Installing Standard Edition (tc Runtime Only)

  1. Download and install a JDK or JRE, if you do not already have one installed on your computer. See Before you Begin: System Requirements.

  2. On the SpringSource Download Center page under tc Server, click the tc Server Standard Edition link and navigate to the download page.

  3. Download the Standard Edition Runtime package distribution.

    Choose the ZIP or the compressed TAR file distribution:

    • springsource-tc-server-standard-2.1.X.RELEASE.zip
    • springsource-tc-server-standard-2.1.X.RELEASE.tar.gz
  4. Open a terminal (Unix) or command window (Windows) and create the main tc Server installation directory, such as /home/tcserver. For example, on Unix:

    prompt$ mkdir /home/tcserver
  5. Unzip or untar the tc Server distribution file into the new directory.

    This action is all that is required to install tc Runtime; there is no installer program.

    For example, if you created a directory called /home/tcserver in the preceding step, and downloaded the Standard Edition file in the /home/Downloads directory:

    prompt$ cd /home/tcserver
    prompt$ unzip /home/Downloads/springsource-tc-server-standard-2.1.0-RELEASE.zip

    This creates a directory called springsource-tc-server-standard in the main tc Server installation directory that contains the tc Runtime utility scripts, the templates directory, the tomcat-version directory, and so on.

    See Overview of tc Server Directories, Variables, and Configuration Files for details.

See Next Steps for links to post-installation procedures.

Installing Standard Edition (Including HQ Management Components)

This section describes how to install one or more instances of tc Runtime and HQ Agent together (also referred to as a managed node), as well as a single HQ Server; assuming the HQ components are version 4.5 or later, both HQ components automatically include the tc Server HQ plug-in.

Read How tc Server and HQ Work Together to understand the various installation scenarios for managed nodes and the HQ Server. Then decide which tc Server components (tc Runtime, HQ Agent, and HQ Server) you are going to install on your computer(s). The typical scenarios are:

  • Install all components on the same computer.

  • Install HQ Server on one computer and install the managed node (HQ Agent and tc Runtime) on one or more different computers.

The procedure below breaks the steps into those you do on the managed node computer(s) and those you do on the HQ Server computer. If you are installing everything on the same computer, then simply execute all steps on the same computer.

[Note]Note

If you will be installing tc Runtime instances on multiple computers you must install HQ Agent on each computer.

If you have an existing HQ installation, see Upgrade and Migration Guide for details about upgrading HQ with the tc Server HQ plug-in.

  1. On the computer on which you are going to install the managed node (tc Runtime and HQ Agent), download and install a JDK or JRE, if you have not already done so. See Before You Begin: System Requirements.

  2. Open a terminal (Unix) or command prompt (Windows) and create two new directories: one that will contain the tc Runtime component (such as /home/tcserver) and one that will contain the HQ Agent (such as /home/hyperic.) If you wish, you can install tc Runtime and HQ Agent in the same directory, but it is assumed in this procedure that you will install them in different directories. For example, on Unix:

    prompt$ mkdir /home/tcserver
    prompt$ mkdir /home/hyperic
  3. From the SpringSource Download Center, download the tc Server Standard Edition distribution. Choose the ZIP or compressed TAR file distribution:

    • springsource-tc-server-standard-2.1.X.RELEASE.zip
    • springsource-tc-server-standard-2.1.X.RELEASE.tar.gz
  4. Unzip or untar the tc Server distribution file into the /home/tcserver directory.

    This action is all that is required to install tc Runtime; there is no installer program.

    For example, if you created a directory called /home/tcserver in the preceding step, and downloaded the Standard Edition file in the /home/Downloads directory:

    prompt$ cd /home/tcserver
    prompt$ unzip /home/Downloads/springsource-tc-server-standard-2.1.0-RELEASE.zip

    A directory called springsource-tc-server-standard is created in the main tc Server installation directory that contains the tc Runtime utility scripts, the templates directory, the tomcat-version directory, and so on.

    See Overview of tc Server Directories, Variables, and Configuration Files for details.

  5. From the Hyperic Download Center, download the Agent-only 4.5 Hyperic HQ EE distribution and unpack it into the /home/hyperic directory.

    The HQ Agent will be installed in the directory /home/hyperic/agent-4.5.X.X-EE.

  6. On the computer on which you are going to install HQ Server, determine whether you need to download and install a JDK/JRE or dataabse server. You typically only need to do this if you are installing the platform-neutral version of HQ Server; the platform-specific version bundles a JDK/JRE and non-production database server to get you started. See Before you Begin: System Requirements.

    If you are using your own database server, obtain the URL and username/password used to connect to it, because the installation program for HQ Server will ask for it.

  7. Open a terminal (Unix) or command prompt (Windows) and create the directory that will contain the HQ Server, such as /home/hyperic. For example, on Unix:

    prompt$ mkdir /home/hyperic

    If you are installing all components on the same computer, you can install the HQ Server into the HQ Agent or tc Runtime directory that you already created (/home/tcserver in our example.)

  8. From the Hyperic Download Center, download the Hyperic HQ EE (Enterprise Edition) distribution and unpack it into a temporary directory.

    Be sure you download version 4.5 of HQ which automatically includes the tc Server HQ plug-in. You can download a distribution for your particular platform, such as Windows or Linux, or you can download a platform-neutral distribution that does not contain a JDK or database (labelled noJRE.)

  9. From your terminal window or command prompt, change to the temporary directory in which you unpacked the HQ distribution and execute the setup.sh (Unix) or setup.bat (Windows) script.

    For example, if you downloaded and unpacked the HQ distribution into the /home/Downloads directory, you will have a sub-directory called hyperic-hq-installer:

    prompt$ cd /home/Downloads/hyperic-hq-installer
    prompt$ ./setup.sh

    After accepting the terms of agreement, enter 1 to install just the HQ Server (you installed the HQ Agent in a preceding step.) The script asks a few more questions, such as an encryption key for encrypting the database-user password and the directory in which you will install HQ Server (/home/hyperic in our example.) If you are installing a platform-specific version of HQ, the setup.sh script might ask you to run another script as the root user. If you are installing the platform-neutral version of HQ, the script asks for information about your database, including the database URL, name and password of the user that connects to the database. For more information, see the vFabric Hyperic Documentation.

    When the setup.sh script completes, HQ Server is installed in /home/hyperic/server-4.5.X.X-EE.

    See Installing the Agent and Server from a Tarball or Zip Archive for additional details about the questions asked by the setup.sh script.

See Next Steps for links to post-installation procedures.

Installing Spring Edition

  1. On the SpringSource Download Center page under tc Server, click the tc Server Spring Edition link and navigate to the download page. You will see downloads for the tc Server Standard Edition and the Instrumented Spring JARs.

  2. Follow the instructions in Installing Standard Edition (Including HQ Management Compnents) to download and install the tc Server managed node and HQ Server.

  3. Download the distributions of Spring Framework, Spring Web Flow, Spring Security, and Spring Web Services that have been specifically instrumented for management with Hyperic HQ.

  4. See Spring Instrumentation Documentation for information about using these instrumented JARs with your Spring application.

Next Steps

See Overview of tc Server Directories, Variables, and Configuration Files for conceptual information about tc Server directories and configuration files. See Post-Installation Tasks for the list of typical post-installation procedures, such as creating tc Runtime instances, starting the various components of tc Server and getting started with the HQ user interface.

Then try out the tutorials: Tutorial: Using HQ to Configure and Manage tc Runtime Instances and Tutorial: Very Simple Web Application Development.

6.3 Overview of tc Server Directories, Variables, and Configuration Files

This section provides basic reference information about the tc Server installation directories and the most important configuration files.

When you install the tc Runtime component, you simply unpack the appropriate *.zip or *.tar.gz file into the main installation directory. This creates a springsource-tc-server-edition subdirectory, where edition refers to the edition of tc Server you are using (standard or developer.) This subdirectory in turn contains all tc Server-related files and directories. In particular:

  • tomcat-version. Where version is the version of the core Apache Tomcat on which this version of the tc Runtime is based, such as tomcat-6.0.25.A-RELEASE : This is the basic Apache Tomcat CATALINA_HOME directory; users of standard Apache Tomcat will recognize its contents. The Tomcat binaries are in the bin directory, the server configuration files for the default Tomcat server instance are in the conf directory, and so on.

  • templates. Out-of-the-box templates for creating customized tc Runtime instances, such as cluster-node enabled or SSL-ready. You optionally specify one or more of these templates when you run the tcruntime-instance.sh|bat script to create a new tc Runtime instance.

  • lib. JAR files used by tc Runtime that are different to standard Apache Tomcat.

  • tcruntime-instance.sh|bat. Scripts for creating new tc Runtime instances.

    When you create a new tc Runtime instance with this script, the script creates (by default) a subdirectory of the springsource-tc-server-edition directory with the same name as the new tc Runtime instance; this new directory is the CATALINA_BASE of the tc Runtime instance. The new directory contains the instance-specific configuration files, its own Web application deployment directory, log files, and so on.

  • tcruntime-ctl.sh|bat. Scripts for controlling tc Runtime instances, such as starting or stopping them. The bin directories of individual tc Runtime instances include their own versions of these scripts that in turn call these main ones. You can also call the top-level scripts if you specify the name of the tc Runtime instance.

tc Server Variables

The following tc Server variables are used:

  • CATALINA_HOME. Root directory of your tc Runtime installation.

    The CATALINA_HOME variable points to the directory INSTALL_DIR/springsource-tc-server-edition/tomcat-version, where INSTALL_DIR is the directory in which you installed tc Server (such as /home/tcserver), edition refers to the edition of tc Server you are using (developer or standard), and version is the version of the core Tomcat, such as 6.0.25.A-RELEASE.

  • CATALINA_BASE. Root directory of a particular tc Runtime instance.

    This directory contains the instance-specific files, such as the conf/server.xml file that configures this particular instance. If you created a tc Runtime instance called myserver and you are using the Standard Edition, then the CATALINA_BASE of the instance is INSTALL_DIR/springsource-tc-server-standard/myserver by default.

The following variables are "exposed" by tc Runtime, which means that you can set them or use them in your environment (or in the bin/setenv.sh file of your tc Runtime instance) to achieve the specified results:

  • CATALINA_OUT. Unix only. Use this environment variable to specify a file to which a tc Runtime instance writes stdout and stderr messages. If you do not explicitly set this environment variable, then the tc Runtime instance writes stdout and stderr messages to the file CATALINA_BASE/logs/catalina.out.

    For example, to specify that all the tc Runtime instance write its stdout and stderr messages to /home/tcserver/tomcat-instance-6.log, set the variable in your environment or setenv.sh as follows:

    CATALINA_OUT=/home/tcserver/tomcat-instance-6.log
  • INSTANCE_NAME. Name of the tc Runtime instance. You can use this variable to create other unique variables within configuration scripts.

    For example, on Unix platforms you can update the bin/setenv.sh file to use the name of the tc Runtime instance when defining the CATALINA_OPTS variable as follows:

    CATALINA_OPTS="-Dinstance.name=$INSTANCE_NAME"

    On Windows, the equivalent change would be to the conf/wrapper.conf file as follows:

    set CATALINA_OPTS=-Dinstance.name=%INSTANCE_NAME%
  • INSTANCE_BASE. Specifies the parent directory of the tc Runtime instance. The full pathname of the tc Runtime instance directory would be $INSTANCE_BASE/$INSTANCE_NAME.

    You can use the INSTANCE_BASE variable in the same way as the INSTANCE_NAME variable, as described in the preceding bullet.

tc Runtime Instance Directory Structure

After you create a new tc Runtime instance, its CATALINA_BASE directory contains the following sub-directories:

  • bin. Contains the tcruntime-ctl.* scripts to start and stop tc Runtime instances, as well as the setenv.* scripts. The *.sh Unix files are functional duplicates of the *.bat Windows files.

  • conf. Contains the configuration files for the tc Runtime instance, such as server.xml, catalina.properties, web.xml, context.xml, and so on.

  • lib. Contains resources shared by all Web applications deployed to the tc Runtime instance.

  • logs. Location of the logs files.

  • webapps. Deployment directory for the Web applications deployed to the tc Runtime instance.

  • work. Temporary work directory for all deployed Web applications.

  • temp. Directory used by the JVM for temporary files.

tc Runtime Instance Configuration Files

You configure a particular tc Runtime instance by changing its configuration files (either by editing the XML file manually or through the HQ user interface); later chapters of this documentation describe how to do this. All the configuration files for a tc Runtime instance are located in its CATALINA_BASE/conf directory. The most important configuration files are as follows:

  • server.xml. Main configuration file for a tc Runtime instance. It configures the behavior of the servlet/JSP container.

    By default, the server.xml file for a tc Runtime instance uses variable substitution for configuration properties that must be unique across multiple tc Runtime instances on the computer, such as HTTP and JMX port numbers. These variables take the form ${var}. For example, the variable for the HTTP port that the tc Runtime instance listens to is ${http.port}. The specific values for these variables for a particular tc Runtime instance are stored in the catalina.properties file, in the same directory as the server.xml file.

  • catalina.properties. Properties file that contains the tc Runtime instance-specific values for variables in the server.xml file.

  • context.xml. Configures the context that is loaded by all Web applications deployed to the tc Runtime instance.

  • web.xml. Default web.xml file that is loaded by all deployed Web applications, in addition to their individual web.xml files.

  • wrapper.conf. Windows only. Configures the Java Service Wrapper from Tanuki Software used to install the tc Runtime instance as a Windows service. The Wrapper correctly handles user log outs under Windows, service dependencies, and the ability to run services that interact with the desktop.

  • jmxremote.access and jmxremote.password. Configures the JMX users and passwords.

  • logging.properties. Configures the logging system of the tc Runtime instance.

7. Post-Installation Tasks

After you install the components of tc Server on all relevant computers, you perform some or all of the following post-installation tasks, depending on the edition of tc Server: Start and run the HQ Server and agents; create and start tc Runtime instances; deploy Web applications to an instance; or invoke and use the HQ user interface to monitor and configure tc Runtime instances. (As a performance-monitoring alternative to HQ, you can install and configure Spring Insight. See Using Spring Insight.)

7.1 Creating a New tc Runtime Instance

The following sections describe how to create new instances of tc Runtime and provide related information:

The procedural topics cover both Unix and Windows commands. The documentation uses Unix-like forward slashes (/) for directories; if you are on a Windows platform, change these to back slashes (\).

Creating tc Runtime Instances: Typical Steps

This section describes the simplest way to create a new tc Runtime instance. For an explanation of the type of instance that the example creates, see the description following the procedure.

  1. Open a terminal window (Unix) or command prompt (Windows).

  2. Change to the INSTALL_DIR/springsource-tc-server-edition directory, where INSTALL_DIR refers to the main tc Server installation directory, such as /home/tcserver and edition refers to the edition of tc Server you are using (developer or standard.) For example:

    prompt$ cd /home/tcserver/springsource-tc-server-standard
  3. Run the tcruntime-instance.sh (Unix) or tcruntime-instance.bat (Windows) script, passing it the create serverName parameter. Replace serverName with the name of your new tc Runtime instance. See Best Practice: Naming tc Runtime Instances for tips on naming an instance.

    For example, on Unix:

    prompt$ ./tcruntime-instance.sh create myserver 

    On Windows:

    prompt> tcruntime-instance.bat create myserver 

When the preceding sample command completes, the new tc Runtime instance is located by default in the INSTALL_DIR/springsource-tc-server-edition/myserver directory (such as /home/tcserver/springsource-tc-server-standard/myserver); you can specify a different instance directory with the --instance-directory directory option. This directory is also the value of the CATALINA_BASE variable for this tc Runtime instance. For example:

prompt> tcruntime-instance.bat create myserver --instance-directory /home/tcserver/instances

In the preceding example, the myserver instance directory will be /home/tcserver/instances/myserver.

By default, the tc Runtime instance uses the JAVA_HOME environment variable for the Java binaries, or the instance uses the java binary that it found in the PATH environment variable when it started. Because the location of the Java binaries has not been explicitly set, the tc Runtime instance is portable; see Creating Portable tc Runtime Instances for more information. You can specify a different JAVA_HOME using the --java-home option.

The ports of the tc Runtime instance are the default values:

  • HTTP listen port: 8080

  • JMX port: 6969

  • AJP port: 8009

  • Shutdown port: -1

Because the preceding sample use of tcruntime-instance.sh|bat did not specify the --version option, the version of the tc Runtime instance is unpinned. This means that when you use the tcruntime-ctl.sh|bat script to start the instance, the script uses the highest version of the tc Runtime it can find in the installation directory, for example 6.0.29.A-RELEASE. See Pinning tc Runtime Instances to a Specific Version for more information.

When you use the tcruntime-instance.sh|bat command script to create an instance, you can specify additional optional parameters, as described in tcruntime-instance.sh Reference. For example, you can use the --property option to specify a configuration property.

tcruntime-instance.sh Reference

The tcruntime-instance.sh|bat command script has four possible commands, used to create or modify a tc Runtime instance, list the existing instances, or display help for the command script. Each command has its own set of options, as described in the tables later in this section. Depending on the command, you must specify the name of a tc Runtime instance. The general syntax for each of the four commands is as follows; click on the link to see the options for that particular command:

tcruntime-instance create instance-name [options]
tcruntime-instance modify-version instance-name [options]
tcruntime-instance list [options]
tcruntime-instance help [command-name]

The create Command

Use the create command to create a new tc Runtime instance.

The command requires that you specify a name for the new tc Runtime instance directly after the create text.

When you create a new instance, and you do not specify the --template option to apply one or more specific templates, the tcruntime-instance script creates a basic tc Runtime instance that uses the default template (called bio); this template adds the Blocking IO (BIO) HTTP Connector to the server.xml of the instance. You can use the --template option to apply one or more templates so that the instance is automatically configured for a particular feature, such as the NIO connector, clustering, or SSL.

Examples of creating new tc Runtime instances are shown after the options reference table.

The following table list options for the create command of tcruntime-instance.sh|bat. When specifying the most common options, you can use either the short form (such as -i) or the long form (such as --instance-directory); less common options support only the long form.

Table 7.1. Options of the create Command

Option (Long Form)Option (Short Form, if available)Description
--forceN/AForces the script to create a new tc Runtime instance, even if one already exists. By default the script does not force the creation.

If you specify this parameter and a tc Runtime instance with the name already exists, the script replaces only the existing bin and conf directories; the script does not replace the other directories, such as lib or temp. It is assumed in this case that you want to replace only the Tomcat-specific files (typically because you're updating the Tomcat version), but do not want to touch the user-specific files, such as Web applications.

--help-hOutputs usage information about the create command usage.
--interactiveN/ATells the script to interactively ask for configuration properties. For example, use this parameter if you want to change the default port numbers, as listed in Creating tc Runtime Instances: Typical Steps.

Warning: Be sure that all tc Runtime instances on the same computer have unique port numbers.

--instance-directory instanceDir-i instanceDirReplace instanceDir with the full or relative pathname of the directory in which you want the new tc Runtime instance to be created. If you specify a relative directory pathname, the directory is relative to the directory from which you are running the tcruntime-instance.sh|bat script.

The default value of this option is the current working directory.

--java-home

--java-home path_to_jdk

N/AIf specified without a path_to_jdk value, hard-codes the JAVA_HOME variable in various files of the instance, using the global JAVA_HOME environment variable value. You can also use this option to specify a different location of the JDK. In this case, replace path_to_jdk with the full pathname of the JDK.

If you do not specify this option at all, then the instance uses the JAVA_HOME global environment variable, and does not hard-code the value anywhere.

--layout layoutN/ASpecifies the type of layout you want your new tc Runtime instance to use: separate or combined. The default value is separate.

In the separate layout, CATALINA_HOME and CATALINA_BASE point to different directories; in the combined layout they point to the same directory, which means that the tc Runtime binaries are bundled within your instance. The combined layout most closely resembles the standard Apache Tomcat layout.

Warning: SpringSource recommends that you always use the separate layout, which is why it is the default value if you do not specify this option. For additional information, see Differences Between the Separate and Combined Layouts.

--properties-file file-f fileSpecifies the name of a properties file that contains configuration properties that you want to apply to the new tc Runtime instance.

When you create the properties file, it should contain one property per line, in the form template-name.property-name=value. The name of the property depends on the template. For example, the default template (called bio) has two configuration properties: http.port and https.port. Other templates might specify their own configuration properties. If you want to pass your own values of these properties to the tcruntime-instance script at the command line, rather than the instance taking the default values, create a file such as the following:

bio.http.port=9090

bio.https.port=9191

Then point to this configuration property file using this option:

--properties-file my-property-file

--property template.property=value-p template.property=valueSpecifies a single configuration that you want to apply to the new tc Runtime instance.

When you create a tc Runtime instance, the tcruntime-instance script always applies a template, even if it is the default one (called bio). Templates usually have configuration properties. For example, the bio template has two configuration properties: http.port and https.port. Other templates might specify their own configuration properties. If you want to pass your own values of these properties to the tcruntime-instance script at the command line, rather than the instance taking the default values, use this option to specify the property in the form template-name.property-name=value.

For example, to specify that the HTTP port for a new tc Runtime instance that uses the default template is 9090, specify the property as follows:

--property bio.http.port=9090

--template template_name-t template_nameApplies a template to a newly-created tc Runtime instance. You can specify this option multiple times to apply multiple templates to the instance.

In this context, a tc Runtime template refers to a set of customized tc Runtime files that the tcruntime-instance script copies to or merges with the instance it just created.

The template files are organized in the standard Tomcat hierarchy; for example, configuration files are in the conf directory and binary files are in the bin directory. Changes to the conf/server.xml or conf/context.xml files of the instance are contained in template files called conf/server-fragment.xml or conf/context-fragment.xml, respectively. These fragment XML files contain just the additions, deletions, or changes that will be applied to the base tc Runtime instance. When the tcruntime-instance script applies the template after it has created a new base instance, it merges server-fragment.xml or context-fragment.xml files with their base originals, or it might replace other instance files, depending on the contents of the template. For example, the template might copy one or more applications to the webapps directory so that they are automatically deployed on startup.

If you use this option to specify one or more templates that do not add a <Connector> element to the server.xml configuration file, the tcruntime-instance script automatically adds a Blocking IO (BIO) HTTP Connector to the instance. If your templates include a <Connector> element, then the script does not add a BIO Connector.

Replace the template_name argument with the name of an existing subdirectory of the INSTALL_DIR/springsource-tc-server-edition/templates directory, where edition refers to the Edition of tc Server you are using (developer or standard.) An example of an existing template is apr-ssl or cluster-node.

For additional details and examples about this using this feature, see Creating a tc Runtime Instance with a Template.


The following example shows how be be interactively prompted for configuration properties (such as port numbers) and that you want the new tc Runtime instance to be located in the /home/tcserver/instances directory:

prompt$ ./tcruntime-instance.sh create myserver --instance-directory /home/tcserver/instances
    --interactive

The following example shows how to pin a new instance to version 6.0.29.A-RELEASE of tc Runtime and to specify a hard-coded value for JAVA_HOME:

prompt$ ./tcruntime-instance.sh create myserver --version 6.0.29.A-RELEASE
    --java-home /home/java/jdk1.6.0_12

The following example shows how to pass the value 9090 to the http.port configuration property of the default template (called bio), rather than use the default value of 8080:

prompt$ ./tcruntime-instance.sh create myserver --property bio.http.port=9090

The modify-version Command

Use the modify-version command to modify the version of tc Runtime used by an existing instance that is pinned to a particular version of tc Runtime .

Use the --version option to specify the new version of the instance. If you do not specify --version, the resulting instance is unpinned, which means it uses the latest available version of tc Runtime. See Pinning tc Runtime Instances to a Version.

Note: It is assumed that you have already installed the tc Runtime version to which you want to modify the existing instance.

Examples of modifying existing tc Runtime instances are shown after the options reference table.

The following table list options for the modify-version command of tcruntime-instance.sh|bat. When specifying the options, you can use either the short form (such as -i) or the long form (such as --instance-directory)

Table 7.2. Options of the modify-version Command

Option (Long Form)Option (Short Form)Description
--version version-v versionPins the instance to the specified version of tc Runtime, such as 6.0.29.A-RELEASE. See Pinning a tc Runtime Instance to a Specific Version for a discussion of pinning.

Valid values depend on the versions of Tomcat that you have installed. The tcruntime-instance.sh script determines the list of available versions by searching for INSTALL_DIR/tomcat-XXX directories, where XXX follows a pattern such as 6.0.29.A-RELEASE. You can check for these directories to determine which versions to which you can pin a tc Runtime instance.

If you do not specify this option, the instance is unpinned to a tc Runtime version, which means that when you use the tcruntime-ctl.sh|bat script to start the instance, the script searches for the highest version and applies it to the instance. For example, if 6.0.24.A-RELEASE, 6.0.24.B-RELEASE and 6.0.29.A-RELEASE are all present, and you don't specify this option, then the start script automatically picks 6.0.29.A-RELEASE as the version of the instance.

--instance-directory instanceDir-i instanceDirReplace instanceDir with the full or relative pathname of the directory that contains the tc Runtime instance you want to modify. If you specify a relative directory pathname, the directory is relative to the directory from which you are running the tcruntime-instance.sh|bat script.

The default value of this option is the current working directory.

--help-hOutputs usage information about the modify-version command usage.

The following example shows how to modify an existing tc Runtime instance called myotherserver to use version 6.0.29.A-RELEASE of tc Runtime; the resulting instance will be pinned to this version:

prompt$ ./tcruntime-instance.sh modify-version myotherserver --version 6.0.29.A-RELEASE 

The following example shows how to unpin the myotherserver instance so it always uses the latest available version of Tomcat when it starts:

prompt$ ./tcruntime-instance.sh modify-version myotherserver 

The list Command

Use the list command to list the instances known to the tc Runtime. For each instance, the command outputs additional information, such as the parent directory of the instance, the directories that contain its command scripts and binaries, the version of the instance (both base Tomcat version and tc Server version), and whether the instance is currently running.

The following table lists options for the list command of tcruntime-instance.sh|bat. When specifying the options, you can use either the short form (such as -i) or the long form (such as --instance-directory)

Table 7.3. Options of the list Command

Option (Long Form)Option (Short Form)Description
--instance-directory instanceDir-i instanceDirReplace instanceDir with the full or relative pathname of the directory that contains the tc Runtime instances for which you want a listing. If you specify a relative directory pathname, the directory is relative to the directory from which you are running the tcruntime-instance.sh|bat script.

The default value of this option is the current working directory.

--help-hOutputs usage information about the list command usage.

The following example shows how to output the list of known instances located in the default tc Server installation directory:

prompt$ cd /home/tcserver/springsource-tc-server-standard
prompt$ ./tcruntime-instance.sh list

The following example shows how to list the instances located in the /home/tcserver/instances directory:

prompt$ ./tcruntime-instance.sh list --instance-directory /home/tcserver/instances 

Getting Help for tcruntime-instance

To view a summary of all available commands of the tcruntime-instance script, use the help command:

prompt$ ./tcruntime-instance.sh help

To view the usage information about a particular command, specify the name of the command after the help command:

prompt$ ./tcruntime-instance.sh help create

The output includes brief information about the available options. You can also use the --help option of the commands to view the same information:

prompt$ ./tcruntime-instance.sh create -h
prompt$ ./tcruntime-instance.sh create --help

Pinning tc Runtime Instances to a Specific Version

Depending on whether you explicitly specify the --version parameter of the tcruntime-instance.sh|bat script when you create an instance, the resulting tc Runtime instance is either pinned or unpinned to a particular version of tc Runtime. Specifically:

  • If you explicitly specify the --version parameter, the tc Runtime instance is pinned to that version. This means that when you use the tcruntime-ctl.sh|bat script to start the instance, the instance always uses this tc Runtime version, even if you have installed a more recent version of the tc Runtime.

  • If you do not specify the --version parameter, the tc Runtime instance is unpinned. This means that when you use the tcruntime-ctl.sh|bat script to start the instance, the script searches for the most recent version of tc Runtime and applies it to the instance.

To determine the list of available versions, search for INSTALL_DIR/tomcat-XXX directories, where XXX follows a pattern such as 6.0.29.A-RELEASE.

For example, if you create a new instance using the following command:

prompt$ ./tcruntime-instance.sh create myserver --version 6.0.29.A-RELEASE

the myserver instance will always use version 6.0.29.A-RELEASE of the tc Runtime, even if a more recent version is installed. If, however, you do not specify the --version parameter, for example:

prompt$ ./tcruntime-instance.sh create myserver 

the myserver instance always uses the latest version of tc Runtime that is currently installed. Thus if you later install a new version of tc Runtime (which means that there will be a new tomcat-6.0.X.X-X directory alongside the existing ones), and start the unpinned myserver instance using the tcruntime-ctl.sh|bat script, the instance automatically uses the latest tc Runtime version without your having to explicitly do anything.

To determine whether an existing tc Runtime instance is pinned, check for the file INSTANCE-DIR/conf/tomcat.version; if the file exists, then the instance is pinned to the version specified in the file.

To change the version of a pinned instance, use the modify-version command together with --version to specify the new version. For example:

prompt$ ./tcruntime-instance.sh modify-version myserver --version 6.0.26.A-RELEASE

Finally, if you want to convert a currently pinned instance to one that is unpinned, use the modify-version command without --version. For example:

prompt$ ./tcruntime-instance.sh modify-version myserver 

Best Practice: Naming tc Runtime Instances

The name of a tc Runtime instance is the name of its CATALINA_BASE directory, minus the leading directory paths. As a reminder, CATALINA_BASE is the base directory of the instance; this directory contains the instance-specific startup scripts in the bin sub-directory, the configuration files in the conf sub-directory, and so on. For example, if you create a tc Runtime instance in the /home/tcserver/springsource-tc-server-standard/myServer directory, then its name is myServer.

The HQ user interface also uses this naming convention when first identifying a tc Runtime instance. In particular, the HQ user interface displays an instance with the name platform-resource tc Runtime catalina-base-dir, where platform-resource refers to the computer on which the tc Runtime instance is running and catalina-base-dir refers to the CATALINA_BASE directory of the tc Runtime instance without the leading directory pathnames. The HQ user interface uses the full pathname of CATALINA_BASE as the default description of the instance.

This means, however, that if you create two instances whose full pathnames differ, but their main installation directory names are the same, the instances will show up in the HQ user interface with the same names. This makes it difficult to differentiate multiple tc Runtime instances from each other, although you can always look at the description for the full pathname. For example, assume you have two instances in the following directories running on a computer identified as my-desktop in HQ:

  • /home/tcserver1/springsource-tc-server-standard/myServer

  • /home/tcserver2/springsource-tc-server-standard/myServer

Although they are completely different instances, they will both show up in the HQ user interface with the name my-desktop tc Runtime myServer.

For this reason, SpringSource recommends as a best practice that you use unique names for the main installation directory for each tc Runtime instance on the same computer. For example, the following two instances will show up in the HQ user interface with different names:

  • /home/tcserver1/springsource-tc-server-standard/myServer

  • /home/tcserver2/springsource-tc-server-standard/myOtherServer

Creating a tc Runtime Instance with a Template

Templates make it easier for you to automatically configure certain tc Runtime features at the time you create a tc Runtime instance. These features include SSL, clustering, and so on.

You use the --template option to specify a template to the tcruntime-instance script when you create a new tc Runtime instance. You can specify the --template option multiple times if you want to apply multiple templates, such as clustering and SSL.

When you create a tc Runtime instance using tcruntime-instance, the script performs the following high-level steps:

  • Creates the instance directory and applies the base template to it. This template provides the configuration that is common to all tc Runtime instances, such as ensuring that the instance can be monitored with HQ.

  • If you did not specify a template with the --template option, then the script applies the default template (called bio). This template adds a Blocking IO (BIO) HTTP Connector to the instance's server.xml file.

    If you specified one or more templates with the --template option, the script applies each template in order. The templates might update the instance's server.xml or context.xml file as well as copy over other files, such as JARS. If the specified templates do not add a <Connector> element to the server.xml configuration file, the tcruntime-instance script automatically adds a Blocking IO (BIO) HTTP Connector to the instance. If your templates include a <Connector> element, then the script does not add a BIO Connector.

  • Applies any needed configuration properties. The script gets the value of these properties either interactively from you, from the --property or --properties-file options you might have specified at the command-line, or from the default property values if no value is provided.

A template is simply a directory under the INSTALL-DIR/templates directory that contains additional or customized tc Runtime instance files. For example, the directory might contain a conf/server-fragment.xml file, which the tcruntime-instance script uses to update the base server.xml file with the relevant feature. The directory might also contain additional JAR files.

An example of creating an instance using the nio-ssl template is as follows:

prompt$ ./tcruntime-instance.sh create myserver --template nio-ssl

To use this feature, the specified template must already exist. You can use one of the out-of-the-box templates.

The files that make up a template reside in a single directory; the name of the template directory is the name of the template. The template files are organized in the standard Tomcat subdirectory hierarchy. For example, configuration files live in the conf subdirectory and JAR files live in the lib subdirectory. The configuration files in the conf template directory are actually just fragments of XML, called server-fragment.xml or context-fragment.xml, that contain just the additions, deletions, or changes that the script applies to the base instance. When the tcruntime-instance script applies the template after it has created a new base tc Runtime instance, it merges the XML fragment files with the corresponding base conf/server.xml or conf/context.xml file, and copies over any other files, such as JARS. Depending on the contents of the template directory, the new tc Runtime instance might be quite different from the standard one. For example, the template might modify the standard server.xml file with additional server configuration, or copy one or more applications to the webapps directory so that they are automatically deployed on startup.

The argument to the --template option must be the tc Runtime template directory. The tcruntime-instance script looks for the template directory in the INSTALL_DIR/springsource-tc-server-edition/templates directory, where edition refers to the Edition of tc Server you are using (developer or standard.)

You can specify the --template option multiple times; the tcruntime-instance script applies each template in the order given. First the script copies over any non-configuration files to tha appropriate instance directory, and then the script merges the configuration file fragments with the instance configuration files. You will receive a warning if the creation of the instance copies over files with the same name and directory location from two or more different templates.

The following example shows how to create a new tc Runtime instance called myserver using the nio out-of-the-box template which adds a NIO Connector to the server.xml file:

prompt$ ./tcruntime-instance.sh create myserver --template nio

In the preceding example, because it does not specify the --version or --java-home options, the instance is unpinned, and thus uses the latest installed version of tc Runtime, and the instance uses the value of JAVA_HOME in the environment.

The following example shows how to create an instance that uses two templates:

prompt$ ./tcruntime-instance.sh create myserver --template insight --template jmx-ssl

Note that the insight template is available only in the Developer Edition of tc Server.

Templates Provided by tc Runtime

SpringSource tc Runtime provides a number of out-of-the-box templates. Most are server configuration related; for example, one template sets up a basic cluster node configuration and another sets up SSL. Some templates are provided only in certain editions of tc Server, such as the insight template in the Developer Edition.

You can download a tc Server template for setting up HTTP session replication using VMware vFabric GemFire, the in-memory distributed data management platform, from the VMware vFabric GemFire section of the VMware Download Center. See Setting Up GemFire HTTP Session Management for tc Server at the GemFire community website for instructions for using the template.

The following example shows how to use the nio out-of-the-box template to create a tc Runtime instance that is automatically configured with the NIO Connector in its server.xml file:

prompt$ ./tcruntime-instance.sh create myserver-nio --template nio

Because the nio template is in the templates directory, you simply specify its name at the --template option.

The following table lists the templates that are provided by tc Runtime out-of-the-box and how each template differs from the generic tc Runtime instance (created without a specific template.) All templates are located in the INSTALL_DIR/springsource-tc-server-edition/templates, where edition refers to the edition of tc Server you installed (developer or standard.)

Table 7.4. Out-of-the-Box Templates Provided by tc Runtime

Template NameComparison with Default tc Runtime Instance
ajpThis template adds an Apache JServe Protocol (AJP) connector, which enables Apache web server to communicate with the tc Runtime instance. For details about the connector, see The AJP Connector in the Apache Tomcat Configuration Reference.
apr

This template:

  • Adds a APRLifecycleListener to detect the APR-based native library required to use the APR/native connector.

  • Adds the APR HTTPS connector.

NOTE: You must install the APR/native library in order to use the APR connector.

For more information, see Apache Portable Runtime (APR) based Native library for Tomcat on the Apache Tomcat Web site.

apr-ssl

This template:

  • Adds an APRLifecycleListener to detect the APR-based native library required to use the APR/native connector.

  • Adds an APR HTTPS connector.

  • Adds a sample certificate and key files for testing the SSL configuration.

    Warning: These sample certificates and key files are provided only to aid testing and debugging; they are not for production use. You must replace them with your own generated certificates and keys before moving to a production system.

NOTE: You must install the APR/native library in order to use the APR connector.

For more information, see Apache Portable Runtime (APR) based Native library for Tomcat and SSL Configuration HOW-TO on the Apache Tomcat Web site.

baseThis template is the base from which all new tc Runtime instances are created. It provides the configuration that is common to all tc Runtime instances, such as ensuring that the instance can be monitored with HQ.
bio

The tcruntime-instance script applies this default template if no other template is specified, or if the specified templates do not add a <Connector> element to the server.xml file.

This template adds a Blocking IO (BIO) HTTP Connector to the new instance's server.xml file.

bio-ssl

This template:

  • Adds a Blocking IO (BIO) HTTPS connector.

  • Adds a sample JKS keystore for testing the SSL configuration.

    Warning: The sample keystore is provided only to aid testing and debugging; it is not for production use. You must replace it with your own generated keystore before moving to a production system.

For more information, see The HTTP Connector and SSL Configuration HOW-TO on the Apache Tomcat Web site.

cluster-node

This template:

  • Adds the default Cluster configuration at the Engine level. By default, multicast discovery is used to identify other nodes in the cluster. If multicast is not enabled on the subnet or if multiple tc Runtime clusters may be present on the same subnet, reconfigure this cluster node to use static membership.

  • Adds the jvmRoute attribute to the Engine element to uniquely identify the node. This is parameterized using ${tcserver.node}, which is defined in the CATALINA_BASE/conf/catalina.properties file.

    tc Server provides a default value for the jvmRoute attribute. You can specify a value other than the default when you create the tc Runtime instance by specifying the cluster-node.node.name property using the --property option as follows: --property cluster-node.node.name=my-node.

Because this template does not specifically add a Connector to the instance's server.xml file, the tcruntime-instance script will automatically add a Blocking IO (BIO) HTTP Connector.

For more information, see Clustering/Session Replication HOW-TO on the Apache Tomcat Web site.

diagnostics

This template:

  • Adds a sample JDBC resource configuration that integrates with the request diagnostics to report slow queries.

  • Adds a ThreadDiagnosticsValve at the Engine level to report on slow running requests.

Because this template does not specifically add a Connector to the instance's server.xml file, the tcruntime-instance script will automatically add a Blocking IO (BIO) HTTP Connector.

insight

Developer Edition Only. This template adds the Spring Insight Web application to your instance. Spring Insight gives you real-time visibility into the behavior and performance of your user applications. See Using Spring Insight.

Because this template does not specifically add a Connector to the instance's server.xml file, the tcruntime-instance script will automatically add a Blocking IO (BIO) HTTP Connector.

jmx-ssl

This template:

  • Updates the JmxSocketListener to use SSL for all JMX communication

  • Adds a sample JKS keystore that you can use to test the JMX over SSL configuration.

    Warning: The sample keystore is provided only to aid testing and debugging; it is not for production use. You must replace it with your own generated keystore before moving to a production system.

Because this template does not specifically add a Connector to the instance's server.xml file, the tcruntime-instance script will automatically add a Blocking IO (BIO) HTTP Connector.

For more information, SSL Configuration HOW-TO on the Apache Tomcat Web site.

nio

This template adds a Non-Blocking IO (NIO) connector for HTTP.

For more information, see The HTTP Connector on the Apache Tomcat Web site.

nio-ssl

This template:

  • Adds an NIO HTTPS connector.

  • Adds a sample JKS keystore that you can use to test the SSL configuration.

    Warning: The sample keystore is provided only to aid testing and debugging; it is not for production use. You must replace it with your own generated keystore before moving to a production system.

For more information, see The HTTP Connector and SSL Configuration HOW-TO on the Apache Tomcat Web site.


Creating Portable tc Runtime Instances

A portable tc Runtime instance is one whose instance directory you can copy to a new directory name, and the instance still starts and works correctly without your having to update the instance configuration files.

To guarantee the portability of a newly-created tc Runtime instance, do not specify any options of tcruntime-instance.sh|bat. Use the INSTANCE-DIR/bin/tcruntime-ctl.sh|bat script to start and stop the instance.

For example, assume you created a tc Runtime instance called myserver in the main tc Server installation directory:

prompt$ cd /home/tcserver/springsource-tc-server-standard
prompt$ ./tcruntime-instance.sh create myserver

Because this instance is completely portable, you can copy the resulting instance directory to another location, and then start and use this new instance as if you had created it with the tcruntime-instance script. For example, assume you want to copy the myserver instance to the /home/tcserver/instances directory and call it myserver-new:

prompt$ cd /home/tcserver/springsource-tc-server-standard
prompt$ cp -r myserver ../instances/myserver-new
prompt$ cd ../instances/myserver-new/bin
prompt$ ./tcruntime-ctl.sh start

Important: Remember that when you copy an instance in this way, the ports that the two tc Runtime instances listen to will be the same. If you want to run both instances on the same computer, update the conf/catalina.properties file of one instance to differentiate the port name.

Possible Exceptions to Portability of a tc Runtime Instance

If you originally specified additional options of the tcruntime-instance.sh|bat script when you created the first tc Runtime instance, the instance is not guaranteed to be portable. However, depending on the environment of the location to which you copy the instance, the copied instance might still start and work correctly without your having to update any of its configuration files. In particular:

  • If you originally specified the --java-home option, then the tcruntime-instance.sh|bat script hardcoded the JAVA_HOME value in the resulting instance. If the copied instance would still use the same exact JAVA_HOME, then the instance is portable; otherwise, the instance will not start unless you modify this hardcoded JAVA_HOME variable.

  • If you specified the --version option to pin the tc Runtime instance to particular version of tc Runtime, the tcruntime-instance.sh|bat script created a file called conf/tomcat.version that specifies the version to which it is pinned. If you copy the instance to another location, it starts only if the corresponding tc Server installation also includes the exact version of the tc Runtime to which the instance is pinned.

    For example, if the file contains the string 6.0.29.A-RELEASE, then the tc Server main installation must contain a directory called tomcat-6.0.29.A-RELEASE.

Differences Between the Separate and Combined Layouts

You can create two flavors of tc Runtime instances, depending on the layout of their files:

  • Separate layout: In this layout, the instance's CATALINA_HOME and CATALINA_BASE point to two different directories. Typically, CATALINA_HOME points to a tomcat-6.0.X.X-RELEASE directory, which in turn contains the set of tc Runtime binaries that are shared by other instances that use the separate layout.

    SpringSource highly recommends you use this layout, which is why it is the default.

  • Combined layout: This layout closely resembles the standard Apache Tomcat layout where the instance's CATALINA_HOME and CATALINA_BASE point to the same directory. This means that each instance that uses the combined layout has its own copy of the tc Runtime binaries. For this reason, it is very difficult to upgrade to a new version of tc Runtime.

    SpringSource does not recommend you use this layout, mostly because it is so difficult to upgrade instances. The main reason for using it is if you are familiar with the Apache Tomcat layout and want to continue to use it in your environment.

7.2 Starting and Stopping tc Runtime Instances

The following sections describe how to start and stop tc Runtime instances on both Unix and Windows platforms.

On Unix platforms, you typically use shell scripts to start and stop tc Runtime instances; alternatively, you can configure your Unix boot process to start the instance automatically. On Windows, SpringSource recommends that you first install the tc Runtime instance as a Windows Service, and subsequently use the Windows Services console to start and stop it.

Unix: Starting and Stopping tc Runtime Instances Interactively Using tcruntime-ctl.sh

By default, the tcruntime-instance.sh script creates all tc Runtime instances under the INSTALL_DIR/springsource-tc-server-edition directory, where INSTALL_DIR refers to the directory in which you installed tc Server, such as /home/tcserver, and edition refers to the edition or package of tc Server you are using (developer or standard). Each tc Runtime instance lives in its own directory; this directory translates into the server's CATALINA_BASE variable. This is the default behavior of the command script; you might have specified a different location of your tc Runtime instance.

In the following procedure, it is assumed that you installed a tc Server Standard Edition.

To start and stop a tc Runtime instance:

  1. Start a terminal window and change to the CATALINA_BASE/bin directory of the tc Runtime instance you want to start or stop.

    For example, if you installed tc Server in /home/tcserver and created a new tc Runtime instance called myserver:

    prompt$ cd /home/tcserver/springsource-tc-server-standard/myserver/bin

    (If you are using the Developer Edition or Standard Edition Runtime package of tc Server, the CATALINA_BASE directory path includes the springsource-tc-server-developer or springsource-tc-server-standard directory, respectively.)

  2. Start the tc Runtime instance by executing the tcruntime-ctl.sh start command. For example:

    prompt$ ./tcruntime-ctl.sh start

    This command starts the tc Runtime instance as a daemon under the current user account.

  3. Stop a currently running tc Runtime instance by executing the tcruntime-ctl.sh stop command:

    prompt$ ./tcruntime-ctl.sh stop

See tcruntime-ctl Command Reference for the full list of commands of the tcruntime-ctl script.

Unix: Starting tc Runtime Instances Automatically at System Boot Time

On Unix platforms, the tc Runtime installation includes a command script file called INSTALL_DIR/springsource-tc-server-edition/boot.rc.template, which is a template file that you can use to customize your Unix boot process so that tc Runtime instances start automatically when your computer starts. It is assumed that you already know how to customize the Unix boot process for your particular platform, so this section does not go into detail about where you should put this particular boot file (although typically you rename the file something like boot.rc and put it in the /etc/rc.d directory.) Rather, this section describes the updates you should make to the boot template file to reflect your tc Runtime instance environment. Consult your Unix administration documentation for further details about customizing the boot process.

A one-to-one relationship exists between a boot.rc file and a tc Runtime instance. For example, to start multiple tc Runtime instances automatically on the same Unix computer, you create separate boot.rc files for each tc Runtime instance, modify each of them to reflect the environment of the corresponding tc Runtime instance, and then put each of these files in the appropriate boot directory.

Edit only the top part of the boot.rc.template file that sets the following environment variables:

  • TOMCAT_USER: Unix user account that you want the tc Runtime instance to run as.

  • TC_SERVER_HOME: Absolute pathname to the tc Runtime installation home directory. This directory will be something like /home/tcserver/springsource-tc-server-standard, where /home/tcserver is the directory into which you installed tc Server. If you are using the Developer Edition, then the directory path instead will include springsource-tc-server-developer.

  • INSTANCE_BASE: Absolute pathname to the directory that contains your tc Runtime instance. By default, this directory is the same as the TC_SERVER_HOME directory; in this case, you can set the variable to $TC_SERVER_HOME. However, tc Runtime instances can be located anywhere, in which case you should specify the absolute pathname.

  • INSTANCE_NAME: Name of the tc Runtime instance. This name corresponds to the name of the directory in which the instance is located; this directory is relative to the INSTANCE_BASE directory.

  • JAVA_HOME: Absolute pathname of the home directory of the JDK you want the tc Runtime instance to use.

The following example specifies the tc Runtime home directory as /home/tcserver/springsource-tc-server-standard, the instance directory as the tc Runtime home directory, the instance name as myserver, the JDK location as /home/java/jdk1.6.0_11, and the tomcat user as the starter of tc Runtime process:

TOMCAT_USER=tomcat
TC_SERVER_HOME=/home/tcserver/springsource-tc-server-standard
INSTANCE_BASE=$TC_SERVER_HOME
INSTANCE_NAME=myserver
JAVA_HOME=/home/java/jdk1.6.0_11

Do not modify any part of the boot.rc.template file after the text DO NOT EDIT BEYOND THIS LINE.

Windows: Starting and Stopping tc Runtime Instances as Windows Services

By default, the tcruntime-instance.bat script creates all tc Runtime instances under the INSTALL_DIR\springsource-tc-server-edition directory, where INSTALL_DIR refers to the directory in which you installed tc Server, such as c:\home\tcserver and edition is developer or standard. Each particular tc Runtime instance lives in its own directory; this directory translates into the server's CATALINA_BASE variable. This is the default behavior of the command script; you might have specified a different location of your tc Runtime instance. If so, adjust the following procedure accordingly.

In the following procedure, it is assumed that you installed a tc Server Standard Edition.

To start and stop tc Runtime instances as Windows Services:

  1. If this is the first time that you will install and start the tc Runtime instance after creating it, start a command prompt window and continue with this procedure.

    If you have already installed the tc Runtime instance as a Windows Service, use the Windows Services control panel to start and stop it.

  2. Change to the CATALINA_BASE\bin directory of the tc Runtime instance you want to start or stop.

    For example, if you installed tc Server in c:\home\tcserver and created a new tc Runtime instance called myserver:

    prompt> cd c:\home\tcserver\springsource-tc-server-standard\myserver\bin

    If you are using the Developer Edition of tc Server, the CATALINA_BASE directory will include the springsource-tc-server-developer directory.

  3. Install the tc Runtime instance as a Windows service:

    prompt> tcruntime-ctl.bat install

    The command installs the tc Runtime instance as an automatic Windows Service, which means that the tc Runtime instance starts automatically when you start the Windows computer. You can change this behavior using the Windows Service control panel.

    You should see a message indicating a successful installation:

    wrapper | SpringSource tc Runtime - tcserver-c-home-tcserver-springsource-tc-server-standard-myserver installed.

  4. Now, and subsequently, start and stop the tc Runtime instance by using the Windows Services console. The tc Runtime instance is displayed in the console with the name SpringSource tc Runtime - unique-name, where unique-name is a unique combination of server name and server directory.

To uninstall the tc Runtime service, execute the following command:

prompt> tcruntime-ctl.bat uninstall

Although SpringSource recommends that you always install the tc Runtime instance as a Windows service and stop and start it using the Services console, you can also stop and start the tc Runtime instance manually. See tcruntime-ctl Command Reference for the full list of commands of the tcruntime-ctl script.

Windows Java Service Wrapper

On Windows, tc Runtime uses a Java Service Wrapper from Tanuki Software to install the tc Runtime instance as a Windows service. The Wrapper correctly handles user logouts under Windows, service dependencies, and the ability to run services which interact with the desktop.

The wrapper is configured using the CATALINA_BASE\conf\wrapper.conf file, where CATALINA_BASE is the top-level directory of the tc Runtime instance, such as c:\home\tcserver\springsource-tc-server-standard\myserver. In most circumstances, you do not need to update this file because the default one created when you created the tc Runtime instance handles most use cases. However, you might sometimes want to further customize the Windows service to fit particular circumstances of your environment; in which case you can edit the wrapper.conf file.

Important: When you start a tc Runtime instance on Windows using the tcruntime-ctl.bat command script, the script might override the following parameters of the wrapper.conf file with instance-specific values:

  • ARCH

  • CATALINA_HOME

  • CATALINA_BASE

This means, for example, that although the wrapper.conf file might appear to set the ARCH parameter to win32, the tcruntime-ctl.bat script overrides this generic value with something else (such as winx86_64) if in fact you are running the tc Runtime instance on a 64-bit computer.

For details about the configuration properties, see Configuration Property Overview.

tcruntime-ctl Command Reference

You use the tcruntime-ctl.sh (Unix) and tcruntime-ctl.bat (Windows) command scripts to manage tc Runtime instances. The syntax of the script is as follows:

tcruntime-ctl.sh|bat command [option] 

Typically, you run the command from the bin directory of the tc Runtime instance itself. However, you can also run it from the INSTALL_DIR/springsource-tc-server-edition directory if you specify the name of the instance, where INSTALL_DIR refers to the directory in which you installed tc Server and edition refers the edition of tc Server (developer or standard.)

For example, to start a tc Runtime instance called myserver from the bin directory of the instance itself on Unix:

prompt$ cd /home/tcserver/springsource-tc-server-standard/myserver/bin
prompt$ ./tcruntime-ctl.sh start

You can accomplish the same thing by running the command from the springsource-tc-server-standard (or springsource-tc-server-developer) directory by specifying the name of the instance:

prompt$ cd /home/tcserver/springsource-tc-server-standard
prompt$ ./tcruntime-ctl.sh myserver start

It is assumed in the remainder of this section that you are running the command script from the bin directory of the tc Runtime instance.

The following table describes the tcruntime-ctl script commands and supported platforms.

Table 7.5. Commands of the tcruntime-ctl Script

CommandDescriptionPlatform
install run-as-userInstalls the tc Runtime instance as a Windows service. You then start and stop the service using the Windows Service console.

The optional run-as-user parameter specifies the user account that you want the tc Runtime service to actually run as when you start the service using the Windows Service console; if you do not specify this parameter, then the user account that initially installed it is used. You can specify only user accounts that have their Logon as Service right set to run a Windows service. See Setting the Logon-As- Service Right for a Windows User.

When you run this command and explicitly specify a run-as-user user, the script asks you for the password of the specified user. tc Runtime still installs the instance as a service, even if you enter an incorrect password. However, when you try to start the service, it fails with a logon error. You must uninstall the service and reinstall it with the correct password.

Windows only
uninstallUninstalls the tc Runtime instance from the Windows Service.Windows only
startStarts the tc Runtime instance as a daemon process.

On Windows, you must have previously installed the tc Runtime instance as a Windows service to be able to start it using the tcruntime-ctl.bat start command; see the documentation on the tcruntime-ctl.bat install command in this table for more information.

Unix and Windows
restart timeoutStops, and then immediately starts, a running tc Runtime instance. As with the start command, restart starts the instance as a daemon process.

On Windows, you must have previously installed the tc Runtime instance as a Windows service to be able to restart it using the tcruntime-ctl.bat restart command; see the documentation on the tcruntime-ctl.bat install command in this table for more information.

By default, the tcruntime-ctl script (when stopping the tc Runtime instance) waits for 5 seconds and checks to see if the process has exited gracefully; if it has not, then the script forces a termination of the process. Using the optional timeout parameter, you can set your own timeout value by specifying an integer option for the number of seconds. For example, to specify that you want the instance to stop after 10 seconds:

prompt$ ./tcruntime-ctl.sh restart 10

Unix and Windows
runStarts the tc Runtime instance as a foreground process.Unix and Windows
batchRuns the tc Runtime instance using the catalina.bat script as a batch job. Specifically, the script starts the tc Runtime instance by running the following command: %CATALINA_HOME%\bin\catalina.bat run.Windows only
stop timeoutStops a running tc Runtime instance. By default, the tcruntime-ctl script waits for 5 seconds and checks to see if the process has exited gracefully; if it has not, then the script forces a termination of the process.

Using the optional timeout parameter, you can set your own timeout value by specifying an integer option for the number of seconds. For example, to specify that you want the instance to stop after 10 seconds:

prompt$ ./tcruntime-ctl.sh stop 10

Unix and Windows
statusReports the status of a tc Runtime instance, such as whether it is running or stopped, as well as useful information such as the directory from which the tc Runtime instance gets its binary files, the main instance source directory, and so on.Unix and Windows

The following table describes the options you can use with the tcruntime-ctl script. All the options are optional; you can use them with any of the tcruntime-ctl commands.

Table 7.6. Options of the tcruntime-ctl Script

OptionDescription
-d tcRuntimeDirReplace tcRuntimeDir with the full pathname of the tc Server installation directory. Use this option if you are running the tcruntime-ctl.sh|bat script from a location other than its default location.

The default value of this option is the location of the tcruntime-ctl.sh|bat script.

-n instanceDirReplace instanceDir with the full pathname of parent the tc Runtime instance directory. Use this option if the tc Runtime instance directory is not in the default location (i.e. the main tc Server installation directory).

For example, if the full instance directory of a tc Runtime instance is /home/tcserver/instances/myserver, then you would specify /home/tcserver/instances for this option.

The default value of this option is the current working directory.


The following example shows how to stop the tc Runtime instance called myserver after waiting for 60 seconds:

prompt$ cd /home/tcserver/springsource-tc-server-standard/myserver/bin
prompt$ ./tcruntime-ctl.sh stop 60

In the following example, use of the -n option indicates that the tc Runtime instance called myotherinstance has an instance directory of /home/tcserver/instances/myotherinstance. The example shows how to use the tcruntime-ctl script located in the main tc Server installation directory.

prompt$ cd /home/tcserver/springsource-tc-server-standard
prompt$ ./tcruntime-ctl.sh myotherinstance stop 60 -n /home/tcserver/instances

Windows: Setting the Logon-as-Service Right for a Windows User

The tcruntime-ctl.bat install command has an optional run-as-user parameter by which you specify the user account that you want the tc Runtime service to run as when you start the service from the Windows Service console. Windows requires that the specified user account must have their Logon as Service right set for this feature to work properly. To set this right:

  1. From the Windows Start menu, open the Control Panel.

  2. Open Administrative Tools.

  3. Open the Local Security Policy tool.

  4. Expand the Local Policies settings.

  5. Click the User Rights Assignment.

  6. On the right side, double-click on the Log on as a service policy.

  7. Click on the Add User Or Group button and enter the user account name using the wizard.

The Local Security Policy tool does not appear to be available on Home versions of Windows 2000 and XP. It is thus not possible to run the tc Runtime service as a specific account under those versions of Windows.

7.3 Windows: Installing the HQ Server and Agents as Windows Services

SpringSource recommends that you install both the HQ Server and all HQ Agents as Windows Services, and then start and stop them from the Service console. This section describes how to install both components. See Starting and Stopping the HQ Server and Agents for details about starting and stopping the HQ Server and Agents, particularly when starting the HQ Agent for the first time.

To install the HQ Server as a Windows Service:

  1. Open a command prompt window.

  2. Change to the HQ_SERVER_INSTALL_DIR\bin directory, where HQ_SERVER_INSTALL_DIR refers to the directory in which you installed the HQ Server, such as c:\home\hyperic\server-4.5.X.X-EE\bin:

    prompt> cd c:\home\hyperic\server-4.5.X.X-EE\bin
  3. To install the HQ Server as a Windows Service:

    prompt> hq-server.exe -i 

    After a few status messages, you will see a Done. message when installation is complete.

    The command installs the HQ Server as an automatic Windows Service, which means that the server starts automatically when you start the Windows computer. You can change this behavior through the Windows Service control panel.

    Now, and subsequently, start (and stop) the HQ Server using the Windows Service control panel. The HQ Server is listed as Hyperic HQ Server.

  4. To uninstall the Windows service:

    prompt> hq-server.exe -u

    You will see a Removing 'Hyperic HQ Server' Service ... Done upon completion.

To install the HQ Agent as a Windows Service:

  1. Start a command prompt window.

  2. If you have not already done so, set the HQ_JAVA_HOME system environment variable to point to the location of your JDK or JRE. Set it as a system environment variable; if you set it as a user environment variable, the HQ Agent aborts on startup.

  3. Change to the HQ_AGENT_INSTALL_DIR\bin directory, where HQ_AGENT_INSTALL_DIR refers to the directory in which you installed the HQ Agent, such as c:\home\hyperic\agent-4.5.X.X-EE\bin:

    prompt> cd c:\home\hyperic\agent-4.5.X.X-EE\bin
  4. To install the HQ Agent as a Windows service:

    prompt> hq-agent.bat install

    You see a Hyperic HQ Agent installed. message upon completion.

    The preceding command installs the HQ Agent as an automatic Windows Service, which means that the agent starts automatically when you start the Windows computer. You can change this behavior using the Windows Service control panel.

    If you are starting the HQ Agent for the first time, see the procedure for starting the HQ Agents for further instructions. Subsequently, start (and stop) the HQ Agent using the Windows Service control panel. The HQ Server is listed as Hyperic HQ Server.

  5. To remove (uninstall) the Windows service:

    prompt> hq-agent.bat remove

    You will see a Hyperic HQ Agent removed. message upon completion.

7.4 Starting and Stopping the HQ Server and Agents

This section describes how to control the HQ Server and Agents, specifically starting and stopping them.

On Unix platforms, you always use shell scripts to start and stop the HQ Server and HQ Agent. On Windows, it is recommended that you first install both the server and agents as Windows Services, and subsequently use the Windows Services console to start and stop them. Using the Windows Services console, you can also specify whether the HQ Server and Agent should start automatically when the operating system itself starts. The section below describes how to install the server and agents as Windows services.

Depending on how you have configured all the components of tc Server (tc Runtime, HQ Server and HQ Agents), you might run the commands to start and stop the HQ Agent and Server on the same computer or on different computers.

[Note]Note

This section provides basic information about starting and stopping the HQ Server and Agent, just enough to get you up and running. For additional detailed information, see Hyperic documentation links:

Unix: Starting and Stopping the HQ Server and Agent

To start and stop the HQ Server:

  1. Open a new terminal window.

  2. Change to the HQ_SERVER_INSTALL_DIR/bin directory, where HQ_SERVER_INSTALL_DIR refers to the directory in which you installed the HQ Server, such as /home/hyperic/server-4.5.X.X-EE. For example:

    prompt$ cd /home/hyperic/server-4.5.X.X-EE/bin
  3. To start the HQ Server:

    prompt$ ./hq-server.sh start

    The script displays Starting HQ Server... and then the shell/command prompt on success.

  4. To stop the HQ Server:

    prompt$ ./hq-server.sh stop

    The server is fully stopped when you see the message Stopped HQ Server.

See the HQ_SERVER_INSTALL_DIR/logs/server.log for details about the starting or stopping of the HQ Server.

To start and stop the HQ Agent:

  1. Start a new terminal window.

  2. Change to the HQ_AGENT_INSTALL_DIR/bin directory, where HQ_AGENT_INSTALL_DIR refers to the directory in which you installed the HQ Agent, such as /home/hyperic/agent-4.5.X.X-EE. For example:

    prompt$ cd /home/hyperic/agent-4.5.X.X-EE/bin
  3. To start the HQ Agent, execute the following command:

    prompt$ ./hq-agent.sh start

    The script displays Starting HQ Agent... and then the shell/command prompt on success.

    [Important]Important

    The first time you start the agent, the script requests information about the HQ Server to which it will communicate; this is a one-time event and subsequent starts of the agent do not require this input. See the table in the Configure Agent-Server Communication Interactively section of the Hyperic documentation for information about these prompts.

  4. To stop the HQ Agent, execute the following command:

    prompt$ ./hq-agent.sh stop

    The agent is fully stopped when you see the message Stopped HQ Agent.

See the HQ_AGENT_INSTALL_DIR/log/agent.log for details about the starting or stopping of the HQ Agent.

Windows: Starting and Stopping the HQ Server and Agent

To start and stop the HQ Server:

  1. If you have not already done so, install the HQ Server as a Windows Service, as described in Installing the HQ Server and Agents as Windows Services.

  2. Start (and stop) the HQ Server using the Windows Service control panel. The HQ Server is listed as Hyperic HQ Server.

See the HQ_SERVER_INSTALL_DIR\logs\server.log for details about the starting or stopping of the HQ Server.

To start and stop the HQ Agent:

  1. If you have not already done so, install the HQ Agent as a Windows Service, as described in Installing the HQ Server and Agents as Windows Services.

  2. If this is the first time you start the HQ Agent after installing it, start a command prompt window and continue with this procedure.

    Otherwise, use the Windows Service console to start (and stop) the HQ Agent. The HQ Agent is listed as the Hyperic HQ Agent.

  3. If you have not already done so, set the HQ_JAVA_HOME system environment variable to point to the location of your JDK or JRE. Note that you are required to set it as a system environment variable; if you set it as a user environment variable, the HQ Agent will abort on startup.

  4. Change to the HQ_AGENT_INSTALL_DIR\bin directory, where HQ_AGENT_INSTALL_DIR refers to the directory in which you installed the HQ Agent, for example c:\home\hyperic\agent-4.5.X.X-EE. For example:

    prompt> cd c:\home\hyperic\agent-4.5.X.X-EE\bin 
  5. The first time you start the HQ Agent, you must start it from the command line:

    prompt> hq-agent.bat start 

    The command requests information about the HQ Server to which it will communicate; this is a one-time event and subsequent starts of the HQ Agent do not require this input. See the table in the Configure Agent-Server Communication Interactively section of the Hyperic documentation for information about these prompts.

  6. Subsequently, start (and stop) the HQ Agent using the Windows Service console. The HQ Agent is listed as the Hyperic HQ Agent.

See the HQ_AGENT_INSTALL_DIR\log\agent.log for details about the starting or stopping of the HQ Agent.

7.5 Getting Started with the HQ User Interface

After you install and start the HQ Server and all the agents on all computers that host tc Runtime instances, you invoke the HQ user interface in your browser so that you can start using it to monitor and configure tc Runtime instances, as well as other resources.

The following procedure describes how to access the HQ user interface, add a tc Runtime instance to the HQ inventory, and update the tc Runtime instance JMX configuration properties so that HQ can manage them.

  1. Invoke the HQ user interface in your browser:

    http://host:port 

    where:

    • host is the computer on which you installed the HQ Server. If your browser is running on the same computer as the HQ Server, you can use localhost or 127.0.0.1.

    • port is the TCP/IP listen port of the HQ Server, specified when you installed the server. The default value is 7080.

      The TCP/IP listen port is configured in the HQ_SERVER/conf/hq-server.conf file, where HQ_SERVER is the directory in which you installed the HQ Server. If the default listen port does not work, search this file for the actual value of the server.webapp.port property.

    For example, use the following URL if HQ server is running locally using the default listen port:

    http://localhost:7080
  2. At the login screen, enter the administrator login. The default username is hqadmin, with password hqadmin.

    The server administrator username and password are configured in the HQ_SERVER/data/hq-server-install.conf file, where HQ_SERVER is the directory in which you installed the HQ Server. If the default values do not work, search this file for the actual values of the server.admin.username and server.admin.password properties.

    Important: As is true for all default passwords, be sure to change it as soon as possible to ensure maximum security for your installation.

  3. Select a default dashboard for the administration user; this selection affects only the appearance of the HQ user interface, not its functionality. SpringSource recommends you select hqadmin then click OK. You can change the default dashboard after you log in.

  4. The following graphic displays the main HQ dashboard. Highlighted objects are ones that you always use or use when you get started; see the explanation for each object after the graphic.

    • The two Dashboard links return you to this main dashboard console page.

    • The Resources link allows you to browse the full set of resources known by HQ, quickly scan the resources that are currently down, or easily go to the resources you have most recently viewed.

    • The Auto-Discovery Portlet always shows the resources that HQ has auto-discovered but you have not yet worked with (either adding them to the HQ inventory or skipping them). For example, if you start a tc Runtime instance before logging into HQ, then the instance should automatically show up in the auto-discovery portlet. In the next step you will add these resources to HQ's inventory.

      Note that the HQ UI itself uses a tc Runtime internally called hq-server, which is also listed in the Auto-Discovery portlet.

    • The Help button provides context-sensitive online help, with useful information about what tasks you can perform on each HQ user interface page.

  5. Import your operating system platform, the tc Runtime instance, and other resources running on the platform into the HQ inventory by selecting the appropriate radio buttons next to the resource in the Auto-Discovery portlet and clicking Add to Inventory, as shown in the following graphic.

    The tc Runtime instance shows up as platform-resource tc Runtime catalina-base-dir in the HQ user interface, where platform-resource refers to the computer on which the instance is running and catalina-base-dir refers to the CATALINA_BASE directory of the tc Runtime instance without the leading directory pathnames. For example: my-desktop tc Runtime myserver. The HQ Agent might also show up in the auto-discovery portlet, listed as HQ Agent 4.5.X.X-EE.

    Because of the auto-discovery feature of HQ, your operating system platform should automatically show up in the Auto-Discovery portlet on the main Dashboard screen of the HQ user interface. Other resources running on the operating system, such as other tc Runtime instances, will also show up in the portlet. This is true for all computers running HQ agents that communicate with this HQ Server.

    [Tip]Tip

    It can sometimes take a few minutes for a newly-started resource, such as the tc Runtime instance, to show up in the auto-discovery portlet.

    After you click Add to Inventory, selected resources show up in the Recently Added portlet of the main Dashboard.

  6. Click the Resources > Browse link at the top of the HQ user interface.

    This brings you to a console page from which you can view all the resources in the HQ inventory. You view the tc Runtime instances by clicking on the Servers(X) link, as shown:

  7. Click the Servers(X) link. A list of all the servers in your inventory appears in the table. The tc Runtime instances are listed as platform-resource tc Runtime catalina-base-dir.

  8. In the table, click on the tc Runtime instance you just added to the HQ inventory, as shown in the preceding graphic.

    HQ displays the configuration and management pages of a tc Runtime instance, as shown in the next graphic and ensuing explanation.

    • Monitor tab. Displays monitoring information about a tc Runtime instance and its services, such as the deadlocks detected, available heap memory, and so on. The charts show either graphical or tabular data about the metrics; click Indicators or Metric Data to view each kind of data. Click a particular service in the Services table to view diagnostic information about that particular service that is associated with the tc Runtime instance.

    • Inventory tab. View and manage the tc Runtime instance's general properties, the services hosted by the server, groups containing the server, and the server's monitoring and control configuration.

    • Alerts tab. View, configure, and create alerts for a tc Runtime instance.

    • Control tab. Start, stop, and restart this tc Runtime instance, as well as schedule one of these actions for a future date.

    • Views tab. Has two subtabs: Server Configuration and Application Deployment. Use the Server Configuration tab to configure the tc Runtime instance, such as startup JVM parameters, JSP behavior, and properties of the Catalina service, such as connectors and engines. The application deployment tab allows you to deploy Web applications to the tc Runtime instance, as well as start, stop, reload, and undeploy already deployed Web applications.

  9. Click the Inventory tab.

  10. Scroll down to the Configuration Properties section.

    The HQ user interface uses the values of the fields in this section to connect to the tc Runtime instance, control it, and so on. In particular, the Shared section specifies the JMX properties of the tc Runtime instance; HQ uses JMX to configure and manage tc Runtime instances.

    [Important]Important

    If you have not changed the JMX values in server.xml, HQ will populate these fields automatically, so the tc Runtime instance should work with HQ without change. However, if you have changed the JMX values of your tc Runtime instance by manually updating its server.xml file, then you must change the corresponding fields in the HQ user interface, as described in the following procedure.

    1. Click Edit.

    2. Update the following fields as required:

      • jmx.url: URL that the HQ user interface uses to connect to the JMX server associated with the tc Runtime instance. The format is service:jmx:rmi:///jndi/rmi://host:jmxport/jmxrmi. Be sure the value of host is the name of the computer on which the JMX server is running (you can use localhost if it is the same as the computer hosting HQ server) and that the value of jmxport is the value of the port attribute of the <Listener> element in the tc Runtime instance's server.xml file that corresponds to the com.springsource.tcserver.serviceability.rmi.JmxSocketListener class (default value is 6969).

      • jmx.username: JMX username that HQ uses to connect to the JMX server associated with the tc Runtime instance. The username is stored in the file pointed to by the passwordFile attribute of the <Listener> element in the tc Runtime instance's server.xml file that corresponds to the com.springsource.tcserver.serviceability.rmi.JmxSocketListener class; by default, the name of this file is CATALINA_BASE/conf/jmxremote.password. The default username is admin.

      • jmx.password: Password of jmx.username. The password is stored in the same file as the username, as described in the preceding bullet. The default password is springsource.

    3. Click OK.

You are now ready to monitor and configure the tc Runtime instance using Hyperic HQ. For a tutorial that describes how to perform common management and configuration tasks using HQ, see Tutorial: Using HQ to Configure and Manage tc Runtime Instances.

For detailed conceptual and task information about using HQ, click the Help button on the HQ user interface or consult the vFabric HQ Documentation.

7.6 Deploying Applications to tc Runtime Instances

Deployment refers to the process of installing a Web application into the tc Runtime instance. This section describes two ways to deploy Web applications to the tc Runtime instance.

  • Static deployment: To deploy statically, you simply copy your Web application, either as a packaged WAR file or as an uncompressed directory (also called exploded), to the deployment directory of the tc Runtime instance. This directory is specified by the appBase property of your virtual host; the default value is CATALINA_BASE/webapps. Assuming that the autoDeploy property of your host is enabled (default value), then as soon as you copy your Web application to the deployment directory, the tc Runtime instance deploys and starts it, and users can immediately start using the application. See the procedure below for details.

  • Dynamic deployment using HQ: The HQ user interface is a sophisticated GUI console with which you can deploy Web applications located on local or remote computers. You can also create groups of tc Runtime instances and then deploy a WAR file to the group; the HQ user interface then takes care of deploying the WAR file to each individual member of the group. This feature helps you avoid having to deploy to each tc Runtime instance individually, saving you much time if you have many servers in your environment.

    See Tutorial: Using HQ to Configure and Manage tc Runtime Instances for a tutorial that describes how to deploy applications to single tc Runtime instances, create tc Runtime groups, and deploy an application to the group.

It is assumed in this section that you have already created a Web application and want to deploy it to a tc Runtime instance so you can start using the application. If you do not have a Web application, see Tutorial: Very Simple Web Application Development for a tutorial that describes how to create a very simple HelloWorld application.

To deploy a Web application statically: Copy the WAR or exploded directory to the deployment directory, which by default is CATALINA_BASE/webapps. For example, if your CATALINA_BASE variable is /home/tcserver/springsource-tc-server-standard/myserver, and your Web application is the exploded directory /home/apps/myApp, then you deploy it statically with the following command:

prompt$ cp /home/apps/myApp /home/tcserver/springsource-tc-server-standard/myserver/webapps

If you want to use a different deployment directory than the default CATALINA_BASE/webapps, set the the appBase attribute of the <Host> element that configures the virtual host for your tc Runtime instance. For additional details about static deployment, see Tomcat Web Application Deployment.

Deploying Applications Using Tomcat Manager (Developer Edition Only)

This topic applies to the Developer Edition of tc Server only.

The Developer Edition of tc Server includes Tomcat Manager, which is a simple Web application that you can use to deploy your own Web applications and manage their lifecycle, such as starting, stopping, and undeploying them.

The default configuration of Developer Edition of tc Server does not automatically authorize any user to access Tomcat Manager. The following procedure describes how to authorize a user to access the application, and then how to invoke the Web application in your browser.

  1. Update the CATALINA_BASE/conf/tomcat-users.xml file of the tc Runtime instance by adding a manager role.

    The default tomcat-users.xml file does not include any roles or users, although examples are shown in the comments.

    An entry for the manager role would look like the following (shown in bold):

    <tomcat-users>
      <role rolename="manager" />
      ...
    </tomcat-users>
  2. In the same file, add a user with role manager. For example, to specify that the tomcat user (with password tomcat) have the manager role, add the following to the tomcat-users.xml file (shown in bold):

    <tomcat-users>
      <role rolename="manager" />
      <user username="tomcat" password="tomcat" roles="manager" />
      ...
    </tomcat-users>
  3. Restart the tc Runtime instance for the changes to take effect. For example, on Unix:

    prompt$ cd /home/tcserver/springsource-tc-server-developer
    prompt$ ./tcruntime-ctl.sh insight-instance restart
  4. Invoke Tomcat Manager in your browser using the following URL:

    http://host:8080/manager/html

    where host refers to the computer on which you are running the tc Runtime instance. If it is the same as the browser, you can use localhost:

    http://localhost:8080/manager/html
  5. Enter the user and password you just configured; in our example, these are tomcat/tomcat.

The Applications table lists the currently deployed applications. Click the links in the Path column to actually invoke each application. The Commands column includes buttons for starting, stopping, reloading, and undeploying the applications.

From the Deploy section, you can deploy Web applications (either exploded or in a WAR format) from either the host from which you are running the tc Runtime instance or from the local computer on which you are running your browser. When deploying from the host, you must specify the context path that users use to actually invoke the application.

For detailed information about Tomcat Manager, see Manager App How-To on the Apache Tomcat Web site.

7.7 Uninstalling tc Server: Typical Steps

Uninstall one or more of these components as you wish:

Uninstallation of tc Server mostly entails removing the directories that contain the component files, although a few extra steps might be required, as described below.

Each section covers both Unix and Windows commands. The documentation uses Unix-like forward slashes (/) for directories; if you are on a Windows platform, change these to back slashes (\).

WARNING: The procedures in this section describe how to completely remove the components of tc Server from your computer.

Uninstalling HQ Server

To uninstall the HQ Server component of tc Server:

  1. Start a terminal window (Unix) or command prompt (Windows).

  2. If currently running, stop the HQ Server. See Starting and Stopping the HQ Server and Agents.

  3. Windows only. If you installed the HQ Server as a Windows service, change to the HQ_SERVER_INSTALL_DIR\bin directory (where HQ_SERVER_INSTALL_DIR refers to the directory in which you installed the HQ Server, such as c:\home\hyperic\server-4.5.X.X-EE) and uninstall the service using the following command:

    prompt> cd:\home\hyperic\server-4.5.X.X-EE\bin 
    prompt> hq-server.exe -u
  4. Remove the directory in which you installed the HQ Server, such as /home/hyperic/server-4.5.X.X-EE:

    prompt$ cd /home/hyperic
    prompt$ rm -rf server-4.5.X.X-EE

Uninstalling HQ Agent

To uninstall the HQ Agent component of tc Server:

  1. If the agent itself is managed by HQ, remove the platform for the agent using the HQ user interface.

  2. Start a terminal window (Unix) or command prompt (Windows).

  3. If currently running, stop the HQ Agent. See Starting and Stopping the HQ Server and Agents.

  4. Windows only. If you installed the HQ Agent as a Windows service, you should now uninstall it. Change to the HQ_AGENT_INSTALL_DIR\bin directory, where HQ_AGENT_INSTALL_DIR refers to the directory in which you installed the HQ Agent, such as c:\home\hyperic\agent-4.5.X.X-EE. Once in this directory, uninstall the service using the hq-agent.bat remove command. For example :

    prompt> cd c:\home\hyperic\agent-4.5.X.X-EE\bin
    prompt> hq-agent.bat remove
  5. Remove the directory in which you installed the HQ Agent. For example:

    prompt$ cd /home/hyperic
    prompt$ rm -rf agent-4.5.X.X-EE

Uninstalling tc Runtime

The following procedure describes how to uninstall the tc Runtime and all its associated instances.

  1. If currently running, stop all tc Runtime instances. See Starting and Stopping tc Runtime Instances.

  2. Start a terminal window (Unix) or command prompt (Windows).

  3. Windows only. If you installed any tc Runtime instances as Windows services, change to the CATALINA_BASE\bin directory of each instance (such as c:\home\tcserver\springsource-tc-server-standard\myserver\bin) and uninstall the service using the following command:

    prompt> c:\home\tcserver\springsource-tc-server-standard\myserver\bin
    prompt> tcruntime-ctl.bat uninstall
  4. Remove the main tc Server installation directory. For example, if you installed Standard Edition, the delete command might look something like the following:

    prompt$ rm -rf /home/tcserver/springsource-tc-server-standard

    By default, the home directory of all tc Runtime instances is under the main tc Server installation directory; if you used this default location when you created the tc Runtime instances with the tcruntime-instance script, then the preceding delete command also deleted all tc Runtime instances.

  5. If you created any tc Runtime instances in locations other than the default tc Server installation directory, remove their corresponding home directories.

8. Upgrade and Migration Guide

This chapter describes how to perform the following supported upgrade procedures:

8.1 Upgrading a 2.0.X tc Server Installation to 2.1.X

This chapter describes how to upgrade an existing 2.0.X tc Server installation to 2.1.X.

Understanding the 2.0.X to 2.1.X tc Server Upgrade Process

Upgrading a 2.0.X tc Server installation to 2.1.X consists of the following subtasks, which are explained in more detail in the next section:

  • Upgrade your existing 4.2 HQ Server to version 4.5. You no longer have to use a tc Server-specific version of HQ; rather, the standard 4.5 Enterprise Edition (EE) distribution now includes the tc Server HQ plugin.

    To perform this subtask, you download the 4.5 HQ EE distribution and use its setup.sh -upgrade (Unix) or setup.bat -upgrade (Windows) command script to perform the upgrade.

    The procedure below shows basic steps to perform this task, but for additional details, see Upgrade Hyperic Components.

  • Install the 4.5 HQ Agent on every computer on which you have installed tc Runtime. As with the 4.5 HQ Server, the standard 4.5 HQ Agent now includes the tc Server HQ plugin. You do not actually upgrade your existing HQ Agent; rather, you simply install the new HQ Agent in a separate directory and immediately start using it. Note that if you previously used the HQ Agent that was included in the Managed Node package of 2.0.X tc Server Standard Edition, you can simply remove that old directory once the upgrade is complete.

    To perform this subtask, you install the HQ Agent from the standard 4.5 HQ EE distribution using the setup.sh (Unix) or setup.bat (Windows) script. You can also simply push the 4.5 Agent to the tc Server computers using the upgraded 4.5 HQ Server. This documentation shows how to perform the former.

    The procedure below shows basic steps to perform this task, but for additional details, see Upgrade Hyperic Components.

  • You can continue to monitor and manage your existing 2.0.x tc Runtime instances using 4.5 HQ without any extra step.

    You can, however, optionally install the 2.1.X tc Runtime if you want to start using the new runtime features, such as improved templating, the released version of Spring Insight, or later release of the Tomcat binaries. In this case, you install the 2.1.X runtime separately from the 2.0.X installation rather than on top of the 2.0.X installation. You then create new 2.1.X tc Runtime instances and, if desired, manually migrate the configuration and applications from existing 2.0.X instances to the new 2.1 instances.

    If you upgrade your existing tc Runtime instances to version 2.1, you will also need to upgrade your HQ Server and Agent(s) to version 4.5. The 4.2.x versions of the HQ Server and Agent will not monitor a tc Runtime instance that has been upgraded to 2.1.

Depending on how you have configured your tc Server installation, you might perform different subtasks on different computers. For example, on the computer on which you have installed the HQ Agent and runtime component (called a managed node), you perform the second and third subtasks. On the computer on which you installed the HQ Server (and nothing else), you perform only the first subtask. The procedure below breaks the steps into those you do on the managed node computer(s) and those you do on the HQ Server computer. If you have previously installed all components on the same computer, then simply execute all steps on the same computer.

Most of the examples in this section use Unix syntax; if you are upgrading on Windows, change the forward slashes to back-slashes and replace the *.sh suffix with *.bat when running a command script. Other changes between the two platforms are called out.

tc Server 2.0.X Upgrade Procedure

For simplicity, it is assumed in this procedure that your 2.0.X environment results from you following the 2.0 Quick Start instructions, except that the HQ Server is on a computer different from the tc Runtime instances. In particular, this means that:

  • You installed the 4.2 HQ server in /home/tcserver/server-4.2.0.8-EE and that you are using an external database, such as Oracle, rather that the bundled database.
  • You installed 2.0.4 tc Server Standard Edition (managed node package) in /home/tcserver/springsource-tc-server-node . This means that your 4.2 HQ Agent is installed in a sub-directory, such as /home/tcserver/springsource-tc-server-node/hyperic-hq-agent-4.2.0.8-EE .

If your setup is different, such as the various components are installed in different directories, adjust the procedure accordingly.

To upgrade your 2.0.X tc Server installation to 2.1.X, follow these steps:

  1. Unix only: Read Important Note When Installing on Unix Platforms.

  2. On the computer on which you are going to upgrade the existing HQ Server:

    1. Back up your existing HQ Server installation, including any external database that you are using.

    2. Start a terminal (Unix) or command prompt (Windows).

    3. If the HQ server is running, shut it down. For example, on Unix, if you installed the HQ server in /home/tcserver:

      prompt$ cd /home/tcserver/server-4.2.0.8-EE
      prompt$ bin/hq-server.sh stop

      On Windows, if you installed the HQ server as a Windows service, you use the Windows Services Console to stop the server.

      See Starting and Stopping the HQ Server and Agents.

    4. Windows only. If you installed the HQ Server as a Windows service, uninstall it. For example:

      prompt> cd c:\home\tcserver\server-4.2.0.8-EE
      prompt> bin\hq-server.exe -u

      See Windows: Installing the HQ Server and Agents as Windows Services

    5. Download the 4.5 HQ EE server distribution. You can download an evaluation copy from the Hyperic Download Center.

    6. Unzip 4.5 HQ Server distribution into a temporary directory.

      For example, if you downloaded the distribution to the /home/Downloads directory on Unix:

      prompt$ cd /home/Downloads
      prompt$ tar xvzf hyperic-hq-installer-4.5.0-EE-noJRE.tar.gz

      The unzip or tar command creates a directory called hyperic-hq-installer-4.5.0 that contains the setup.sh|bat script and all the product files.

    7. If you are using an external database to store HQ data, start the database server if it is not already running. Consult your database server documentation for details.

    8. From your terminal window or command prompt, change to this directory and execute the setup.sh -upgrade (Unix) or setup.bat -upgrade (Windows) script. The -upgrade flag specifies that the script should migrate information in your existing HQ inventory to the new HQ Server. For example, on Unix:

      prompt$ cd /home/Downloads/hyperic-hq-installer-4.5.0
      prompt$ ./setup.sh -upgrade
    9. After accepting the terms of the agreement, enter the full pathname of the directory that contains the previous version of the HQ Server that you want to upgrade, for example /home/tcserver/server-4.2.0.8-EE.

    10. At the prompt, enter the full pathname of the directory in which you want to install the new HQ Server. If, for example, you want to install the new HQ server alongside the existing HQ server mentioned in the previous step , enter /home/tcserver.

      Note:The specified directory must already exist; the setup program does not create it for you.

      The setup script creates a new subdirectory under your inputted directory for the new HQ Server, such as /home/tcserver/server-4.5.0-EE. The setup script then migrates a subset of information about the existing tc Runtime instances from the old version of the HQ server to the new HQ Server.

      If the upgrade of the HQ Server completes successfully, you should see the following message:

      Setup completed.
      A copy of the output shown above has been saved to:
        /home/Downloads/hyperic-hq-installer-4.5.0/installer/logs/hq-install.log

      Important: From now on, use this new HQ Server; it should have basic information about the existing tc Runtime instances from your old HQ Server.

    11. Start the upgraded server using the bin/hq-server.sh start command. For example:

      prompt$ cd /home/tcserver/server-4.5.0-EE
      prompt$ bin/hq-server.sh start

      See Starting and Stopping the HQ Server and Agents for details and Windows instructions for installing the server as a service.

  3. On the computer on which you are going to install the new HQ Agent and (optionally) migrate the existing 2.0.X tc Runtimes to 2.1.X:

    1. Start a terminal (Unix) or command prompt (Windows.)

    2. If it is running, shut down the existing HQ Agent. For example, if you installed the HQ agent as part of a 2.0.x managed node in /home/tcserver/springsource-tc-server-node:

      prompt$ cd /home/tcserver/springsource-tc-server-node/hyperic-hq-agent-4.2.0.8-EE
      prompt$ bin/hq-agent.sh stop

      Windows only. If you installed the HQ Agent as a Windows service, you use the Windows Services Console to stop it.

      See Starting and Stopping the HQ Server and Agents.

    3. Windows only. If you installed the HQ Agent as a Windows service, uninstall it. For example, if you installed the 2.0.X managed node in c:\home\tcserver\springsource-tc-server-node:

      prompt> cd c:\home\tcserver\springsource-tc-server-node\hyperic-hq-agent-4.2.0.8-EE
      prompt> bin\hq-agent.bat remove

      See Windows: Installing the HQ Server and Agents as Windows Services.

    4. Download the 4.5 HQ Agent-only distribution. You can download an evaluation copy from the Hyperic Download Center.

      Alternatively, you can also use the full 4.5 HQ EE Server distribution you used to install the HQ Server because it also includes the 4.5 HQ Agent, although this distribution is much larger than the Agent-only distribution.

    5. If you are installing the 4.5 HQ Agent from the Agent-only distribution, simply unzip or untar it into the directory in which you want the Agent to live.

      For example, if you want to install the 4.5 HQ Agent in the /home/tcserver directory and you downloaded it to the /home/Downloads directory:

      prompt$ cd /home/tcserver
      prompt tar xvzf /home/Downloads/hyperic-hq-agent-4.5.0-EE-xx-x86-linux.tar.gz

      This creates the /home/tcserver/hyperic-hq-agent-4.5.0-EE directory which contains all the HQ Agent files.

      If you are installing the 4.5 HQ Agent from the full 4.5 HQ EE Server distribution, follow these steps:

      1. Unzip the 4.5 HQ EE Server distribution into a temporary directory.

        For example, if you downloaded the HQ Server distribution to the /home/Downloads directory on Unix:

        prompt$ cd /home/Downloads
        prompt$ tar xvzf hyperic-hq-installer-4.5.0-EE-noJRE.tar.gz

        The unzip or tar command creates a directory called hyperic-hq-installer-4.5.0.

      2. From your terminal window or command prompt, change to this directory and execute the setup.sh (Unix) or setup.bat (Windows) script.

        prompt$ cd /home/Downloads/hyperic-hq-installer-4.5.0
        prompt$ ./setup.sh 
      3. After accepting the terms of the agreement, enter 2 to install only the HQ Agent. Then enter the full pathname of the directory in which you want the Agent to live, such as /home/tcserver.

        This creates the /home/tcserver/agent-4.5.0-EE directory which contains all the HQ Agent files.

    6. Start the new 4.5 HQ Agent using the bin/hq-agent.sh start command. Following our example on Unix (assuming you installed from the Agent-only package):

      prompt$ cd /home/tcserver/hyperic-hq-agent-4.5.0-EE
      prompt$ bin/hq-agent.sh start

      The first time you start the new 4.5 HQ Agent, the script requests information about the HQ Server to which it will communicate; specify the upgraded HQ Server (version 4.5.0 in our example.) This is a one-time event and subsequent starts of the agent do not require this input. See the table in the Configure Agent -Server Communication Interactively section of the Hyperic documentation for information about these prompts.

      Important: From now on, use this new 4.5 HQ Agent and not the old HQ Agent.

      See Starting and Stopping the HQ Server and Agents for details and Windows instructions for installing the agent as a service.

    7. If you want to migrate your existing 2.0.X tc Runtime instance to 2.1.X, follow the rest of this procedure. Note that you are not required to migrate the 2.0.X instances; you can continue to monitor and manage them using the new 4.5 HQ UI without any further steps.

    8. If they are running, shut down your 2.0.X tc Runtime instances. For example, if you installed the 2.0.x managed node in /home/tcserver/springsource-tc-server-node and have a tc Runtime instance called myserver:

      prompt$ cd /home/tcserver/springsource-tc-server-node
      prompt$ ./tcruntime-ctl.sh myserver stop

      If your tc Runtime instance is located in a directory other than the main tc Server installation directory, use the INSTANCE-DIR/bin/tcruntime-ctl.sh script to stop the instance; in this case, you do not specify the name of the instance as a parameter to the script. For example:

      prompt$ cd /home/tcserver/instances/myserver
      prompt$ bin/tcruntime-ctl.sh stop

      Windows only. If you installed the tc Runtime instances as Windows services, you use the Windows Services Console to stop them.

      See Starting and Stopping tc Runtime Instances.

    9. Windows only. If you installed your tc Runtime instances as Windows services, uninstall them. For example, if you installed tc Server managed node in c:\home\tcserver\springsource-tc-server-node and you created a tc Runtime instance called myserver:

      prompt> cd c:\home\tcserver\springsource-tc-server-node
      prompt> tcruntime-ctl.bat myserver uninstall

      If your tc Runtime instance is located in a directory other than the main tc Server installation directory, use the INSTANCE-DIR\bin\tcruntime-ctl.bat script to uninstall the instance; in this case, you do not specify the name of the instance as a parameter to the script. For example:

      prompt> cd c:\home\tcserver\instances\myserver
      prompt> bin\tcruntime-ctl.bat uninstall

      See Windows: Starting and Stopping tc Runtime Instances as Windows Services.

    10. Install the Standard Edition of tc Runtime using the general installation procedure described in Installing Standard Edition (tc Runtime Only). Be sure to install the 2.1 runtime in a different directory from the 2.0.X runtime, such as /home/tcserver-2.1.

      This creates, for example, the directory /home/tcserver-2.1/springsource-tc-server-standard.

    11. Create a new 2.1 instance to which you will migrate the configuration and applications of your existing 2.0.X instance. To avoid confusion, consider calling the instance something different, such as myserver-2.1, although this is not necessary. For example, on Unix:

      prompt$ cd /home/tcserver-2.1/springsource-tc-server-standard
      prompt$ ./tcruntime-instance.sh create myserver-2.1

      Note that the syntax of the tcruntime-instance script has changed in 2.1. See Creating tc Runtime Instances: Typical Steps.

    12. Manually migrate the configuration, applications, and anything else you added to the 2.0.x instance to the new 2.1 instance. The exact steps differ for each instance, depending on how you have configured the 2.0.x instance and the applications you have deployed. For example, you can copy over *.war files from the old webapps directory to the new one. If you changed the old conf/server.xml or conf/context.xml files, make the equivalent changes to the new files. If you prefer, you can make these changes using the HQ UI once you add this new tc Runtime instance to the HQ Inventory.

    13. Start the new myserver-2.1 instance as described in Starting and Stopping tc Runtime Instances. The startup messages should indicate that you are using the new 2.1 runtime:

      prompt$ cd /home/tcserver-2.1/springsource-tc-server-standard
      prompt$ ./tcruntime-ctl.sh myserver-2.1 start
      
      INFO Instance name:      myserver-2.1
      INFO Script directory:   /home/tcserver-2.1/springsource-tc-server-standard
      INFO tc Runtime location:/home/tcserver-2.1/springsource-tc-server-standard
      INFO Instance base:      /home/tcserver-2.1/springsource-tc-server-standard
      INFO Binary dir:         /home/tcserver-2.1/springsource-tc-server-standard/tomcat-6.0.29.B.RELEASE
      INFO Runtime version:    6.0.29.B.RELEASE
      INFO Script version:     2.5.0.RELEASE
      Using CATALINA_BASE:   /home/tcserver-2.1/springsource-tc-server-standard/myserver-2.1
      Using CATALINA_HOME:   /home/tcserver-2.1/springsource-tc-server-standard/tomcat-6.0.29.B.RELEASE
      Using CATALINA_TMPDIR: /home/tcserver-2.1/springsource-tc-server-standard/myserver-2.1/temp
      Using JRE_HOME:        /home/java/jdk1.6.0_21
      Using CLASSPATH:       /home/tcserver-2.1/springsource-tc-server-standard/myserver-2.1/bin/tomcat-juli.jar:/home/tcserver-2.1/springsource-tc-server-standard/tomcat-6.0.29.B.RELEASE/bin/bootstrap.jar

When you complete this procedure for all components on all computers, you will have successfully upgraded your 2.0.X tc Server installation to 2.1.X.

Post-Upgrade Requirements and Notes

After you complete HQ upgrade, you must always use the new versions of HQ Server and Agents rather than the old ones. For details about starting and stopping them, see Starting and Stopping the HQ Server and Agents.

When you first connect to the HQ user interface that is using the upgraded HQ Server, the new 4.5 HQ Agent(s) and other resources show up in the Auto-Discovery portlet. You must add them to the Inventory before you can proceed. The 4.5 HQ Server itself now uses a tc Runtime instance internally (called tc Runtime hq-server, which you add to the Inventory along with eveyrthing other new resource. You should, however, not use this tc Runtime instance for your own purposes.

Your existing 2.0.x tc Runtime instances should already be in the HQ Inventory, and you should be able to manage and control them as before. Any previous custom configuration of the isntances should show up intact, as well as all deployed applications. Additionally, all history and management information about the instance, such as control history, historical metric data, and alert settings, will still be available.

If you created a new 2.1 instance, it will show up in the Auto-Discover panel; as soon as you add it to the HQ inventory, you can start monitoring and managing it as usual. Because you migrated the old 2.0.x instance to this new 2.1 instance, you can delete the old 2.0.X tc Runtime instance from the HQ Inventory.

8.2 Upgrading a 2.1.X tc Runtime to the Latest Version

The procedure in this section describes how to upgrade a 2.1.X tc Runtime installation (such as 2.1.0) to a later 2.1.X version (such as 2.1.1). For simplicity, it is assumed your existing 2.1.X tc Runtime environment results from you following the Quick Start instructions.

Note: This section does does not describe in detail how to upgrade your existing Hyperic components because those tasks follow the standard Hyperic upgrade procedures.

Understanding the 2.1.X Overall tc Server Upgrade Process

Upgrading a 2.1.X tc Server installation to a later 2.1.X version consists of the following subtasks:

  • Optionally upgrade your existing HQ Server and Agent to a later 4.5.X version than what you have currently installed. See the Release Notes for the fully-qualified version of the HQ Server and Agent that a particular 2.1.X version of tc Server supports. The release notes also indicate the version of HQ that contains a particular version of the tc Server HQ plug-in.

    To perform this subtask, you download the 4.5.X HQ EE distribution and use its setup.sh -upgrade (Unix) or setup.bat -upgrade (Windows) command script to perform the upgrade. To upgrade an existing HQ Agent, you simply unzip the latest version alongside your existing one.

    This documentation does not describe how to perform this sub-task because it follows the standard Hyperic upgrade procedure. For details, see Upgrade Hyperic Components.

  • Install the 2.1.X tc Runtime on top of the previous 2.1.X version and optionally upgrade existing tc Runtime instances to use the latest verison of the Runtime.

    To perform this subtask, you unzip the appropriate tc Server distribution into your existing tc Runtime installation directory. Then, if required, you use the tcruntime-instance.sh script to upgrade each tc Runtime instance.

    For details, see the next section.

Depending on how you have configured your tc Server installation, you might perform different subtasks on different computers. For example, on the computer on which you have installed the HQ Agent and runtime component (called a managed node), you perform only the Agent and Runtime upgrade. On the computer on which you installed the HQ Server (and nothing else), you perform only the HQ Server upgrade. If you installed all components on the same computer, then simply execute all sub-tasks on the same computer.

Most of the examples in this section use Unix syntax; if you are upgrading on Windows, change the forward slashes to back-slashes and replace the *.sh suffix with *.bat when running a command script. Other changes between the two platforms are called out.

tc Runtime 2.1.X Upgrade Procedure

For simplicity, the examples in this procedure assume that you are upgrading a 2.1.0 tc Runtime to version 2.1.1 (unless otherwise noted.) The procedure describes only how to upgrade the tc Runtime and associated instances; for information about upgrading the Hyperic components, see Upgrade HQ Components.

To upgrade your 2.1.X tc Runtime to a later 2.1.X version, follow these steps:

  1. Unix only: Read Important Note When Installing on Unix Platforms.

  2. Back up your existing tc Runtime installation, including all your tc Runtime instances.

  3. Start a terminal (Unix) or command prompt (Windows.)

  4. If they are running, stop your tc Runtime instances. For example, if you installed tc Runtime in /home/tcserver/springsource-tc-server-standard and you have a tc Runtime instance called myserver:

    prompt$ cd /home/tcserver/springsource-tc-server-standard
    prompt$ ./tcruntime-ctl.sh myserver stop

    If your tc Runtime instance is located in a directory other than the main tc Server installation directory, use the INSTANCE-DIR/bin/tcruntime-ctl.sh script to stop the instance; in this case, you do not specify the name of the instance as a parameter to the script. For example:

    prompt$ cd /home/tcserver/instances/myserver/bin
    prompt$ ./tcruntime-ctl.sh stop

    Windows only. If you installed the tc Runtime instances as Windows services, use the Windows Services Console to stop them.

    See Starting and Stopping tc Runtime Instances.

  5. Windows only. If you installed the tc Runtime instances as Windows services, uninstall them. For example, if you installed the runtime in c:\home\tcserver\springsource-tc-server-standard and you created a tc Runtime instance called myserver:

    prompt> cd c:\home\tcserver\springsource-tc-server-standard
    prompt> tcruntime-ctl.bat myserver uninstall

    If your tc Runtime instance is located in a directory other than the main tc Server installation directory, use the INSTANCE-DIR\bin\tcruntime-ctl.bat script to stop the instance; in this case, you do not specify the name of the instance as a parameter to the script. For example:

    prompt> cd c:\home\tcserver\instances\myserver\bin
    prompt> tcruntime-ctl.bat uninstall

    See Windows: Starting and Stopping tc Runtime Instances as Windows Services.

  6. Download the appropriate tc Server distribution file from the SpringSource Download Center.

    Typically, you download the Standard Edition of tc Server in either the compressed TAR or ZIP format; for example:

    • springsource-tc-server-standard-2.1.1.RELEASE.tar.gz
    • springsource-tc-server-standard-2.1.1.RELEASE.zip
  7. Unzip or untar the new 2.1.X package on top of your existing tc Runtime directory. For example, if your existing tc Runtime is installed in /home/tcserver/springsource-tc-server-standard and you downloaded the new package into the /home/Downloads directory:

    prompt$ cd /home/tcserver
    prompt$ unzip /home/Downloads/springsource-tc-server-standard-2.1.1.RELEASE.zip

    The preceding command overwrites some of your existing files, such as the tcruntime-XXX.sh|bat scripts; if the unzip or untar command asks you whether it should overwrite them, you should answer yes. The unzip or tar command also creates new directories, such as the new Tomcat directory (such as tomcat-6.0.29.C.RELEASE) which should be alongside the old version.

  8. Upgrading pinned tc Runtime instances. This step describes how to upgrade the version of your pinned existing tc Runtime instances so that they use the latest tc Runtime as their core, such as 6.0.29.C-RELEASE. If your tc Runtime instances are unpinned, then you do not perform this step because they will automatically use the latest tc Runtime version.

    See Pinning a tc Runtime Instance to a Specific Version for more information about pinned or unpinned instances.

    From your terminal (Unix) or command window (Windows), change to the main tc Runtime directory, such as /home/tcserver/springsource-tc-server-standard:

    prompt$ cd /home/tcserver/springsource-tc-server-standard

    For each existing pinned tc Runtime instance you want to upgrade, run the following command:

    prompt$ ./tcruntime-instance.sh modify-version instance --instance-directory instanceDir 

    where:

    • instance refers to the name of the subdirectory that contains the tc Runtime instance you want to upgrade, such as myserver
    • instanceDir refers to the full or relative pathname of the directory in which the instance lives. You do not have to specify this option if your instance directory is in the main tc Server installation directory, such as /home/tcserver/springsource-tc-server-standard/myserver .

    Because you do not specify a specific tc Runtime version, the tcruntime-instance.sh|bat script unpins the instance so that it will always use the latest version of tc Runtime it can find when it starts.

    For example, to upgrade the tc Runtime instance myserver (whose instance directory is in the main tc Server installation directory) to the latest tc Runtime version:

    prompt$ ./tcruntime-instance.sh modify-version myserver 

    On Windows:

    prompt> tcruntime-instance.bat modify-version myserver 

    If the upgrade succeeds, you should see:

    Configuring instance 'myserver' to use latest Tomcat version available at startup

    In the preceding examples, the myserver instance directory is assumed to be in the main tc Server installation, such as /home/tcserver/springsource-tc-server-standard. If it is in a different directory, such as /home/tcserver/instances/myserver, then run the following command:

    prompt$ ./tcruntime-instance.sh modify-version myserver --instance-directory /home/tcserver/instances 
  9. Start the tc Runtime instances as described in Starting and Stopping tc Runtime Instances. The startup messages should indicate that the instance is now using the latest Apache Tomcat version (such as 6.0.29.C) as its core. For example:

    prompt$ cd /home/tcserver/springsource-tc-server-standard
    prompt$ ./tcruntime-ctl.sh myserver start
    
    INFO Instance name:      myserver
    INFO Script directory:   /home/tcserver/springsource-tc-server-standard
    INFO tc Runtime location:/home/tcserver/springsource-tc-server-standard
    INFO Instance base:      /home/tcserver/springsource-tc-server-standard
    INFO Binary dir:         /home/tcserver/springsource-tc-server-standard/tomcat-6.0.29.C.RELEASE
    INFO Runtime version:    6.0.29.C.RELEASE
    INFO Script version:     2.1.1.RELEASE
    Using CATALINA_BASE:   /home/tcserver/springsource-tc-server-standard/myserver
    Using CATALINA_HOME:   /home/tcserver/springsource-tc-server-standard/tomcat-6.0.29.C.RELEASE
    Using CATALINA_TMPDIR: /home/tcserver/springsource-tc-server-standard/myserver/temp
    Using JRE_HOME:        /home/java/jdk1.6.0_21
    Using CLASSPATH:       /home/tcserver/springsource-tc-server-standard/myserver/bin/tomcat-juli.jar:/home/tcserver/springsource-tc-server-standard/tomcat-6.0.29.C.RELEASE/bin/bootstrap.jar

    If your tc Runtime instance is located in a directory other than the main tc Server installation directory, use the INSTANCE-DIR/bin/tcruntime-ctl.sh script to start the instance; in this case, you do not specify the name of the instance as a parameter to the script. For example:

    prompt$ cd /home/tcserver/instances/myserver/bin
    prompt$ ./tcruntime-ctl.sh start

When you complete this procedure, you will have successfully upgraded your existing 2.1.X tc Runtime to a later version of 2.1.

9. Tutorial: Using HQ to Configure and Manage tc Runtime Instances

This tutorial describes the basic steps for configuring and monitoring a tc Runtime instance with the HQ user interface and for managing applications deployed to the instance.

9.1 Before You Begin

Install and start the components of tc Server (HQ Server, HQ Agent, and at least one tc Runtime instance); invoke the HQ user interface in your browser; and log in with the administration username/password (default hqadmin/hqadmin) or with HQ user permissions to configure a tc Runtime instance. To accomplish these tasks, see:

Most HQ user interface pages have a Help link at the top-right corner. On the tc Runtime configuration pages, click the icon to the right of each field to get information about the field.

For simplicity, it is assumed in this tutorial that you are going to log in to the HQ user interface as the super-user (hqadmin). If, however, you are going to log in as a non-super-user, see User Permissions Required to Use the tc Server HQ Plugin Features for information about the required HQ user permissions to be able to use all the tc Server HQ plugin features described in this tutorial.

9.2 Restart a tc Runtime Instance

In this procedure you restart a currently running tc Runtime instance. If you need navigational help for the first few steps, see Getting Started with the HQ user interface.

  1. Click the Resources > Browse link at the top of the HQ user interface

  2. Click the Servers(X) link to see the list of servers known by HQ. To limit the number of displayed servers to only tc Runtime instances, select SpringSource tc Runtime 6.0 from the Search drop-down list, then click the green arrow to the far right.

  3. In the table, click the tc Runtime instance you want to restart. The server is listed as platform-resource tc Runtime catalina-base-dir , where

    • platform-resource is the computer hosting the tc Runtime instance.
    • catalina-base-dir is the CATALINA_BASE directory of the tc Runtime instance without the leading directory pathnames, such as myserver .
  4. Click the Control tab. You use this HQ user interface page to stop, start, and restart the current tc Runtime instance, as described in the next step.

  5. In the Quick Control section of the page, select Restart from the Control Action drop-down list, then click the arrow to the right, as shown in the following graphic.

    After you click the restart button, the Command State field in the Current Status section says In progress until the tc Runtime instance is successfully restarted. The Current Status section always displays information about the last control action; in this case the restart of the tc Runtime instance.

9.3 Reconfigure a tc Runtime Instance

In this procedure you make a few simple configuration changes to the current tc Runtime instance. You change a startup-up JVM option (maximum heap size) and change the working directory of the default virtual host for the tc Runtime instance.

It is assumed in this procedure that you have already browsed to the tc Runtime instance that you want to configure, as described in Restart a tc Runtime Instance.

  1. Click the Views > Server Configuration tab:

    The server configuration pages consist of four tabs:

    • Home: Main Server Configuration page.

      There is also an Advanced group for performing more advanced tasks, such as reloading the settings from the tc Runtime instance server.xml file (in which you lose local changes made with the HQ user interface), reverting to a previous server configuration, and uploading a new server configuration using a server.xml file.

    • Configuration: Configure tc Runtime startup options, JVM options, context information for all deployed Web applications, default behavior of JSPs and static content, and so on.

    • Resources: Create and configure JDBC datasources.

    • Services: Create and configure tc Runtime services such as virtual hosts, connectors, and so on.

  2. Click the Configuration tab, then the Server Start option in the list on the left.

  3. In the General section on the right, enter 1024 in the Max Heap Size (MB) field.

  4. Click Save at the bottom of the page.

    The message Configuration saved successfully appears at the top, as shown in the following graphic. This means that HQ has updated its in-memory cache with your changes. Additionally, a box appears at the top of the page with the heading Changes have been made locally, along with two links to either write (push) the changes to the actual tc Runtime configuration files, such as CATALINA_HOME/bin/setenv.sh (in this case) or CATALINA_BASE/conf/server.xml, or to undo the changes.

    HQ displays this box until you save or undo, although you can make additional changes before you save or undo. In this tutorial, you make another change, and then write the changes to disk.

  5. Click the Services tab. In the table, click the Catalina service. This is the default service of tc Runtime.

  6. In the list on the left, click Hosts, then in the table on the right, click the localhost virtual host.

  7. In the Host Properties section, enter new_work_dir in the Work Directory field. This specifies that the localhost will use a different work directory from the default, which is CATALINA_BASE/work. Relative work directories are created under CATALINA_BASE, such as CATALINA_BASE/new_work_dir. The tc Runtime instance uses the work directory to perform its internal work.

  8. Click Save at the bottom of the page.

    The message Configuration saved successfully appears in the top.

    [Note]Note

    When you update the tc Runtime configuration using the HQ user interface, if the property you are updating was previously specified as a variable (such as ${jmx.port}), tc Runtime replaces that variable with the actual value in the server.xml file. This means, for example, that port="${jmx.port}" would become port="6954". The variable is still set in the catalina.properties file to the old value, but the tc Runtime does not actually use it because the property is now hardcoded in the server.xml file.

  9. In the box at the top titled Changes have been made locally, click Push configuration changes to Tomcat.

  10. Click Push Changes to Server.

  11. In the box at the top, click the restarted link to restart the tc Runtime instance so that the changes take effect.

  12. Click Restart Server.

    The message Server Restarted appears at the top.

9.4 Deploy a Web Application to a tc Server Runtime Instance

In this procedure you deploy a new Web application to a tc Runtime instance, then stop and start it. It is assumed that you already have a Web application WAR file to deploy. If you do not, see Tutorial: Very Simple Web Application Development for a tutorial that shows you how to create a very simple HelloWorld Web application and package it into a WAR file.

It is also assumed that you have already browsed to the tc Runtime instance to which you want to deploy, as described in Restart a tc Runtime Instance.

  1. Click the Views > Application Management tab. You use this page to deploy and manage tc Runtime applications.

  2. If the Web application you want to deploy is physically located on the same computer from which you are running your browser, go to the Deploy Application from Local Machine section. If the Web application is actually located on the computer on which the tc Runtime instance is running, then go to the Deploy Application from Server Machine section. If you are running your browser on the same computer as tc Runtime, then you can go to either section. A typical remote machine use case is machines that use network mounted drives to which they have access.

    Enter the location of the Web application in the corresponding field. Use the Browse button to find a local Web application WAR file; you must already know the full pathname of the WAR file if you are deploying it from the tc Runtime computer. If you are deploying from a remote machine, your local machine must have access to the remote directory that contains the Web application file.

    The following graphic shows deploying from a local computer

  3. Enter hello in the Context path field.

    Optionally, check the Use cold deployment strategy if you want the tc Runtime instance to shutdown, deploy the application, and then start up again. By default (if box is unchecked), the tc Runtime instance hot-deploys the application, which means it does not shutdown then restart but simply deploys the application while the instance is still running. Use the cold deployment strategy if you want to avoid common hot deployment errors, such as running out of PermGen space. The PermGen space holds the metadata about classes that have been loaded/created in the JVM.

  4. Click Upload and deploy (for a local WAR file) or Deploy (for deploying a WAR file on the tc Runtime computer). HQ deploys the WAR file to the current tc Runtime instance. You should see the Web application listed in the Deployed Applications table.

  5. You can start, stop, reload, and undeploy a deployed Web application by selecting it in the Deployed Applications table and clicking the corresponding button.

To invoke the Web application you just deployed, enter the following URL in a browser:

http://host:port/hello

where:

  • host is the name of the computer on which the tc Runtime instance is running. If it is the same computer as your browser, you can enter localhost.

  • port is the TCP/IP port to which the tc Runtime instance listens. The default value is 8080.

For example:

http://localhost:8080/hello

You can get the host and port information of a tc Runtime instance by looking at its HTTP connector configuration from the Views > Server Configuration > Services tab.

9.5 Add tc Runtime Instances to the Favorite Resources Portlet

The main HQ dashboard includes a Favorite Resources portlet that lists the resources you most often manage. When you first install HQ, the portlet is empty. However, as you manage a particular resource, you might decide that you want to add it to your favorites portlet because you return to it frequently. In this procedure you add a tc Runtime instance to the Favorite Resources portlet.

  1. Navigate to the tc Runtime instance, as described in the first three steps of Restart a tc Runtime Instance.

  2. Click the Tools Menu in the top-left corner and choose Add to Dashboard Favorites.

  3. In the box, click the name of the user for whose dashboard the tc Runtime instance will show up as a favorite. Following our tutorial, click hqadmin, although if you logged in as another user you can enter that one.

  4. Click Add.

  5. The tc Runtime instance is displayed in the Favorite Resources portlet on the main dashboard:

9.6 Create an HQ Group of Multiple tc Runtime Instances

In this procedure you create an HQ group of multiple tc Runtime instances. You can then deploy a Web application to the group in a procedure similar to Deploy a Web Application to a tc Server Runtime Instance, and HQ does the work of deploying the Web application to each member of the group. Similarly, you can stop, start, and restart all the servers in the group with a procedure similar to Restart a tc Runtime Instance.

Using HQ groups saves a lot of time if you need to control multiple tc Runtime instances running on many different computers, as well as deploy and manage their applications.

It is assumed in this procedure that you have at least two tc Runtime instances running and that you have added them to the HQ inventory. See Creating a New tc Runtime Instance and Getting Started with the HQ User Interface.

[Tip]Tip

It might take a while for the HQ user interface to auto-detect a new tc Runtime instance after you start it. You can force a new auto-discovery to speed the process.

To force an auto-discovery, browse to the platform resource where you started the new tc Runtime instance. For example, in this tutorial the platform resource is called juliet-desktop. Then click New Auto-Discovery in the Tools Menu. In the Quick Auto-Discovery Scan section, click OK. The new tc Runtime instance should show up in the Auto-Disocvery portlet of the main Dashboard very shortly. You can then add it using the Add to Inventory button as usual.

  1. Click the Resources > Browse link at the top of the HQ user interface.

  2. Click the Servers (X) link to list all the servers in your resource inventory. The tc Runtime instances are listed as Server Type SpringSource tc Runtime 6.0.

    If there are many server resources listed in the table, you can narrow down the list by selecting SpringSource tc Runtime 6.0 in the Search drop-down list, then clicking the green arrow all the way to the right of the Search line.

  3. For each tc Runtime instance you want to include in the new group, check the box to the left of the instance's entry in the table.

    Note that the HQ UI itself internally uses an instance of tc Runtime (called hq-server); you should not change the configuration of this instance or add it to your groups.

  4. Click Group.

    The following graphic shows how to group together two tc Runtime instances called tc Runtime anotherserver and tc Runtime myserver.

  5. In the Group Manager window, click Add to New Group.

  6. In the General Properties section, enter a name for the group, such as tcserverGroup and an optional description and location, such as San Francisco.

  7. Click OK.

    Depending on the members of the group, HQ creates a Compatible Group/Cluster or Mixed Group. The first type of group consists of a single type of server, such as only tc Runtime instances. The second mixed group consists of different types of servers, such as both tc Runtime instances and Apache Tomcat servers.

To stop or restart the group of servers, and deploy an application to the group:

  1. Click Resources > Browse at the top of the HQ user interface.

  2. Click Compatible Groups/Clusters if your group consists of the same servers, or Mixed Groups if your group consists of different types of servers.

  3. In the table, click on the name of the group.

  4. To stop or start all the servers in the group, click the Control tab, then follow the steps for controlling a single server, as described in Restart a tc Runtime Instance. The breadcrumbs at the top of the console page list the group name (tcserverGroup in this case) rather than the tc Runtime instance name.

  5. To deploy and manage applications on all servers in the group, click the Views > Application Management tab, then follow the steps for deploying or managing the applications of a single server, as described in Deploy a Web Application to a tc Server Instance.

[Note]Note

In this release of tc Server, you cannot update the configuration of a group of tc Runtime instances from the Views > Server Configuration tab.

9.7 Monitoring tc Runtime Instances

As soon as you add a resource (such as a tc Runtime instance) to the HQ inventory, HQ begins collecting a variety of metrics about the resource that you can use to monitor its state and health. HQ displays the values of the metrics over a specified period of time using indicator charts or tables.

Examples of the types of metrics that HQ collects about tc Runtime include:

  • Number of thread deadlocks detected.

  • Size of the free heap memory.

  • JSP count per minute.

  • Number of servlet requests per minute.

The following procedure describes how to view the monitoring metrics for a tc Runtime instance.

  1. Navigate to the tc Runtime instance, as described in the first three steps of Restarting the tc Runtime Instance.

  2. Click the Monitor tab.

    The charts under the Indicator tab show data about the entire tc Runtime instance, such as thread deadlocks detected and size of the free heap memory and the tc Runtime instance up time. Click the Metric Data tab to see the same information in tabular form.

    The Services table to the left lists the services associated with the tc Runtime instance, such as the JSP and servlet monitors.

  3. In the Services table, click SpringSource tc Runtime Servlet Monitor. The chart on the right shows usage metrics about the servlets deployed to the tc Runtime instance.

  4. Click on other services within the Monitoring tab to view more monitoring information for the tc Runtime instance.

You can create an alert for a resource that fires when a specified condition is met, and optionally specify a control action that occurs when the alert is fired. HQ is preconfigured for a deadlock detection alert; see Manage the Preconfigured Deadlock Detected Alert to modify it.

9.8 Manage the Preconfigured Deadlock Detected Alert

HQ includes a preconfigured alert that triggers once if the Deadlocks Detected metric exceeds 0. HQ applies this alert to all auto-discovered tc Runtime instances, enables it by default, and then checks the metric every two minutes to see if the condition has been met. After triggering, HQ disables the alert until an administrator marks it as Fixed.

The following procedure describes how to view this preconfigured alert, modify it so that HQ automatically restarts the tc Runtime instance in which the alert is triggered, and then disable it.

  1. Navigate to the tc Runtime instance, as described in the first three steps of Restart a tc Runtime Instance.

  2. Click the Alert tab at the top of the page.

  3. Click the Configure button. A page is displayed with a table of alerts that have been defined for this tc Runtime instance. You should see the preconfigured Deadlocks Detected alert; by default it is active (enabled.)

  4. In the table, click Deadlocks Detected to display the Alert Definition page.

  5. Click the Control Action tab at the bottom of the page, and then click the EDIT... button.

  6. Select restart from the Control Type drop-down list.

  7. Click OK.

    You have modified the alert so that HQ automatically restarts the affected tc Runtime instance when HQ detects a thread deadlock.

  8. To disable the alert:

    1. Return to the page that contains the Alert Definitions table by clicking the Return to Alert Definitions link at the top left corner of the page.

    2. In the table, select the Deadlocks Detected alert by checking the box to the left of its name.

    3. At the bottom of the table, choose No in the Set Active drop-down list.

    4. Click the arrow to the right of the drop-down list. The Active column for the Deadlocks Detected alert changes to No.

10. Tutorial: Very Simple Helloworld Web Application

This tutorial is for beginning programmers who want to know the minimal basic information on how to create servlets and JSPs, package them into a deployable WAR file, deploy the application to a tc Runtime instance, and run the application in a browser. The tutorial uses Ant as its build framework. You can also use an IDE, such as SpringSource Tool Suite, to create the application. The tutorial shows you how to create each artifact, from the servlet source to the Ant build.xml file, from scratch.

10.1 Before You Begin

Install SpringSource tc Server and Ant. See Installing tc Server and Apache Ant Project.

10.2 Creating and Deploying the Helloworld Web Application

To create a Web application and deploy it to a tc Runtime instance:

  1. When you install Ant, add or update the following environment variables:

    • ANT_HOME: Set this variable to the location where you installed Ant, such as /usr/local/ant/apache-ant-1.7.1.

    • PATH: Update your PATH variable to include ANT_HOME/bin.

  2. Set your JAVA_HOME environment variable to the directory where your JDK is installed.

  3. Create the project directory structure that will contain the HelloWorld Web application source files.

    Create the top-level directory called helloworld. You can create the helloworld directory in any location on your computer that you have permission to update. The helloworld directory will contain the Ant build file (build.xml).

    Create two sub-directories of the helloworld directory: src that will contain the Java source file for the HelloWorld servlet and web that will contain the JSP file, static HTML file, images, and deployment descriptor.

    In the src directory, create an examples sub-directory. This directory corresponds to the package that contains the HelloWorld servlet

    In the web directory, create two subdirectories: images, which will contain any images used by the Web application, and WEB-INF, which is the standard directory that contains the Web application deployment descriptor files.

    The following graphic describes this simple project directory hierarchy:

    Figure 10.1. Directory Hierarchy of the HelloWorld Application

    Directory Hierarchy of the HelloWorld Application


  4. Create the Hello.java servlet Java source file and put it in the helloworld/src/examples directory.

    For sample Java code that you can copy and paste into your own Java file and a brief explanation of how to program a simple servlet, see Hello.java .

  5. Create the hello.jsp JSP file and put it in the helloworld/web directory.

    For sample JSP code that you can copy and paste into your own JSP file and a brief explanation of how to program a simple JSP, see hello.jsp .

  6. Create the web.xml Web application deployment descriptor and put it in the helloworld/web/WEB-INF directory.

    For sample XML that you can copy and paste into your own web.xml file and a brief explanation of the elements, see web.xml .

  7. Create the default index.html page and put it in the helloworld/web directory.

    For a sample HTML file that you can copy and paste into your own file, see index.html .

  8. Create the Ant build file (build.xml) that includes targets for compiling and packaging the Web application and put it in the helloworld directory.

    For a sample Ant build file that you can copy and paste into your own file, see build.xml .

  9. In your own build file, update the tcserver.home property to fit your environment; it should point to the CATALINA_HOME of your tc Runtime installation. For example, if you installed tc Server (Standard Edition) in the /home/tcServer directory, set the tcserver.home property in the build.xml file to something like the following:

    <property name="tcserver.home" value="/home/tcServer/springsource-tc-server-standard/tomcat-6.0.25.A-RELEASE" />
  10. Right-click the following image and save it with name springsource.png to the helloworld/web/images directory.

    When you finish creating all the artifacts that make up the HelloWorld Web application, your directory structure and contents should look like the following:

    helloworld
    helloworld/build.xml
    helloworld/src
    helloworld/src/examples
    helloworld/src/examples/Hello.java
    helloworld/web
    helloworld/web/hello.jsp
    helloworld/web/images
    helloworld/web/images/springsource.png
    helloworld/web/index.html
    helloworld/web/WEB-INF
    helloworld/web/WEB-INF/web.xml 
  11. Compile and package the Helloworld Web application by opening a command window, changing to the helloworld directory, and executing the following command:

    prompt> ant all

    This ant command creates a deployable WAR file of the Helloworld application called hello.war in the helloworld/dist directory. You will see the following output from the ant command if it completes successfully:

    Buildfile: build.xml
    
    clean:
    
    prepare:
        [mkdir] Created dir: /home/samples/helloworld/dist
        [mkdir] Created dir: /home/samples/helloworld/work/WEB-INF/classes
         [copy] Copying 4 files to /home/samples/helloworld/work
    
    compile:
        [javac] Compiling 1 source file to /home/samples/helloworld/work/WEB-INF/classes
    
    dist:
          [jar] Building jar: /home/samples/helloworld/dist/hello.war
    
    all:
    
    BUILD SUCCESSFUL
    Total time: 2 seconds
  12. Start a tc Runtime instance. See Starting and Stopping tc Runtime Instances.

  13. Deploy the Web application JAR file to the tc Runtime instance. See Deploying Applications to tc Runtime Instances.

  14. Invoke the HelloWorld Web application in your browser :

    http://host:port/hello

    where:

    • host is the name of the computer that is hosting the tc Runtime instance. If it is the same as the computer hosting your browser, you can use localhost.

    • port is the port to which the tc Runtime instance listens. The default value is 8080.

    In the example, /hello is the default URL context of the Web application, which in this example is simply the name of the WAR package without the trailing .war file extension.

    For example:

    http://localhost:8080/hello

10.3 Java Source of the Hello.java Servlet

The following Java source file shows the code for the Hello.java servlet; see Description of the Hello Servlet for information about the relevant parts of the code sample.

package examples;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


/**
 * Simple Hello servlet.
 */

public final class Hello extends HttpServlet {


    /**
     * Respond to a GET request for the content produced by
     * this servlet.
     *
     * @param request The servlet request we are processing
     * @param response The servlet response we are producing
     *
     * @exception IOException if an input/output error occurs
     * @exception ServletException if a servlet error occurs
     */
    public void doGet(HttpServletRequest request,
                      HttpServletResponse response)
      throws IOException, ServletException {

        response.setContentType("text/html");
        PrintWriter writer = response.getWriter();        
        writer.println("<html>");
        writer.println("<head>");
        writer.println("<title>Sample Application Servlet Page</title>");
        writer.println("</head>");
        writer.println("<body bgcolor=white>");

        writer.println("<table border=\"0\" cellpadding=\"10\">");
        writer.println("<tr>");
        writer.println("<td>");
        writer.println("<img src=\"images/springsource.png\">");
        writer.println("</td>");
        writer.println("<td>");
        writer.println("<h1>Sample Application Servlet</h1>");
        writer.println("</td>");
        writer.println("</tr>");
        writer.println("</table>");

        writer.println("This is the output of a servlet that is part of");
        writer.println("the Hello, World application.");

        writer.println("</body>");
        writer.println("</html>");
    }
} 

Description of the Hello Servlet

In the preceding code:

  • The Hello class extends the javax.servlet.http.HttpServlet abstract class. This abstract class provides a framework for handling the HTTP protocol. When extending the HttpServlet abstract class, a programmer must override at least one method, depending on the type of requests the servlet supports, such as HTTP GET, HTTP POST, and so on.

  • The Hello servlet overrides the doGet method because it supports HTTP GET. The parameters of the method are the HTTP request and response.

  • The response.setContentType method tells the receiver of the response (such as a browser) that the response type is text/html, or simple HTML.

  • The response.getWriter method returns a PrintWriter object used to send character text to the client, in this case a browser. The writer.println lines simply build an HTML file that will be rendered by the browser that invokes the servlet.

For complete documentation about the Java Servlet technology, including API reference documentation, specifications, and tutorials, see Java Servlet Technology.

10.4 JSP Source for the hello.jsp JSP

The following source shows the JSP code for the hello.jsp JSP; see Description of the hello.jsp for additional information.

  <html>
  <head>
    <title>Sample Application JSP Page</title>
  </head>

  <body bgcolor=white>

  <table border="0" cellpadding="10">
    <tr>
      <td align=center>
        <img src="images/springsource.png">
      </td>
      <td>
         <h1>Sample Application JSP Page</h1>
      </td>
    </tr>
  </table>

  <br />
  <p>This is the output of a JSP page that is part of the HelloWorld application.</p>

  <%= new String("Hello!") %>

  </body>
</html> 

Description of the hello.jsp

The hello.jsp page is a static HTML page embedded with a JSP command. A JSP command is an XML-like snippet that encapsulates logic that dynamically generates content within the static HTML. JSP commands can include directives, declarations, expressions, actions, and blocks of Java code, all enclosed within angle-brackets, like XML elements. At compile-time, the JSP is converted into a servlet, which is what tc Runtime instance actually runs at runtime.

The hello.jsp includes the following simple JSP directive:

<%= new String("Hello!") %>

This JSP directive simply prints out a message to the client (browser): Hello!

For complete documentation about JSPs, including specifications, FAQs, and tutorials, see JavaServer Pages Technology.

10.5 Sample web.xml File

The following sample web.xml deployment descriptor shows how to declare the HelloServlet servlet in the Helloworld Web application. See also Description of the web.xml File.

<?xml version="1.0" encoding="ISO-8859-1" ?>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">

    <display-name>HelloWorld Application</display-name>
    <description>
        This is a simple web application with a source code organization
        based on the recommendations of the Application Developer's Guide.
    </description>

    <servlet>
        <servlet-name>HelloServlet</servlet-name>
        <servlet-class>examples.Hello</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>HelloServlet</servlet-name>
        <url-pattern>/hello</url-pattern>
    </servlet-mapping>

</web-app>     

Description of the web.xml File

In the preceding web.xml deployment descriptor file, the <servlet> XML element declares the HelloServlet, the examples.Hello Java class implements the servlet, and the <servlet-mapping> XML element specifies the /hello URL pattern that invokes the servlet in a browser. This URL pattern is used in the index.html file.

10.6 Sample Default index.html File

The following sample index.html file is the default HTML file that appears in a browser when a user invokes the Helloworld Web application. The index.html file in turn invokes both the hello.jsp JSP and HelloServlet servlet.

The index.html file invokes the JSP by simply linking to its name (hello.jsp). The HTML file invokes the servlet by linking to its URL pattern (/hello).

<html>
  <head>
    <title>Sample "Hello, World" Application</title>
  </head>
  <body bgcolor=white>

    <table border="0" cellpadding="10">
      <tr>
        <td>
          <img src="images/springsource.png">
        </td>
        <td>
          <h1>Sample "Hello, World" Application</h1>
        </td>
      </tr>
    </table>

    <p>This is the home page for the HelloWorld Web application. </p>
    <p>To prove that they work, you can execute either of the following links:
    <ul>
      <li>To a <a href="hello.jsp">JSP page</a>.
      <li>To a <a href="hello">servlet</a>.
    </ul>

  </body>
</html>

10.7 Ant Build File to Compile and Package the Example

The following sample Ant build.xml file compiles the servlet code and packages all the Web application artifacts into a deployable WAR file; see Description of the build.xml File for additional information.

<project name="My Project" default="help" basedir=".">
  <!-- Define the properties used by the build -->
  <property name="app.name"      value="hello"/>
  <property name="tcserver.home" value="/home/tcServer/springsource-tc-server-standard/tomcat-6.0.25.A-RELEASE" />
  <property name="work.home"    value="${basedir}/work"/>
  <property name="dist.home"     value="${basedir}/dist"/>
  <property name="src.home"      value="${basedir}/src"/>
  <property name="web.home"      value="${basedir}/web"/>

  <target name="help">
    <echo>You can use the following targets:</echo>
    <echo> </echo>
    <echo>  help    : (default) Prints this message </echo>
    <echo>  all     : Cleans, compiles, and packages application</echo>
    <echo>  clean   : Deletes work directories</echo>
    <echo>  compile : Compiles servlets into class files</echo>
    <echo>  dist    : Packages artifacts into a deployable WAR</echo>
    <echo></echo>
    <echo>For example, to clean, compile, and package all at once, run:</echo>
    <echo>prompt> ant all </echo>
  </target>

  <!-- Define the CLASSPATH -->
  <path id="compile.classpath">
    <fileset dir="${tcserver.home}/bin">
      <include name="*.jar"/>
    </fileset>
    <pathelement location="${tcserver.home}/lib"/>
    <fileset dir="${tcserver.home}/lib">
      <include name="*.jar"/>
    </fileset>
  </path>

  <target name="all" depends="clean,compile,dist"
          description="Clean work dirs, then compile and create a WAR"/>

  <target name="clean"
          description="Delete old work and dist directories">
    <delete dir="${work.home}"/>
    <delete dir="${dist.home}"/>
  </target>

  <target name="prepare" depends="clean"
          description="Create working dirs and copy static files to work dir">
    <mkdir  dir="${dist.home}"/>
    <mkdir  dir="${work.home}/WEB-INF/classes"/>
    <!-- Copy static HTML and JSP files to work dir -->
    <copy todir="${work.home}">
      <fileset dir="${web.home}"/>
    </copy>
  </target>

  <target name="compile" depends="prepare"
          description="Compile Java sources and copy to WEB-INF/classes dir">
    <javac srcdir="${src.home}"
          destdir="${work.home}/WEB-INF/classes">
        <classpath refid="compile.classpath"/>
    </javac>
    <copy  todir="${work.home}/WEB-INF/classes">
      <fileset dir="${src.home}" excludes="**/*.java"/>
    </copy>

  </target>


  <target name="dist" depends="compile"
          description="Create WAR file for binary distribution">
    <jar jarfile="${dist.home}/${app.name}.war"
         basedir="${work.home}"/>
  </target>

</project> 

Description of the build.xml File

The Ant build.xml file defines targets for compiling and packaging the HelloWorld Web application. In preparation, the build process first creates an output directory and creates the required directory hierarchy below it for a standard Web application. This includes the WEB-INF directory that will contain the web.xml file. The build process also sets the build's CLASSPATH value to include the required JAR files in the tc Server distribution.

The compile target simply uses the Java compiler to compile the Java servlet file into a class and copies it to the output directory. The package target creates a JAR file of the output directory.

11. Troubleshooting

The following sections describe common problems and resolutions.

11.1 tc Runtime: ClassNotFoundException when Starting a 6.0 Instance

In version 6.0 of tc Server, instances automatically included a ServiceabilityLifecycleListener Listener in their server.conf file. The functionality provided by this listener was removed in version 2.0 of tc Server and new 2.0 instances did not include it, although the listener was internally retained in support of 6.0 instances. This meant you could still start a 6.0 instance that included this Listener.

However, in version 2.1 of tc Server, the ServiceabilityLifecycleListener listener has been completely removed. This means that you will get the following error if you try to start a 6.0 instance that includes this Listener in its server.xml file:

java.lang.ClassNotFoundException: com.springsource.tcserver.serviceability.ServiceabilityLifecycleListener
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
... text removed

If you run into this problem, remove the following element from the server.xml file of the instance:

<Listener classname="com.springsource.tcserver.serviceability.ServiceabilityLifecycleListener"/> 

You should now be able to start the instance without errors.

11.2 HQ: Resources Not Showing up in the HQ User Interface

By default, an HQ Agent checks for new resources only once a day. For example, if you start the HQ Server and HQ Agent, and then create a new tc Runtime instance and start it, you might have to wait 24 hours for the new tc Runtime instance to be auto-discovered by HQ. You can force an auto-discovery of new resources in two ways:

  • Stop and start the HQ Agent on the computer for which you want to force an auto-discovery. When the HQ Agent starts, it automatically checks for new resources. See Starting and Stopping the HQ Server and Agents for details.

  • Use the HQ user interface to force an auto-discovery:

    1. From the main dashboard, click the Resources > Browse link.

    2. Click the Platforms(XX) link.

    3. In the table, click on the name of the platform for which you want to force an auto-discovery.

    4. In the top-right Tools Menu box, click New Auto-Discovery.

    5. In the top section called Quick Auto-Discovery Scan, click OK.

    New resources show up in the Auto-Discovery portlet of the main dashboard as soon as HQ completes the scan of the platform.

11.3 HQ: Errors When Trying to Add an Auto-Discovered Resource

If you get errors when trying to add an auto-discovered resource to the HQ server using the user interface:

  1. Log onto the platform that hosts the resource that is returning errors when you try to add it using the HQ user interface.

  2. Stop the HQ Agent. See Starting and Stopping the HQ Server and Agents for details.

  3. Change to the HQ_AGENT_INSTALL_DIR directory, where HQ_AGENT_INSTALL_DIR refers to the directory in which you installed the HQ Agent, such as /home/hyperic/agent-4.5.X.X-EE.

  4. Remove the data directory.

  5. Start the HQ Agent.

    Because you removed the data directory, the Agent operates as if this is a new installation, so the start script takes you through the configuration process for the Agent again. This step often clears up the auto-discovery errors and allows you to again add all new auto-discovered resources through the HQ user interface.

11.4 HQ Agent: Errors When Starting on Solaris

This section applies to Solaris platforms only.

If you try to start the HQ Agent on Solaris and get errors similar to the following:

prompt$ cd /home/tcserver/agent-4.5.0.7-EE/bin
prompt$ ./hq-agent.sh start

Bad string
Unable to locate any of the following binaries:
/home/tcserver/agent-4.5.0.7-EE/wrapper/sbin/../../wrapper/sbin/wrapper---32
/home/tcserver/agent-4.5.0.7-EE/wrapper/sbin/../../wrapper/sbin/wrapper---64
/home/tcserver/agent-4.5.0.7-EE/wrapper/sbin/../../wrapper/sbin/wrapper
...

make sure that you have set the locale correctly on your Solaris computer. In particular, the locale must not be set to a UTF-8 locale, such as en_US.UTF-8. The following are sample settings for the LC_CTYPE environment variable that resolve the problem:

LC_CTYPE=en_US
LC_CTYPE=en_US.ISO8859-1
LC_CTYPE=en_US.ISO8859-15

11.5 tc Runtime: Hot Redeploy/Stop/Undeploy on Windows Fails

Because of the way that file system locking works on Windows platforms, hot redeployment of a Web application on Windows can sometimes fail. Hot redeployment may also fail when you stop or undeploy a Web application on Windows. The problem can occur when you use the HQ user interface or the tcsadmin command-line interface.

To resolve the problem:

  1. Update the CATALINA_BASE/conf/context.xml file of the tc Runtime instance and set the following two attributes of the <Context> element to true:

    • antiJARLocking: When set to true, the Tomcat classloader takes extra measures to avoid JAR file locking when resources are accessed inside JARs through URLs. This action affects the startup time of applications, but is useful on platforms (such as Windows) or configurations where file locking can occur.

    • antiResourceLocking: When set to true, Tomcat prevents any file locking. This action affects startup time of applications significantly, but allows full Web application hot redeploy on platforms (such as Windows) or configurations where file locking can occur.

    The following context.xml snippet shows how to specify the attributes; only the relevant part of the file is shown:

    <Context antiJARLocking="true" antiResourceLocking="true">
    
           <WatchedResource>...
  2. Restart the tc Runtime instance for the change to take effect.

Setting antiJARLocking and antiResourceLocking to true forces tc Runtime to copy files rather than read them in place. Also, if you try to copy in a new .jsp file directly, tc Runtime does not pick it up.

If you prefer, you can set these two properties in the context.xml file of the application itself rather than in the context.xml file for the entire tc Runtime instance.

For more information and warnings about configuring the context.xml file, see The Context Container.

11.6 tc Runtime: Error When Running a Web Application on tc Runtime and Using SpringSource Tool Suite

When you use SpringSource Tool Suite (STS) with tc Server, and you try to run a Web application on the configured tc Runtime, you might get the following error:

Nov 29, 2009 7:47:29 PM com.springsource.tcserver.security.PropertyDecoder <init<
INFO: tcServer property decoder has been initialized.
Nov 29, 2009 7:47:30 PM com.springsource.tcserver.serviceability.rmi.JmxSocketListener init
INFO: Started up JMX registry on 127.0.0.1:6969
Nov 29, 2009 7:47:30 PM org.apache.coyote.http11.Http11Protocol init
SEVERE: Error initializing endpoint
java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java :365)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at java.net.ServerSocket.<init<(ServerSocket.java:185 )
at java.net.ServerSocket.<init<(ServerSocket.java:141 )
... and so on

STS might not have write permission to the main tc Server installation path, and the tc Runtime has to create files when it starts. Modify the path of tc Runtime in STS to use the workspace metadata.

11.7 tc Runtime: JVM Performing a Full GC

By default, tc Runtime instances have JMX turned on so that you can use Hyperic HQ to monitor and manage the instances. Specifically, tc Runtime instances enable JMX using the JmxSocketListener in the server.xml configuration file, as shown:

<Listener className="com.springsource.tcserver.serviceability.rmi.JmxSocketListener" 
          port="${jmx.port}"
          ...
/>

When JMX is enabled in this way, some JVMs (such as Sun's) that do distributed garbage collection will periodically invoke System.gc, causing a Full GC. This action can affect the performance of your deployed Web applications.

There are two ways to work around this issue:

Specify that the JVM invoke the System.gc() less often. For example, to configure the Sun JVM to invoke System.gc() at one-hour intervals, use the following JVM options:

-Dsun.rmi.dgc.client.gcInterval=3600000
-Dsun.rmi.dgc.server.gcInterval=3600000

Alternatively, disable explicit GC altogether. For example, to disable GC for the Sun JVM:

-XX:+DisableExplicitGC

In both cases, set these JVM options in the INSTANCE-DIR/bin/setenv.sh|bat file using the JVM_OPTS variable appropriate to your platform.