Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect Flink remotely via JMX?

For my upcoming bachelor's thesis I want to develop a tool that collects system and application data from Apache Flink and sends this data in some kind of "events" to another system. This tool will be installed on Flink job- and taskmanager nodes. Beside data from linux system utilities like dstat I would like to collect JMX data.

My problem is, that I couldn't figure out how to connect via remote JMX connection by using a port to Flinks jobmanager. Although the collector will be on the same machine, I really try to avoid using a --javaagent to access JMX data of Flink's JVM.

Another problem is, I have a local docker setup based on https://github.com/apache/flink/tree/master/flink-contrib/docker-flink and updated to flink-1.0.2, that I cannot connect via jconsole because I don't know how to "open" a JMX remote port for the job- and taskmanager.

Is there any way to achieve this?

Thanks in advance, any ideas very appreciated.

like image 829
Markus Lamm Avatar asked Mar 13 '23 11:03

Markus Lamm


1 Answers

Solved!

I needed to add env.java.opts: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false

in flink-conf.yaml.

No it's possible to connect the jobmanager via jconsole.

like image 52
Markus Lamm Avatar answered May 01 '23 11:05

Markus Lamm