Flink: How to pass extra JVM options to TaskManager and JobManager

我与影子孤独终老i 提交于 2019-12-02 03:22:41

问题


I am trying to submit flink job on yarn using below command:

/usr/flink-1.3.2/bin/flink run -yd -yn 1 -ynm MyApp -ys 1 -yqu default -m yarn-cluster -c com.mycompany.Driver -j /usr/myapp.jar -Denv.java.opts="-Dzkconfig.parent /app-config_127.0.0.1 -Dzk.hosts localhost:2181 -Dsax.zookeeper.root /app"

I got the env.java.opts on flink client log but when the application gets submitted to Yarn, these Java options wont be available. Due to unavailability of extra JVM options, application throws exception while connecting with zookeeper.

Please suggest, how to pass dynamic properties to JM & TM running on yarn.

Note: I tried to set env.java.opts options into conf/flink-conf.yaml and its working fine. I need a way to set this option through flink run command.


回答1:


Sorry for the late response, but I believe is you start a long-running Flink session on YARN, then the parameters you set via -Dxxx=yyy will be forwarded to the JM/TMs that this creates in YARN. Have you tried that approach?




回答2:


I think you should replace -Denv.java.opts by -yD env.java.opts so your command becomes:

/usr/flink-1.3.2/bin/flink run -yd -yn 1 -ynm MyApp -ys 1 -yqu default -m yarn-cluster -c com.mycompany.Driver -j /usr/myapp.jar -yD env.java.opts="-Dzkconfig.parent /app-config_127.0.0.1 -Dzk.hosts localhost:2181 -Dsax.zookeeper.root /app"


来源:https://stackoverflow.com/questions/46977287/flink-how-to-pass-extra-jvm-options-to-taskmanager-and-jobmanager

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!