I am running a java application on Mesos and Marathon. How do i monitor the heap stats of the java process? I tried jstat which complains “pid not found”, but the process is running and i can check it by ‘ps auwx’. Is this because the java process is running inside a cgroup? If that is the case how do we monitor mesos based applications.
The best option to monitor application is to publish it’s metrics from itself. There are plenty of ways to add monitoring to your application starting from proprietarty such as NewRelic or DataDog to opensource Prometheus.
If you need to get acces via JMX you can expose this port with following configuration:
-Dcom.sun.management.jmxremote / -Dcom.sun.management.jmxremote.ssl=false / -Dcom.sun.management.jmxremote.local.only=false / -Dcom.sun.management.jmxremote.authenticate=false / -Dcom.sun.management.jmxremote.port=$PORT1 / -Djava.rmi.server.hostname=$MESOS_HOSTNAME
Above configuration assume you have two ports and second is dedicated for JMX