Hi,
I want to run a flink job with the JVM parameters "-Dcom.sun.management.jmxremote.port=3333 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false" in order to monitor this job with VisualVM. So I am doing like this: ./bin/flink run ../TaxiRideCount.jar -yD env.java.opts="-Dcom.sun.management.jmxremote.port=3333 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false" -input /home/flink/nycTaxiRides.gz -output mqtt -sinkHost 127.0.0.1 The problem is that when I try to add a JMX connection from VisualVM the connection seems to not capture anything. I ensure that VisualVM is able to listen the java process in my machine since I can see the TaskManagerRunner and the StandaloneSessionClusterEntrypoint. However, VisualVM is not able to show the thread tab for those processes as well. This is why I am trying to add the JVM parameters when submitting the link job [1]. A common issue is also when the VisualVM and the java processes are not using the same JDK. However, this is also not my case. All applications are using OpenJDK 64-Bit Server VM version 1.8.0_252. Have already anyone tried to monitor Flink applications using VisualVM? Thanks, Felipe [1] https://stackoverflow.com/questions/16023507/why-isnt-visualvm-showing-all-the-normal-tabs -- -- Felipe Gutierrez -- skype: felipe.o.gutierrez -- https://felipeogutierrez.blogspot.com |
Hi, I managed to find the solution. Just for the record I am gonna post here:
I added the JMX parameters on the file bin/flink to submit the FLink job using these parameters. log_setting=(-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port="9010" -Dcom.sun.management.jmxremote.local.only="false" -Dcom.sun.management.jmxremote.authenticate="false" -Dcom.sun.management.jmxremote.ssl="false" -Dlog.file="$log" -Dlog4j.configuration=file:"$FLINK_CONF_DIR"/log4j-cli.properties -Dlog4j.configurationFile=file:"$FLINK_CONF_DIR"/log4j-cli.properties -Dlogback.configurationFile=file:"$FLINK_CONF_DIR"/logback.xml) After this I am able to monitor the threads of my application and collect samples of CPU and memory using VisualVM. Although I am getting some other errors which I think it are related to other configurations. "main" #1 prio=5 os_prio=0 tid=0x00007f876000c800 nid=0x4bfa waiting on condition [0x00007f8768a32000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x000000076f04ea00> (a java.util.concurrent.CompletableFuture$Signaller) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) at java.util.concurrent.CompletableFuture$Signaller.block(CompletableFuture.java:1707) at java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3323) at java.util.concurrent.CompletableFuture.waitingGet(CompletableFuture.java:1742) at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1908) at org.apache.flink.client.program.StreamContextEnvironment.execute(StreamContextEnvironment.java:93) at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1643) at org.apache.flink.streaming.examples.aggregate.TaxiRideCountPreAggregate.main(TaxiRideCountPreAggregate.java:119) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:321) at org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:205) at org.apache.flink.client.ClientUtils.executeProgram(ClientUtils.java:148) at org.apache.flink.client.cli.CliFrontend.executeProgram(CliFrontend.java:662) at org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:210) at org.apache.flink.client.cli.CliFrontend.parseParameters(CliFrontend.java:893) at org.apache.flink.client.cli.CliFrontend.lambda$main$10(CliFrontend.java:966) at org.apache.flink.client.cli.CliFrontend$$Lambda$38/510464020.call(Unknown Source) at org.apache.flink.runtime.security.contexts.NoOpSecurityContext.runSecured(NoOpSecurityContext.java:30) at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:966) -- -- Felipe Gutierrez -- skype: felipe.o.gutierrez -- https://felipeogutierrez.blogspot.com On Mon, Jun 15, 2020 at 12:30 PM Felipe Gutierrez <[hidden email]> wrote: > > Hi, > > I want to run a flink job with the JVM parameters > "-Dcom.sun.management.jmxremote.port=3333 > -Dcom.sun.management.jmxremote.ssl=false > -Dcom.sun.management.jmxremote.authenticate=false" in order to monitor > this job with VisualVM. So I am doing like this: > > ./bin/flink run ../TaxiRideCount.jar -yD > env.java.opts="-Dcom.sun.management.jmxremote.port=3333 > -Dcom.sun.management.jmxremote.ssl=false > -Dcom.sun.management.jmxremote.authenticate=false" -input > /home/flink/nycTaxiRides.gz -output mqtt -sinkHost 127.0.0.1 > > The problem is that when I try to add a JMX connection from VisualVM > the connection seems to not capture anything. > > I ensure that VisualVM is able to listen the java process in my > machine since I can see the TaskManagerRunner and the > StandaloneSessionClusterEntrypoint. However, VisualVM is not able to > show the thread tab for those processes as well. This is why I am > trying to add the JVM parameters when submitting the link job [1]. A > common issue is also when the VisualVM and the java processes are not > using the same JDK. However, this is also not my case. All > applications are using OpenJDK 64-Bit Server VM version 1.8.0_252. > > Have already anyone tried to monitor Flink applications using VisualVM? > > Thanks, Felipe > [1] https://stackoverflow.com/questions/16023507/why-isnt-visualvm-showing-all-the-normal-tabs > -- > -- Felipe Gutierrez > -- skype: felipe.o.gutierrez > -- https://felipeogutierrez.blogspot.com |
Thanks a lot for posting the solution! It might be helpful for other users. On Mon, Jun 15, 2020 at 2:36 PM Felipe Gutierrez <[hidden email]> wrote: Hi, I managed to find the solution. Just for the record I am gonna post here: |
Free forum by Nabble | Edit this page |