Re: [EXT] Datadog _ JMX Integration facing connection issues.
Hello chris, thanks for adding a point and I may have missed your email. below is some of the points, which showed me how tomcat is being started in my application. * Line 19: INFO [main][2023-12-27 09:00:38,983] - org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:108) - Tomcat initialized with port(s): 9109 (http) 10109 (http) Line 21: INFO [main][2023-12-27 09:00:39,008] - org.apache.juli.logging.DirectJDKLog.log(DirectJDKLog.java:173) - Starting service [Tomcat] Line 22: INFO [main][2023-12-27 09:00:39,009] - org.apache.juli.logging.DirectJDKLog.log(DirectJDKLog.java:173) - Starting Servlet engine: [Apache Tomcat/9.0.75] Line 134: INFO [lab1workflow4scalsvc2zus1][version:1.7.99-alpha.1130][traceId:][spanId:][parentSpanId:][spanExportable:][main][2023-12-27 09:01:01,057]- org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start:Line 220 - Tomcat started on port(s): 9109 (http) 10109 (http) with context path '/lab1workflow4scalsvc2zus1 * to launch tomcat, we are not using any command here, I am trying to build my code to an image, making some helm chart out of it, using helm chart to install in my AKS containers. Thanks & Regards, -- SAI VAMSI .B Senior DevOps Engineer From: Christopher Schultz Sent: Thursday, December 14, 2023 20:33 To: users@tomcat.apache.org Subject: Re: [EXT] Datadog _ JMX Integration facing connection issues. Sai Vamsi, On 12/14/23 00:26, Bodavula, Sai Vamsi Mohan Krishna (TR Technology) wrote: > Hai Chuck., > Thanks for jumping in., > > thats what my concern is. > as previously added by Chris, I have added my annotations in Catalina_opts ., > Which is preferred by Java_Process for adding the annotations., But Here by > using catalina_opts., they are not reflecting. > > where as adding them in java-tool-options., Makes a process with Tomcat and a > process that listens on the mentioned port., but throws port is already > binded., as its an environment variable, its already looking for a port, > where as its already created., throws binding error. > > Yesterday ., I thought of adding both the formats, adding java_tool_opts and > Catalina opts., inorder to utilize the previous thigns., as below > > - name: JAVA_TOOL_OPTIONS >value: {{ .Values.deployment.javaVMMemoryArgument }} > > - name: POD_IP >valueFrom: > fieldRef: >fieldPath: status.podIP > - name: CATALINA_OPTS >value: >- > -Dcom.sun.management.jmxremote > -Dcom.sun.management.jmxremote.port=49151 > -Djava.rmi.server.hostname=$POD_IP > -Dcom.sun.management.jmxremote.authenticate=false > -Dcom.sun.management.jmxremote.ssl=false > -Dcom.sun.management.jmxremote.local.only=false > -Xms2048M -Xmx10240M > > Java_tool_opts are as : -XX:+UseStringDeduplication -XX:+UseContainerSupport > -Dcom.sun.management.jmxremote > > just added to initiate a JMX process., > > but nothing is working out., > I would like to request you for further inputs How are you launching Tomcat itself? Are you using catalina.sh or something similar, or do you use some kind of embedded-launch? It sounds to me like using CATALINA_OPTS is causing Tomcat not to start at all. If you use JAVA_TOOL_OPTIONS (which Tomcat ignores), Tomcat will start but won't initialize JMX in the way you want it to. The solution is to look at the log files that are produced when Tomcat launches (or fails to launch). Are you able to observe those? It would be great to see the exact command Helm (or whatever) uses to attempt to launch Tomcat, and then the stdout/stderr of that attempt. The diagnostic messages shown when a JVM refuses to start are usually pretty good. Same thing with Tomcat, though Tomcat usually starts even if e.g. no connectors are successfully started because there is no actual requirement for Tomcat to listen to any ports. -chris > > From: Chuck Caldarale > Sent: Thursday, December 14, 2023 00:28 > To: Tomcat Users List > Subject: Re: [EXT] Datadog _ JMX Integration facing connection issues. > > >> On Dec 13, 2023, at 10:36, Bodavula, Sai Vamsi Mohan Krishna (TR Technology) >> wrote: >> >> as you just asked ., >> I do have a process with Catalina. >> >> root@lab1workflow4scalsvc2zus1-deployment-659dd79df7-wg59g:/# netstat -tulpn >> Active Internet connections (only servers) >> Proto Recv-Q Send-Q Local Address Foreign Address State >>PID/Program name >> tcp6 0 0 :::34753:::*
Re: [EXT] Datadog _ JMX Integration facing connection issues.
by chance any findings on this., Thanks & Regards, -- SAI VAMSI .B Senior DevOps Engineer From: Bodavula, Sai Vamsi Mohan Krishna (TR Technology) Sent: Thursday, December 14, 2023 10:56 To: Tomcat Users List Subject: Re: [EXT] Datadog _ JMX Integration facing connection issues. Hai Chuck., Thanks for jumping in., thats what my concern is. as previously added by Chris, I have added my annotations in Catalina_opts ., Which is preferred by Java_Process for adding the annotations., But Here by using catalina_opts., they are not reflecting. where as adding them in java-tool-options., Makes a process with Tomcat and a process that listens on the mentioned port., but throws port is already binded., as its an environment variable, its already looking for a port, where as its already created., throws binding error. Yesterday ., I thought of adding both the formats, adding java_tool_opts and Catalina opts., inorder to utilize the previous thigns., as below - name: JAVA_TOOL_OPTIONS value: {{ .Values.deployment.javaVMMemoryArgument }} - name: POD_IP valueFrom: fieldRef: fieldPath: status.podIP - name: CATALINA_OPTS value: >- -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=49151 -Djava.rmi.server.hostname=$POD_IP -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.local.only=false -Xms2048M -Xmx10240M Java_tool_opts are as : -XX:+UseStringDeduplication -XX:+UseContainerSupport -Dcom.sun.management.jmxremote just added to initiate a JMX process., but nothing is working out., I would like to request you for further inputs cc :chris Thanks & Regards, -- SAI VAMSI .B Senior DevOps Engineer From: Chuck Caldarale Sent: Thursday, December 14, 2023 00:28 To: Tomcat Users List Subject: Re: [EXT] Datadog _ JMX Integration facing connection issues. > On Dec 13, 2023, at 10:36, Bodavula, Sai Vamsi Mohan Krishna (TR Technology) > wrote: > > as you just asked ., > I do have a process with Catalina. > > root@lab1workflow4scalsvc2zus1-deployment-659dd79df7-wg59g:/# netstat -tulpn > Active Internet connections (only servers) > Proto Recv-Q Send-Q Local Address Foreign Address State > PID/Program name > tcp6 0 0 :::34753:::*LISTEN > 1/java > tcp6 0 0 :::9109 :::*LISTEN > 1/java > tcp6 0 0 :::10109:::*LISTEN > 1/java > root@lab1workflow4scalsvc2zus1-deployment-659dd79df7-wg59g:/# ^C > root@lab1workflow4scalsvc2zus1-deployment-659dd79df7-wg59g:/# ps aux | grep > catalina > root 744 0.0 0.0 6460 680 pts/1S+ 11:47 0:00 grep > --color=auto catalina > root@lab1workflow4scalsvc2zus1-deployment-659dd79df7-wg59g:/# That shows only the grep process looking for catalina, not anything using catalina. If Tomcat were actually running, you’d see something like this (slightly reformatted for clarity): chuck@Chuck-MacBookPro apache-tomcat-9.0.83 > ps aux | grep catalina chuck16879 0.0 0.0 408626896 1376 s000 S+ 12:53PM 0:00.00 grep catalina chuck16874 0.0 0.9 415316912 153296 s000 S12:53PM 0:02.66 /Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home/bin/java -Djava.util.logging.config.file=/Users/chuck/Downloads/apache-tomcat-9.0.83/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dtest_port=9090 -Dignore.endorsed.dirs= -classpath /Users/chuck/Downloads/apache-tomcat-9.0.83/bin/bootstrap.jar:/Users/chuck/Downloads/apache-tomcat-9.0.83/bin/tomcat-juli.jar -Dcatalina.base=/Users/chuck/Downloads/apache-tomcat-9.0.83 -Dcatalina.home=/Users/chuck/Downloads/apache-tomcat-9.0.83 -Djava.io.tmpdir=/Users/chuck/Downloads/apache-tomcat-9.0.83/temp org.apache.catalina.startup.Bootstrap start - Chuck
Re: [EXT] Datadog _ JMX Integration facing connection issues.
Hai Chuck., Thanks for jumping in., thats what my concern is. as previously added by Chris, I have added my annotations in Catalina_opts ., Which is preferred by Java_Process for adding the annotations., But Here by using catalina_opts., they are not reflecting. where as adding them in java-tool-options., Makes a process with Tomcat and a process that listens on the mentioned port., but throws port is already binded., as its an environment variable, its already looking for a port, where as its already created., throws binding error. Yesterday ., I thought of adding both the formats, adding java_tool_opts and Catalina opts., inorder to utilize the previous thigns., as below - name: JAVA_TOOL_OPTIONS value: {{ .Values.deployment.javaVMMemoryArgument }} - name: POD_IP valueFrom: fieldRef: fieldPath: status.podIP - name: CATALINA_OPTS value: >- -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=49151 -Djava.rmi.server.hostname=$POD_IP -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.local.only=false -Xms2048M -Xmx10240M Java_tool_opts are as : -XX:+UseStringDeduplication -XX:+UseContainerSupport -Dcom.sun.management.jmxremote just added to initiate a JMX process., but nothing is working out., I would like to request you for further inputs cc :chris Thanks & Regards, -- SAI VAMSI .B Senior DevOps Engineer From: Chuck Caldarale Sent: Thursday, December 14, 2023 00:28 To: Tomcat Users List Subject: Re: [EXT] Datadog _ JMX Integration facing connection issues. > On Dec 13, 2023, at 10:36, Bodavula, Sai Vamsi Mohan Krishna (TR Technology) > wrote: > > as you just asked ., > I do have a process with Catalina. > > root@lab1workflow4scalsvc2zus1-deployment-659dd79df7-wg59g:/# netstat -tulpn > Active Internet connections (only servers) > Proto Recv-Q Send-Q Local Address Foreign Address State > PID/Program name > tcp6 0 0 :::34753:::*LISTEN > 1/java > tcp6 0 0 :::9109 :::*LISTEN > 1/java > tcp6 0 0 :::10109:::*LISTEN > 1/java > root@lab1workflow4scalsvc2zus1-deployment-659dd79df7-wg59g:/# ^C > root@lab1workflow4scalsvc2zus1-deployment-659dd79df7-wg59g:/# ps aux | grep > catalina > root 744 0.0 0.0 6460 680 pts/1S+ 11:47 0:00 grep > --color=auto catalina > root@lab1workflow4scalsvc2zus1-deployment-659dd79df7-wg59g:/# That shows only the grep process looking for catalina, not anything using catalina. If Tomcat were actually running, you’d see something like this (slightly reformatted for clarity): chuck@Chuck-MacBookPro apache-tomcat-9.0.83 > ps aux | grep catalina chuck16879 0.0 0.0 408626896 1376 s000 S+ 12:53PM 0:00.00 grep catalina chuck16874 0.0 0.9 415316912 153296 s000 S12:53PM 0:02.66 /Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home/bin/java -Djava.util.logging.config.file=/Users/chuck/Downloads/apache-tomcat-9.0.83/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dtest_port=9090 -Dignore.endorsed.dirs= -classpath /Users/chuck/Downloads/apache-tomcat-9.0.83/bin/bootstrap.jar:/Users/chuck/Downloads/apache-tomcat-9.0.83/bin/tomcat-juli.jar -Dcatalina.base=/Users/chuck/Downloads/apache-tomcat-9.0.83 -Dcatalina.home=/Users/chuck/Downloads/apache-tomcat-9.0.83 -Djava.io.tmpdir=/Users/chuck/Downloads/apache-tomcat-9.0.83/temp org.apache.catalina.startup.Bootstrap start - Chuck
Re: [EXT] Re: Datadog _ JMX Integration facing connection issues.
Hello Christopher. as you just asked ., I do have a process with Catalina. root@lab1workflow4scalsvc2zus1-deployment-659dd79df7-wg59g:/# netstat -tulpn Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp6 0 0 :::34753:::*LISTEN 1/java tcp6 0 0 :::9109 :::*LISTEN 1/java tcp6 0 0 :::10109:::*LISTEN 1/java root@lab1workflow4scalsvc2zus1-deployment-659dd79df7-wg59g:/# ^C root@lab1workflow4scalsvc2zus1-deployment-659dd79df7-wg59g:/# ps aux | grep catalina root 744 0.0 0.0 6460 680 pts/1S+ 11:47 0:00 grep --color=auto catalina root@lab1workflow4scalsvc2zus1-deployment-659dd79df7-wg59g:/# Thanks & Regards, -- SAI VAMSI .B Senior DevOps Engineer From: Christopher Schultz Sent: Saturday, December 9, 2023 03:27 To: users@tomcat.apache.org Subject: Re: [EXT] Re: Datadog _ JMX Integration facing connection issues. Sai Vamsi, On 12/8/23 00:43, Bodavula, Sai Vamsi Mohan Krishna (TR Technology) wrote: > Hey Christopher., > Greetings of the day. > > >1. > Might I have confused you with posting the arguments directly ., Yeah as i > just shared you the annotations with comments , to state you the stuff i am > using., But in my deployment ., I am using them in catalina opts., and trying > to call them from values.yaml., which looks like this : > > javaVMMemoryArgument: "-Xms2048M -Xmx10240M -XX:+UseStringDeduplication > -XX:+UseContainerSupport -Dcom.sun.management.jmxremote > -Dcom.sun.management.jmxremote.authenticate=false > -Dcom.sun.management.jmxremote.ssl=false > -Dcom.sun.management.jmxremote.local.only=false > -Dcom.sun.management.jmxremote.port=49151 > -Djava.rmi.server.hostname=lab1workflow4scalsvc2zus1-service.hqm-lab1.svc.cluster.local > " > > and I am referring the word "javaVMMemoryArgument" from values yaml and > calling it in Catalina_opts, so that it would fetch all these > annotations as mentioned above, during the deployment. This is my deployment > part., where I am referring to the above values from values.yaml > env: > - name: CATALINA_OPTS >value: {{ .Values.deployment.javaVMMemoryArgument }} > > > > > >1. > Coming to Process., I have searched for Java process that listens on my > mentioned port ie., 49151, but none of the process is listening to that > process. > > I even tried with > root@lab1workflow4scalsvc2zus1-deployment-fd64ff775-cwzn6:/# netstat -tulpn | > grep LISTEN > tcp6 0 0 :::10109:::*LISTEN > 1/java > tcp6 0 0 :::9109 :::*LISTEN > 1/java > root@lab1workflow4scalsvc2zus1-deployment-fd64ff775-cwzn6:/# netstat -tulpn | > more > Active Internet connections (only servers) > Proto Recv-Q Send-Q Local Address Foreign Address State > PID/Program name > tcp6 0 0 :::10109:::*LISTEN > 1/java > tcp6 0 0 :::9109 :::*LISTEN > 1/java > root@lab1workflow4scalsvc2zus1-deployment-fd64ff775-cwzn6:/# netstat -tulpn | > grep ':443'netstat -tulpn | grep ':443'^C > root@lab1workflow4scalsvc2zus1-deployment-fd64ff775-cwzn6:/# netstat -tulpn | > grep ':49151' > root@lab1workflow4scalsvc2zus1-deployment-fd64ff775-cwzn6:/# > > which confirms me that , any of the process is being listening on the port > 49151. > >2. > I would like to request you to suggest me with a better approach ., where i > am missing anything in this process! Good question. What is pid #1? Do those port numbers make any sense for your Tomcat-based service? Is Tomcat even running? Try 'ps aux | grep catalina' to see if there are any. Are you launching Tomcat using catalina.sh / startup.sh or similar? Or are you running Tomcat "embedded" within your own application? -chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [EXT] Re: Datadog _ JMX Integration facing connection issues.
Hey Christopher., Greetings of the day. 1. Might I have confused you with posting the arguments directly ., Yeah as i just shared you the annotations with comments , to state you the stuff i am using., But in my deployment ., I am using them in catalina opts., and trying to call them from values.yaml., which looks like this : javaVMMemoryArgument: "-Xms2048M -Xmx10240M -XX:+UseStringDeduplication -XX:+UseContainerSupport -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.port=49151 -Djava.rmi.server.hostname=lab1workflow4scalsvc2zus1-service.hqm-lab1.svc.cluster.local " and I am referring the word "javaVMMemoryArgument" from values yaml and calling it in Catalina_opts, so that it would fetch all these annotations as mentioned above, during the deployment. This is my deployment part., where I am referring to the above values from values.yaml env: - name: CATALINA_OPTS value: {{ .Values.deployment.javaVMMemoryArgument }} 1. Coming to Process., I have searched for Java process that listens on my mentioned port ie., 49151, but none of the process is listening to that process. I even tried with root@lab1workflow4scalsvc2zus1-deployment-fd64ff775-cwzn6:/# netstat -tulpn | grep LISTEN tcp6 0 0 :::10109:::*LISTEN 1/java tcp6 0 0 :::9109 :::*LISTEN 1/java root@lab1workflow4scalsvc2zus1-deployment-fd64ff775-cwzn6:/# netstat -tulpn | more Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp6 0 0 :::10109:::*LISTEN 1/java tcp6 0 0 :::9109 :::*LISTEN 1/java root@lab1workflow4scalsvc2zus1-deployment-fd64ff775-cwzn6:/# netstat -tulpn | grep ':443'netstat -tulpn | grep ':443'^C root@lab1workflow4scalsvc2zus1-deployment-fd64ff775-cwzn6:/# netstat -tulpn | grep ':49151' root@lab1workflow4scalsvc2zus1-deployment-fd64ff775-cwzn6:/# which confirms me that , any of the process is being listening on the port 49151. 2. I would like to request you to suggest me with a better approach ., where i am missing anything in this process! Thanks & Regards, -- SAI VAMSI .B Senior DevOps Engineer From: Christopher Schultz Sent: Thursday, December 7, 2023 23:33 To: users@tomcat.apache.org Subject: Re: [EXT] Re: Datadog _ JMX Integration facing connection issues. Sai Vamsi, On 12/6/23 11:04, Bodavula, Sai Vamsi Mohan Krishna (TR Technology) wrote: > Hello Christopher. > Thanks for the response! > > Let me walk you through the Environment., > I have a cluster and I am installing multiple microservices in the cluster. > And one of the microservices I am integrating the JMX on of the > microservices., > and the mentioned IP of the pod is being changed dynamically after each > deployment . > > Here are the annotations that I am using in my deployment: > - name: JAVA_OPTS > # value: >- > # -Dcom.sun.management.jmxremote > # -Dcom.sun.management.jmxremote.authenticate=false > # -Dcom.sun.management.jmxremote.ssl=false > # -Dcom.sun.management.jmxremote.local.only=false > # -Dcom.sun.management.jmxremote.port=49151 > # -Dcom.sun.management.jmxremote.rmi.port=49151 > # > -Djava.rmi.server.hostname=lab1workflow4scalsvc2zus1-service.hqm-lab1.svc.cluster.local If that's YAML, then all of the above is comments. Those lines do nothing. > as i said , I have implemented these in three scenarios., Catalina_opts / > Java_opts / Java_Tool_opts You should definitely use CATALINA_OPTS and none of the other things you mention, here. Specifically because of the port issues. JAVA_TOOL_OPTS don't affect Tomcat at all are useless for you. JAVA_OPTS affects all Tomcat-related scripts, and you'll find that even "shutdown" causes an error... because it's trying to initialize JMX when shutting-down, which is again useless. > I have tried deploying catalina_ots and Java_opts as in the case of above > mentioned. > I also tried other way, mentioning all these in the values.yaml file ( I am > using Helm Deployment to upgrade my deployments) and referring these > annotations as , and mentioning them in the Value > env: > - name: CATALINA_OPTS >value: {{ .Values.deployment.javaVMMemoryArgument }} > > > getting netstat output from my pod: > root@lab1workflow4scalsvc2zus1-deploymen
Re: [EXT] Re: Datadog _ JMX Integration facing connection issues.
Hello Christopher. Thanks for the response! Let me walk you through the Environment., I have a cluster and I am installing multiple microservices in the cluster. And one of the microservices I am integrating the JMX on of the microservices., and the mentioned IP of the pod is being changed dynamically after each deployment . Here are the annotations that I am using in my deployment: - name: JAVA_OPTS # value: >- # -Dcom.sun.management.jmxremote # -Dcom.sun.management.jmxremote.authenticate=false # -Dcom.sun.management.jmxremote.ssl=false # -Dcom.sun.management.jmxremote.local.only=false # -Dcom.sun.management.jmxremote.port=49151 # -Dcom.sun.management.jmxremote.rmi.port=49151 # -Djava.rmi.server.hostname=lab1workflow4scalsvc2zus1-service.hqm-lab1.svc.cluster.local as i said , I have implemented these in three scenarios., Catalina_opts / Java_opts / Java_Tool_opts I have tried deploying catalina_ots and Java_opts as in the case of above mentioned. I also tried other way, mentioning all these in the values.yaml file ( I am using Helm Deployment to upgrade my deployments) and referring these annotations as , and mentioning them in the Value env: - name: CATALINA_OPTS value: {{ .Values.deployment.javaVMMemoryArgument }} getting netstat output from my pod: root@lab1workflow4scalsvc2zus1-deployment-fd64ff775-cwzn6:/# netstat -tulpn Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp6 0 0 :::10109:::*LISTEN 1/java tcp6 0 0 :::9109 :::*LISTEN 1/java root@lab1workflow4scalsvc2zus1-deployment-fd64ff775-cwzn6:/# ps aux | grep tomcat root 563 0.0 0.0 6328 748 pts/0S+ 15:55 0:00 grep --color=auto tomcat right now , I am passing my args with Catalina_opts in my deployment and I am not able to get any tomcat process pid while i check with netstat -apn , I can see multiple Java Process but not single tomcat process My Jmx port is being configured as a service., so that it could be bounded with Tcp protocol externally to the container., and allow all tcp connections. Hope I am able to provide you some detailed information., Please let me know., if I can help you with anything in further! Thanks & Regards, -- SAI VAMSI .B Senior DevOps Engineer From: Christopher Schultz Sent: Wednesday, December 6, 2023 20:40 To: users@tomcat.apache.org Subject: Re: [EXT] Re: Datadog _ JMX Integration facing connection issues. Sai Vamsi, On 12/5/23 08:57, Bodavula, Sai Vamsi Mohan Krishna (TR Technology) wrote: > I have added my annotations in Catalina_opts ., and I am not able to see any > Java Process with the JMX, neither the port is being listened. > It came back to previous stage where Annotations are not on the JVM ., > Came back to previous stage, where connection refused error., as follows. > > Could not initialize instance: tomcat-10.75.12.136-49151: > java.util.concurrent.ExecutionException: java.io.IOException: Failed to > retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root > exception is java.rmi.ConnectException: Connection refused to host: > 10.75.12.136; nested exception is: > java.net.ConnectException: Connection refused (Connection refused)] > at > java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122) > at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191) > at org.datadog.jmxfetch.App.processRecoveryResults(App.java:953) > at org.datadog.jmxfetch.App$5.invoke(App.java:927) > at > org.datadog.jmxfetch.tasks.TaskProcessor.processTasks(TaskProcessor.java:63) > at org.datadog.jmxfetch.App.init(App.java:917) > at org.datadog.jmxfetch.App.start(App.java:413) > at org.datadog.jmxfetch.App.run(App.java:173) > at org.datadog.jmxfetch.JmxFetch.main(JmxFetch.java:57) > at org.datadog.jmxfetch.App.main(App.java:91) Right: the DataDog server is unable to connect to your appication via JMX. I'm assuming that 10.75.12.136 is the IP where Tomcat is running, and that DataDog isn't running on that server. It's on some other IP, right? > Here we were not able to find any process , to confirm that atleast > port is being listened to. What is your exact CATALINA_OPTS value (masking any secrets that may be in there). Is Tomcat definitely running? Can you prove that with a "ps" listing, for example? That will also confirm it's running with the proper CATALINA_OPTS settings. Can you run "netstat" and show all of the ports your Tomcat process is listening t
Re: [EXT] Re: Datadog _ JMX Integration facing connection issues.
As you suggested., I have added my annotations in Catalina_opts ., and I am not able to see any Java Process with the JMX, neither the port is being listened. It came back to previous stage where Annotations are not on the JVM ., Came back to previous stage, where connection refused error., as follows. Could not initialize instance: tomcat-10.75.12.136-49151: java.util.concurrent.ExecutionException: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 10.75.12.136; nested exception is: java.net.ConnectException: Connection refused (Connection refused)] at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191) at org.datadog.jmxfetch.App.processRecoveryResults(App.java:953) at org.datadog.jmxfetch.App$5.invoke(App.java:927) at org.datadog.jmxfetch.tasks.TaskProcessor.processTasks(TaskProcessor.java:63) at org.datadog.jmxfetch.App.init(App.java:917) at org.datadog.jmxfetch.App.start(App.java:413) at org.datadog.jmxfetch.App.run(App.java:173) at org.datadog.jmxfetch.JmxFetch.main(JmxFetch.java:57) at org.datadog.jmxfetch.App.main(App.java:91) Caused by: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 10.75.12.136; nested exception is: java.net.ConnectException: Connection refused (Connection refused)] at java.management.rmi/javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:370) at java.management/javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270) at org.datadog.jmxfetch.Connection.createConnection(Connection.java:63) at org.datadog.jmxfetch.RemoteConnection.(RemoteConnection.java:101) at org.datadog.jmxfetch.ConnectionFactory.createConnection(ConnectionFactory.java:38) at org.datadog.jmxfetch.Instance.getConnection(Instance.java:405) at org.datadog.jmxfetch.Instance.init(Instance.java:418) at org.datadog.jmxfetch.InstanceInitializingTask.call(InstanceInitializingTask.java:15) at org.datadog.jmxfetch.InstanceInitializingTask.call(InstanceInitializingTask.java:3) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 10.75.12.136; nested exception is: java.net.ConnectException: Connection refused (Connection refused)] at jdk.naming.rmi/com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:137) at java.naming/com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:220) at java.naming/javax.naming.InitialContext.lookup(InitialContext.java:409) at java.management.rmi/javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1839) at java.management.rmi/javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1813) at java.management.rmi/javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:302) ... 12 more Caused by: java.rmi.ConnectException: Connection refused to host: 10.75.12.136; nested exception is: java.net.ConnectException: Connection refused (Connection refused) at java.rmi/sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:623) at java.rmi/sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:209) at java.rmi/sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:196) at java.rmi/sun.rmi.server.UnicastRef.newCall(UnicastRef.java:343) at java.rmi/sun.rmi.registry.RegistryImpl_Stub.lookup(RegistryImpl_Stub.java:116) at jdk.naming.rmi/com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:133) ... 17 more Here we were not able to find any process , to confirm that atleast port is being listened to. Thanks & Regards, -- SAI VAMSI .B Senior DevOps Engineer From: Christopher Schultz Sent: Tuesday, December 5, 2023 19:19 To: users@tomcat.apache.org Subject: Re: [EXT] Re: Datadog _ JMX Integration facing connection issues. Sai Vamsa, On 12/5/23 01:25, Bodavula, Sai Vamsi Mohan Krishna (TR Technology) wrote: > Thanks for the response.. > > as you suggested., I tried adding my annotations in CATALINA_OPTS., Instead > of Java_Opts and J
Re: [EXT] Re: Datadog _ JMX Integration facing connection issues.
Hey Thomas, Thanks for the response. Yeah., I am trying to add Heap size parameters to the JVM using the annotations., DO you smell anything wrong in this!? Thanks & Regards, -- SAI VAMSI .B Senior DevOps Engineer From: Thomas Meyer Sent: Tuesday, December 5, 2023 00:03 To: Tomcat Users List ; Christopher Schultz ; users@tomcat.apache.org Subject: Re: [EXT] Re: Datadog _ JMX Integration facing connection issues. Hi, Also newer jvm do have XX:+UseContainerSupport set as default, also when using XX:+UseContainerSupport setting -Xms and -Xmx do not really make sense at all, you either want the JVM to deduce the max heap size from the memory cgroup or not Mfg Thomas Am 4. Dezember 2023 18:52:13 MEZ schrieb Christopher Schultz : >Sai Vamsi, > >On 12/4/23 03:53, Bodavula, Sai Vamsi Mohan Krishna (TR Technology) wrote: >> Firstly thanks for adding a point me in asking me to check, if the >> annotations are reflecting in the Java process, which opened me a door to >> add the concerned annotations in correct place., by adding in >> java_tool_options in stead of Java_opts. > >You will probably want to use CATALINA_OPTS instead of any of the other ones. >JAVA_TOOL_OPTS isn't an environment variable regognized by Tomcat. You >certainly don't want to use JAVA_OPTS, because Tomcat uses JAVA_OPTS any time >it invokes a JVM. For example, running bind/digest.sh doesn't need to have the >JMX subsystem starting-up and trying to grab a port. > >JAVA_TOOL_OPTS is an environment variable used by JVM-launching processes, >like jps for example... > >> yeah they are reflecting and creating a Java Process. >> but I am facing a problem here., while i am checking JSP, Thats : the port >> i am using here to enable JMX is been opening a process with the mentioned >> port and at the same time shows port is being used.: >> >> root@lab1workflow4scalsvc2zus1-deployment-577d856494-ftb22:/# jps >> Picked up JAVA_TOOL_OPTIONS: -Xms2048M -Xmx10240M >> -XX:+UseStringDeduplication -XX:+UseContainerSupport >> -Dcom.sun.management.jmxremote >> -Dcom.sun.management.jmxremote.authenticate=false >> -Dcom.sun.management.jmxremote.ssl=false >> -Dcom.sun.management.jmxremote.local.only=false >> -Dcom.sun.management.jmxremote.port=49151 >> -Djava.rmi.server.hostname=tomcat.default.svc.cluster.local >> -javaagent:/datadog-lib/dd-java-agent.jar >> -XX:OnError=/datadog-lib/continuousprofiler/tmp/dd_crash_uploader.sh >> -XX:ErrorFile=/datadog-lib/continuousprofiler/tmp/hs_err_pid_%p.log >> Error: Exception thrown by the agent : java.rmi.server.ExportException: Port >> already in use: 49151; nested exception is: >> java.net.BindException: Address already in use (Bind failed) > >Yes: you have set JAVA_TOOL_OPTS and then run jps. jps is trying to bind to >your port which is aready bound by your Tomcat process. > >The solution is to use only CATALINA_OPTS to set these options. > >-chris > >- >To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >For additional commands, e-mail: users-h...@tomcat.apache.org > -- Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.
Re: [EXT] Re: Datadog _ JMX Integration facing connection issues.
Hello Chris. Thanks for the response.. as you suggested., I tried adding my annotations in CATALINA_OPTS., Instead of Java_Opts and Java_tool_options., But its not even working out., Java process is not getting created., and port is not bound to any process. Let me know if I am missing anything. Thanks & Regards, -- SAI VAMSI .B Senior DevOps Engineer From: Christopher Schultz Sent: Monday, December 4, 2023 23:22 To: users@tomcat.apache.org Subject: Re: [EXT] Re: Datadog _ JMX Integration facing connection issues. Sai Vamsi, On 12/4/23 03:53, Bodavula, Sai Vamsi Mohan Krishna (TR Technology) wrote: > Firstly thanks for adding a point me in asking me to check, if the > annotations are reflecting in the Java process, which opened me a door to add > the concerned annotations in correct place., by adding in java_tool_options > in stead of Java_opts. You will probably want to use CATALINA_OPTS instead of any of the other ones. JAVA_TOOL_OPTS isn't an environment variable regognized by Tomcat. You certainly don't want to use JAVA_OPTS, because Tomcat uses JAVA_OPTS any time it invokes a JVM. For example, running bind/digest.sh doesn't need to have the JMX subsystem starting-up and trying to grab a port. JAVA_TOOL_OPTS is an environment variable used by JVM-launching processes, like jps for example... > yeah they are reflecting and creating a Java Process. > but I am facing a problem here., while i am checking JSP, Thats : the port i > am using here to enable JMX is been opening a process with the mentioned port > and at the same time shows port is being used.: > > root@lab1workflow4scalsvc2zus1-deployment-577d856494-ftb22:/# jps > Picked up JAVA_TOOL_OPTIONS: -Xms2048M -Xmx10240M -XX:+UseStringDeduplication > -XX:+UseContainerSupport -Dcom.sun.management.jmxremote > -Dcom.sun.management.jmxremote.authenticate=false > -Dcom.sun.management.jmxremote.ssl=false > -Dcom.sun.management.jmxremote.local.only=false > -Dcom.sun.management.jmxremote.port=49151 > -Djava.rmi.server.hostname=tomcat.default.svc.cluster.local > -javaagent:/datadog-lib/dd-java-agent.jar > -XX:OnError=/datadog-lib/continuousprofiler/tmp/dd_crash_uploader.sh > -XX:ErrorFile=/datadog-lib/continuousprofiler/tmp/hs_err_pid_%p.log > Error: Exception thrown by the agent : java.rmi.server.ExportException: Port > already in use: 49151; nested exception is: > java.net.BindException: Address already in use (Bind failed) Yes: you have set JAVA_TOOL_OPTS and then run jps. jps is trying to bind to your port which is aready bound by your Tomcat process. The solution is to use only CATALINA_OPTS to set these options. -chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [EXT] Re: Datadog _ JMX Integration facing connection issues.
& Regards, -- SAI VAMSI .B Senior DevOps Engineer From: Christopher Schultz Sent: Thursday, November 30, 2023 04:07 To: users@tomcat.apache.org Subject: Re: [EXT] Re: Datadog _ JMX Integration facing connection issues. Sai Vamsi, On 11/29/23 03:50, Bodavula, Sai Vamsi Mohan Krishna (TR Technology) wrote: > I am trying to add Tomcat-JMX Integration to the Datadog Agent, in order to > achieve Remote Monitoring . > I am following the docs > https://urldefense.com/v3/__https://docs.datadoghq.com/containers/guide/autodiscovery-with-jmx/?tab=helm*autodiscovery-annotations__;Iw!!GFN0sa3rsbfR8OLyAw!ZWe640rbBZ7N396lgR23yoo6ALro2xOf6L5lX7cVrpEf19qb0yEfJkd-8jsUiTCABJ46H974kV-LzaS-pYo5EtQDEVC4MYm-FCIfzPlzzlXVqQ$ > [https://urldefense.com/v3/__https://datadog-docs.imgix.net/images/dd-docs-meta-image.png__;!!GFN0sa3rsbfR8OLyAw!ZWe640rbBZ7N396lgR23yoo6ALro2xOf6L5lX7cVrpEf19qb0yEfJkd-8jsUiTCABJ46H974kV-LzaS-pYo5EtQDEVC4MYm-FCIfzPnR3EJUUg$ > > ]<https://urldefense.com/v3/__https://docs.datadoghq.com/containers/guide/autodiscovery-with-jmx/?tab=helm*autodiscovery-annotations__;Iw!!GFN0sa3rsbfR8OLyAw!ZWe640rbBZ7N396lgR23yoo6ALro2xOf6L5lX7cVrpEf19qb0yEfJkd-8jsUiTCABJ46H974kV-LzaS-pYo5EtQDEVC4MYm-FCIfzPlzzlXVqQ$ > > > Autodiscovery with > JMX<https://urldefense.com/v3/__https://docs.datadoghq.com/containers/guide/autodiscovery-with-jmx/?tab=helm*autodiscovery-annotations__;Iw!!GFN0sa3rsbfR8OLyAw!ZWe640rbBZ7N396lgR23yoo6ALro2xOf6L5lX7cVrpEf19qb0yEfJkd-8jsUiTCABJ46H974kV-LzaS-pYo5EtQDEVC4MYm-FCIfzPlzzlXVqQ$ > > > Datadog, the leading service for cloud-scale monitoring. > docs.datadoghq.com > > > This is the Environment I am using in my case. > I am trying to integrate JMX in one my Deployment, in AKS environment and I > am using Helm to upgrade my environment. > as suggested in the documentation., I am adding the annotations in my > deployment file in helm structure. Okay, I know absolutely nothing about Azure, Kubernetes, or Helm. But it looks like maybe this is more basic than that... > My agent is JMX enabled, and i can see in deployment logs. > I have configured a service for this deployment and its reflecting. > > > Issue I am facing : > I am trying to add my annotations, in the deployment file, after > deployment, it should be able make the remote connection , but its showing > these logs in the agent. I will be of no help in figuring out what "annotations" you need in your "deployment file" because - again - I know nothing about Azure, Kube, and Helm. > while i check the Java process., even its not reflecting this JMX process , > it seems JMX process is not at all created, in my case., > > error i am facing after deployment" > > JMXFetch > > >Information >== > runtime_version : 11.0.18 > version : 0.47.8 >Initialized checks >== > tomcat >instance_name : tomcat-10.75.12.143-1099 >message : Unable to instantiate or initialize instance > 10.75.12.143:1099. Is the target JMX Server or JVM running? Failed to > retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root > exception is java.rmi.ConnectException: Connection refused to host: > 10.75.12.143; nested exception is: > java.net.ConnectException: Connection refused (Connection refused)] Well THAT seems straightforward. First: is that the right IP address? Second: on that server (10.75.12.143), is port 1099 bound-to by the Tomcat process? Can you, for example, nc to that TCP/IP port? Have you checked the Tomcat logs to see if there any errors during startup... for example, any JMX-related errors? Third: on that IP, is port 1099 reachable from the Helm (or whatever) server that is trying to contact it? Try using "nc 10.75.12.143 1099" and see if you can connect from Helm (or whatever). > - name: JAVA_OPTS >value: >- > -Dcom.sun.management.jmxremote > -Dcom.sun.management.jmxremote.authenticate=false > -Dcom.sun.management.jmxremote.ssl=false > -Dcom.sun.management.jmxremote.local.only=false > -Dcom.sun.management.jmxremote.port=1099 > -Dcom.sun.management.jmxremote.rmi.port=1099 > -Djava.rmi.server.hostname=$(POD_IP) > -Djava.net.preferIPv4Stack=true > -Dcom.sun.management.jmxremote.host=$(POD_IP) Can you login to 10.75.12.143 and check to see if the JVM launch command has (a) all of the above -D arguments in it and (b) if the host/hostname have the expected values in them? -chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [EXT] Re: Datadog _ JMX Integration facing connection issues.
I am trying to add Tomcat-JMX Integration to the Datadog Agent, in order to achieve Remote Monitoring . I am following the docs https://docs.datadoghq.com/containers/guide/autodiscovery-with-jmx/?tab=helm#autodiscovery-annotations [https://datadog-docs.imgix.net/images/dd-docs-meta-image.png]<https://docs.datadoghq.com/containers/guide/autodiscovery-with-jmx/?tab=helm#autodiscovery-annotations> Autodiscovery with JMX<https://docs.datadoghq.com/containers/guide/autodiscovery-with-jmx/?tab=helm#autodiscovery-annotations> Datadog, the leading service for cloud-scale monitoring. docs.datadoghq.com This is the Environment I am using in my case. I am trying to integrate JMX in one my Deployment, in AKS environment and I am using Helm to upgrade my environment. as suggested in the documentation., I am adding the annotations in my deployment file in helm structure. My agent is JMX enabled, and i can see in deployment logs. I have configured a service for this deployment and its reflecting. Issue I am facing : I am trying to add my annotations, in the deployment file, after deployment, it should be able make the remote connection , but its showing these logs in the agent. while i check the Java process., even its not reflecting this JMX process , it seems JMX process is not at all created, in my case., error i am facing after deployment" JMXFetch Information == runtime_version : 11.0.18 version : 0.47.8 Initialized checks == tomcat instance_name : tomcat-10.75.12.143-1099 message : Unable to instantiate or initialize instance 10.75.12.143:1099. Is the target JMX Server or JVM running? Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 10.75.12.143; nested exception is: java.net.ConnectException: Connection refused (Connection refused)] metric_count : 0 service_check_count : 0 status : ERROR instance_name : tomcat-10.75.12.143-1099 message : Unable to instantiate or initialize instance 10.75.12.143:1099. Is the target JMX Server or JVM running? Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 10.75.12.143; nested exception is: java.net.ConnectException: Connection refused (Connection refused)] metric_count : 0 service_check_count : 0 status : ERROR Failed checks = no checks These are the annotations i have tried to implement JMX in my case: ad.datadoghq.com/{{ .Values.configmap.app.name }}-container.checks: >- { "tomcat": { "init_config": { "is_jmx": true, "collect_default_metrics": true }, "instances": [{ "host": "%%host%%", "port": "1099" }] } } - name: POD_IP valueFrom: fieldRef: fieldPath: status.podIP - name: JAVA_OPTS value: >- -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.rmi.port=1099 -Djava.rmi.server.hostname=$(POD_IP) -Djava.net.preferIPv4Stack=true -Dcom.sun.management.jmxremote.host=$(POD_IP) Even i tried by altering some of the unwanted annotations, I am not getting the expected result., ie., remote JMX connection., I would requet your help in this., Thanks in advance! Thanks & Regards, -- SAI VAMSI .B Senior DevOps Engineer From: Christopher Schultz Sent: Tuesday, November 28, 2023 19:41 To: users@tomcat.apache.org Subject: [EXT] Re: Datadog _ JMX Integration facing connection issues. External Email: Use caution with links and attachments. Sai Vamsi, On 11/28/23 04:29, Bodavula, Sai Vamsi Mohan Krishna (TR Technology) wrote: > Hello team, > I am trying to add Tomcat-JMX Integration to the Datadog Agent, in order > to achieve Remote Monitoring . > I am following the docs > https://urldefense.com/v3/__https://docs.datadoghq.com/containers/guide/autodiscovery-with-jmx/?tab=helm*autodiscovery-annotations__;Iw!!GFN0sa3rsbfR8OLyAw!flrd6o4JKEdfTeHqFXZnxrdwVlDfgIQWa0LA1ItCAwqquaEQHF1TQrWhTdEdCz8b0U5R2hKiyy7adAu09KNW3__LBlrGJg7Il1X4ugDoVeSJPw$ > > <https://urldefense.com/v3/__https://docs.datadoghq.com/containers/guide/autodiscovery-with-jmx/?tab=helm*autodiscovery-annota
Datadog _ JMX Integration facing connection issues.
Hello team, I am trying to add Tomcat-JMX Integration to the Datadog Agent, in order to achieve Remote Monitoring . I am following the docs https://docs.datadoghq.com/containers/guide/autodiscovery-with-jmx/?tab=helm#autodiscovery-annotations This is the Environment I am using in my case. I am trying to integrate JMX in one my Deployment, in AKS environment and I am using Helm to upgrade my environment. as suggested in the documentation., I am adding the annotations in my deployment file in helm structure. My agent is JMX enabled, and i can see in deployment logs. I have configured a service for this deployment and its reflecting. Issue I am facing : I am trying to add my annotations, in the deployment file, after deployment, it should be able make the remote connection , but its showing these logs in the agent. while i check the Java process., even its not reflecting this JMX process , it seems JMX process is not at all created, in my case., [cid:5a307d04-216c-42b5-9e74-0b23df59b803] Following are the annotations i am using in my case [cid:40751353-de64-4b88-a04b-7fda70f9cc5c] [cid:208606f4-1e69-4e53-b191-ce2254e9352d] Even i tried by altering some of the unwanted annotations, I am not getting the expected result., ie., remote JMX connection., I would requet your help in this., Thanks in advance! Thanks & Regards, -- SAI VAMSI .B Senior DevOps Engineer This e-mail is for the sole use of the intended recipient and contains information that may be privileged and/or confidential. If you are not an intended recipient, please notify the sender by return e-mail and delete this e-mail and any attachments. Certain required legal entity disclosures can be accessed on our website: https://www.thomsonreuters.com/en/resources/disclosures.html