Monitoring on-premises Tomcat applications
You can configure the Tomcat light weight data collector to monitor the on-premises Tomcat applications running on stand-alone Docker containers and then send monitoring data to the Tomcat light weight data collector.
Before you begin
- Ensure that you install the Unified Agent plug-ins for LWDC and OpenTracing. For more information, see Installing and configuring Unified Agent plug-ins.
- Check whether you downloaded the Tomcat light weight data collector package. For more information, see Downloading the Tomcat light weight data collector.
- Enable Opentracing and add Jaeger sampling properties under “/
/ttdc/etc/ ttdc.properties” file in Tomcat LWDC package. - Before installing/configuring the Tomcat DC we should explicitly enable “OPENTRACING_ENABLED” property to “true” and uncomment it.
OPENTRACING_ENABLED=true
-
In the Jaeger sampler properties, add the following under Jaeger Endpoint section:
JAEGER_SAMPLER_TYPE=ratelimiting JAEGER_SAMPLER_PARAM=10
Procedure
-
Create a docker file with all the prerequisites (Tomcat server, Java and DC installer) required for Tomcat DC installation using on-premise UA. Extract the
tomcat_datacollector.tgz
file that you get from Downloading the Tomcat light weight data collector. The UA on-premise should be up and running. -
You need to set the LWDC_UA_LISTENER_URL parameter in Tomcat LWDC to support the UA plugin. By setting this parameter (in system environment/script), LWDC data flow will redirect to UA LWDC Plugin instead of ICAM.
LWDC_UA_LISTENER_URL = http://<IP>:8848/metric
-
Data Collector config pack related commands should be commented in the docker file while creating docker container using on-premise UA.
#configPack #RUN mkdir <dc_configpack_dir> #ADD ibm-cloud-apm-dc-configpack.tar <dc_configpack_dir> #RUN cp <dc_configpack_dir>/global.environment <lwdc_install_dir>/itcamdc/etc/ #RUN cp <dc_configpack_dir>/keyfiles/keyfile.jks <lwdc_install_dir>/itcamdc/etc
-
Run the following commands to install and configure Tomcat DC on Docker environment with UA:
docker build -t <name of the docker image> . docker push <name of the docker image> docker container run -it -d --name <name of the container> -p <Tomcat EXT Port>:<Tomcat Port> -p <JMX Ext Port>:<JMX Port> --add-host=<ICAM Hostname>:<ICAM IP> --add-host=<OnPremise Hostname>:<Onpremise IP> -e "UA_LWDC_LISTENER_URL =http://<IP>:8848" -e "UA_JAEGER_ENDPOINT=<IP:Port>/api/traces" <name of the docker image>
-
Create a silent_config_tomcat_dc.txt silent configuration file in the same directory as your Dockerfile. The file for silent configuration is available in the installation package. A sample of the silent configuration is as follows:
JAVA_HOME=/usr TT_STATUS=true DD_STATUS=false MT_STATUS=false SERVER_NAME=TestServer SERVER_HOME=/opt/tomcat/apache-tomcat-9.0.5 SERVER_VERSION=8 SERVER_JMX_HOSTNAME=127.0.0.1 SERVER_JMX_PORT_NUMBER=9966 SERVER_JMX_USER_NAME= SERVER_JMX_PASSWORD=
where:
- JAVA_HOME is the Java home that is used by the Tomcat server. The default value is /usr.
- TT_STATUS is the flag to enable transaction tracking.
- DD_STATUS and MT_STATUS are currently not used, and can be set to default values.
- SERVER_NAME is the name of the Tomcat server that is monitored by the data collector. The default value is 'TestServer'
- SERVER_HOME is the Tomcat server home directory, default value is /opt/tomcat
- SERVER_VERSION is Tomcat server version, default value is 8. Supported values are 8 and 9.
- SERVER_JMX_HOSTNAME is the hostname where JMX for corresponding Tomcat Server will be accessible.
- SERVER_JMX_PORT_NUMBER is the port number to be configured for accessing JMX for the containerized Tomcat server.
- SERVER_JMX_USER_NAME is the user name for authentication of JMX connection. Default value is blank that indicates 'no authentication'.
- SERVER_JMX_PASSWORD is the password of JMX user for authentication of JMX connection. Default value is blank that indicates 'no authentication'.