2

Need help on connecting a jolokia agent to my spark job and see the sinc metrics.

https://jolokia.org/reference/html/agents.html#jvm-agent Of the two options available not able to use javaagent with spark-submit and on the fly approach is tricky as will not know in which worker node and which pid the agent to start.

How to start jolokia within my code. Spark code is written in Scala.

  • I'm sorry but I have to vote this down. This is off-topic. – eliasah Nov 18 '16 at 10:40
  • 1
    able to attach javaagent 'spark-submit --files /root/.linuxbrew/Cellar/apache-spark/1.6.1/libexec/conf/metrics.properties --conf 'spark.metrics.conf=/root/.linuxbrew/Cellar/apache-spark/1.6.1/libexec/conf/metrics.properties' --conf 'spark.driver.extraJavaOptions=-javaagent:/tmp/jolokia-jvm-1.3.5-agent.jar=port=8779,host=localhost' --class com.abc.xyz --master spark://157.227.42.67:6066 --deploy-mode cluster test.jar' – Rushabh Mehta Nov 18 '16 at 13:53

1 Answers1

0

For the on the fly method, you can also use a unique regexp to match (a part of the) process description for attaching to if you don't know the PID. E.g. when running a tomcat its enough to use a java -jar jolokia-jvm.jar start catalina if there is only one Tomcat running.

Roland Huß
  • 2,507
  • 15
  • 30