-1

How to configure multiple tomcats running on same machine to Apm server ? With single tomcat I m able to start APMUI.

chandan
  • 93
  • 1
  • 11

1 Answers1

0

Just to be sure we are on the same page here:

  1. You have multiple instances of Tomcat running on the same machine.
  2. You have configured APM through CATALINA_OPTS as defined in the Elastic APM docs.

I guess the simplest setup would be to have a wrapper script to start each Tomcat instance that exports the right CATALINA_OPTS. You could share global settings like the APM server address, but could customize the app name, namespaces,...

xeraa
  • 10,456
  • 3
  • 33
  • 66
  • Yes I have set up multiple tomcats. – chandan Jan 02 '19 at 03:32
  • Catalina opts I have set for both tomcats. javaagent:/apps/elastic-apm-agent-1.2.0.jar -Delastic.apm.service_name=3dspaceCAS -Delastic.apm.application_packages=org.example,org.another.example -Delastic.apm.server_urls=http://localhost:8200 I have used same flag for both tomcats setenv.sh – chandan Jan 02 '19 at 03:33
  • So what is the problem? You are not receiving the traces? First, make sure your `CATALINA_OPTS` show up in your Tomcat logs (to make sure they are really applied). There is nothing else that should be required to make this work with multiple Tomcat instances IMO. – xeraa Jan 02 '19 at 03:46
  • In Catalina.out I could see it has set catalina_opts provided. I m using same apm.service_name for both tomcats. How could I differentiate these tomcats on kibana UI?. – chandan Jan 02 '19 at 03:52
  • So you are receiving the events for both Tomcats, you just want to make the differentiation between them? If those are different apps, use different `service_name` for them. Otherwise I would use the environment setting for this: https://github.com/elastic/apm-agent-java/blob/master/docs/configuration.asciidoc#environment – xeraa Jan 02 '19 at 17:43
  • I have tried using different service name but no luck. Is there any limitations on number of Java agents within one machine / cluster? Suppose if I have six tomcats running on application server can I monitor all these using Apm agents? – chandan Jan 02 '19 at 18:03
  • I have multiple Java apps running on a single host and the APM agent is working fine. Though I am using different service names since they are not the same app. One thing you could look into what `context.request.url.full` is set to. I assume your services are running on different ports and you will see which one is being reached based on the full URL. – xeraa Jan 02 '19 at 18:43