Monitoring on-premises J2SE applications
You can configure the J2SE data collector to monitor the on-premises J2SE applications running on stand-alone Docker containers, VMs, or physical nodes and then send monitoring data to the Monitoring server.
Before you begin
- Check that you downloaded the configuration package to obtain the server information, for more information, see Obtaining the server configuration information.
- Check whether you downloaded the J2SE data collector package. For more information, see Downloading the J2SE data collector.
Procedure
-
Extract the
j2se_datacollector.tgz
file that you get from Downloading the J2SE data collector.tar -xf path-of-j2se_datacollector.tgz
-
With
config_dc.sh
script under J2SE data collector directory, and theibm-cloud-apm-dc-configpack.tar
that is downloaded in Obtaining the server configuration information, run the following command to apply server configuration to the monitored application:path-of-j2se_datacollector.tgz/bin/config_dc.sh [-silent <silent_file>]
Note: If silent_file is not provided, the default
silent_config_j2se_dc.txt
under the same directory ofconfig_dc.sh
will be used. -
Copy configpack files into J2SE data collector directory:
cp ./ibm-cloud-apm-dc-configpack/global.environment /opt/j2se_dc/itcamdc/etc cp ./ibm-cloud-apm-dc-configpack/keyfiles/keyfile.jks /opt/j2se_dc/itcamdc/etc
-
Run
mkdir ../logs
. -
Run the following command:
chmod +x path-of-j2se_datacollector.tgz/runtime/j2seAPPLICATION_ALIAS.HOSTNAME.APPLICATION_ALIAS/dcstartup.sh
Where:
- APPLICATION_ALIAS is the value that is configured in APPLICATION_ALIAS item in silent_file.
- The default value of HOSTNAME is localhost.
-
Run the following command:
sh -c path-of-j2se_datacollector.tgz/runtime/j2seAPPLICATION_ALIAS.HOSTNAME.APPLICATION_ALIAS/dcstartup.sh
Where:
- APPLICATION_ALIAS is the value that is configured in APPLICATION_ALIAS item in silent_file.
- The default value of HOSTNAME is localhost.
Note: If you run the J2SE application in a docker container, you can start the application in background by running the following command:
docker run -d -p <docker_port:app_port> j2seapp:1.0
Where docker_port is the docker port exposed, app_port is the application port, for example, 10090:8080.
-
If the J2SE application runs in a docker container, rebuild your docker container with J2SE data collector and configpack installed by running:
docker build -t < application image name >:< image tag >
Docker file example:
FROM ibmjava:8 WORKDIR /opt/j2se_dc COPY /j2se_datacollector.tgz /opt/j2se_dc RUN tar -xf /opt/j2se_dc/j2se_datacollector.tgz COPY /silent_config_j2se_dc.txt /opt/j2se_dc/bin/ COPY /EmployeeWeb-1.0-SNAPSHOT.jar /opt/ COPY /ibm-cloud-apm-dc-configpack/global.environment /opt/j2se_dc/itcamdc/etc/ COPY /ibm-cloud-apm-dc-configpack/keyfiles/keyfile.jks /opt/j2se_dc/itcamdc/etc/ RUN /opt/j2se_dc/bin/config_dc.sh -silent COPY /dcstartup.sh /opt/j2se_dc/runtime/j2sej2seApp.localhost.j2seApp/ COPY /del_slf4.sh /opt/j2se_dc/runtime/j2sej2seApp.localhost.j2seApp/ RUN chmod +x /opt/j2se_dc/runtime/j2sej2seApp.localhost.j2seApp/dcstartup.sh RUN mkdir /opt/logs ENTRYPOINT [ "sh", "-c", "/opt/j2se_dc/runtime/j2sej2seApp.localhost.j2seApp/dcstartup.sh" ]
Where:
/opt/j2se_dc
is path-of-j2se_datacollector.tgz.EmployeeWeb-1.0-SNAPSHOT.jar
is the application name.- j2seApp is APPLICATION_ALIAS item value in silent_file.