Apache Tomcat

Turbonomic supports connecting to individual Apache Tomcat targets. Turbonomic connects to the Tomcat process as a remote client via remote JMX access. Target configuration includes the port used by the JMX/RMI registry.

Prerequisites

  • Apache Tomcat 7.x, 8.x, or 8.5.x

  • A valid JMX user account for the Tomcat server

    If Tomcat security is enabled, this must be a Tomcat JMX user with a readonly role.

  • For VMware environments, VMware Tools must be installed on the VM that hosts the Tomcat server. For Hyper-V environments, Hyper-V Integration Services must be installed

    This ensures that the VM hosting the Tomcat server can get its IP address.

  • Remote JMX access is enabled through a port that is opened to the firewall

  • Discovered infrastructure

    Turbonomic discovers Tomcat servers that are running on VMs or containers. The hosting VM or container must already be in your Turbonomic inventory.

    To set the target for a server running on a VM, you must have first discovered the hosting VM through a hypervisor target. To set the target for a server running in a container, you must have configured container discovery for Tomcat applications.

Configuring JMX remote access

Turbonomic monitors and controls the Tomcat server via JMX Remote access. You must configure a JMX Remote port.

Note that to work with a firewall you should also set the RMI Server port — If you don’t set an RMI port, then JMX sets an arbitrary ephemeral port, and you can’t guarantee that the port will be open to your firewall.

There are two ways to set JMX Remote port on Linux platforms:

  • Ports specified as system properties

    You can set the port via the system property, com.sun.management.jmxremote.port. For example:

    com.sun.management.jmxremote.port=8050

    A common way to set this property is to declare it in the CATALINA_OPTS system variable — You can set this in the setenv.sh script. For example:

    CATALINA_OPTS="$CATALINA_OPTS 
    -Dcom.sun.management.jmxremote
    -Dcom.sun.management.jmxremote.port=8050"
    export CATALINA_OPTS

    Note that this sets the JMX Remote port, but it does not set the RMI Server port — Tomcat startup will specify an ephemeral port for the RMI server.

  • Ports specified in a JMX Remote Lifecycle Listener

    This listener component fixes the ports used by the JMX/RMI Server. When you configure the listener, you specify both the JMX Remote port and the RMI Server port. This is the preferred method when working with a firewall. For more information, see the Apache Tomcat documentation.

On Windows, the typical installation is with Tomcat as a service. There are two ways to set the JMX Remote port:

  • Via setenv.bat

    Add the property to the CATALINA_OPTS environment variable:

    set "CATALINA_OPTS=%CATALINA_OPTS% -Dcom.sun.management.jmxremote.port=8050"
  • Use the Tomcat configuration utility (tomcat7w or tomcat8w)

    Set the port with the following command:

    -Dcom.sun.management.jmxremote.port=8050"

To discover the JMX port that is set to an already running Tomcat, you can look in the following locations:

  • For Linux platforms, look in the configuration files - Either:

    • setenv.sh - Assuming you configured the port by adding it to the CATALINA_OPTS environment variable

    • $CATALINA_HOME/conf/server.xml - Assuming you configured a JMX Remote Lifecycle Listener in this file

  • For Windows platforms, look in:

    • setenv.bat - Assuming you configured the port by adding it to the CATALINA_OPTS environment variable

    • The Windows registry - Assuming you installed Tomcat as a Windows service using the Tomcat Configuration utility

Adding a Tomcat target

Note:

This topic describes features that are available in the new design of the user interface. This new design is enabled by default. If you switched to the legacy design, click New Feature Toggle button in the navigation bar of the user interface and then turn on the toggle to re-enable the new design. For more information, see New Design for the User Interface.

You can add an individual Tomcat server as a target, or you can add all matching servers within a given scope.

  1. Click Settings > Target Configuration.

  2. On the Target configuration page, click Add Target.

  3. On the Select target page, click Tomcat.

  4. In the side panel, review the connection requirements and then click Connect Target.

  5. Configure the following settings:

    • Display name

      Specify a name that uniquely identifies this connection.

      This name is for display purposes only and does not need to match any name in Tomcat.

    • Username

      Specify the username of an account with the Admin role.

    • Password

      Specify the password of an account with the Admin role.

    • Scope

      Specify the scope Turbonomic uses for application discovery.

      The scope is a group of applications that are stitched to the underlying VMs when the VMs are discovered as part of a separate Turbonomic target.

      If you set a scope, Turbonomic searches for virtual machines in the selected group.

      Turbonomic can monitor up to 500 virtual machines in a group. If you have more than 500 virtual machines in your environment, split them across smaller groups and then add those groups as individual targets.

    • JMX remote port

      Specify a JMX port that is set to an already running Tomcat process.

    • Authenticate all database servers

      If you select this option, Turbonomic attempts to authenticate all database servers in the selected scope. If Turbonomic is unable to authenticate a database server, the target is not added and no data is collected.

Monitored resources

Turbonomic monitors the following resources:

  • Application Component

    • Virtual Memory (VMem)

      Virtual Memory is the measurement of memory that is in use.

    • Virtual CPU (VCPU)

      Virtual CPU is the measurement of CPU that is in use.

    • Transaction

      Transaction is a value that represents the per-second utilization of the transactions that are allocated to a given entity.

    • Heap

      Heap is the portion of a VM or container’s memory allocated to individual applications.

    • Response Time

      Response Time is the elapsed time between a request and the response to that request. Response Time is typically measured in seconds (s) or milliseconds (ms).

    • Threads

      Threads is the measurement of thread capacity utilized by applications.

    • Connection

      Connection is the measurement of database connections utilized by applications.

    • Remaining GC Capacity

      Remaining GC capacity is the measurement of Application Component uptime that is not spent on garbage collection (GC).

  • Virtual Machine

    • Virtual Memory (VMem)

      Virtual Memory is the measurement of memory that is in use.

    • Virtual CPU (VCPU)

      Virtual CPU is the measurement of CPU that is in use.

Actions

Turbonomic supports the following actions:

  • Application Component (Tomcat Application)

    • Resize Heap

      This action can only be executed outside Turbonomic.

    • Resize Thread Pool

      This action can only be executed outside Turbonomic.

    • Resize Connection Capacity

      This action can only be executed outside Turbonomic.

  • Virtual Machine

    • Provision additional resources (VMem, VCPU)

    • Move Virtual Machine

    • Move Virtual Machine Storage

    • Reconfigure Storage

    • Reconfigure Virtual Machine

    • Suspend VM

    • Provision VM