Installation of APM agent In Elasticsearch For Tomcat Server
you can do the installation of an APM agent for java to monitor your Tomcat server where your application is running or hosted.
This is used to monitor the java based application and you can also monitor other apps using this APM. you can also monitor your application based on ruby, go, etc. and you can create separate APM-server to handle these all tasks.
I have installed this APM-server in the elk stack. These tools can help you to monitor your apps issues.
Step 1: Download Elasticsearch APM agent from here
Step 2: Package Name is elastic-apm-agent-1.6.1.jar
After downloading the Elasticsearch agent, put these jar files under your Apache tomcat.
Tomcat location is /opt/tomcat9/apache-tomcat-9.0.13/
I’m moving this package from root to tomcat location.
mv elastic-apm-agent-1.6.1.jar /opt/tomcat9/apache-tomcat-9.0.13/
Step 3: Now you have to make a service for this under this location and change values according to your apps.
Put this code in this file setenv.sh
Give Execution permission to setenv.sh
chmod +x setenv.sh
Step 4: kill the tomcat process
ps -ef | grep java
kill -9 pid
Now start the tomcat service,
If you see the -javaagent by running ps -ef | grep java, which means you have correctly defined the Catalina_OPTS.
Step 5: Now go to your Kibana, where you have to check the agent is receiving data or not.
Data successfully received.
Check Out: Configuration of Filebeat For Elasticsearch
Step 6: Now Click on load kibana objects
Finally, click on Launch APM.
Step 7: Now click on tomcat-addressbook
Everything is working fine.