问题遇到的现象和发生背景
Session-cluster模式能够正常 RUNNING
但是提交任务总是失败
问题相关代码,请勿粘贴截图
[hadoop@master ~]$ yarn-session.sh -n 1 -s 2 -jm 1024 -tm 1024 -nm session-cluster -d
[hadoop@master ~]$ flink run -c com.dylan.wc.StreamWordCount -p 1 /usr/local/src/flink/examples/batch/WordCount.jar
这里报错
运行结果及报错内容
2022-04-08 17:16:01,801 INFO org.apache.flink.yarn.cli.FlinkYarnSessionCli - Found Yarn properties file under /tmp/.yarn-properties-hadoop.
2022-04-08 17:16:01,801 INFO org.apache.flink.yarn.cli.FlinkYarnSessionCli - Found Yarn properties file under /tmp/.yarn-properties-hadoop.
------------------------------------------------------------
The program finished with the following exception:
org.apache.flink.client.program.ProgramInvocationException: The program's entry point class 'com.dylan.wc.StreamWordCount' was not found in the jar file.
at org.apache.flink.client.program.PackagedProgram.loadMainClass(PackagedProgram.java:422)
at org.apache.flink.client.program.PackagedProgram.<init>(PackagedProgram.java:146)
at org.apache.flink.client.program.PackagedProgram.<init>(PackagedProgram.java:68)
at org.apache.flink.client.program.PackagedProgram$Builder.build(PackagedProgram.java:590)
at org.apache.flink.client.cli.CliFrontend.buildProgram(CliFrontend.java:705)
at org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:200)
at org.apache.flink.client.cli.CliFrontend.parseParameters(CliFrontend.java:895)
at org.apache.flink.client.cli.CliFrontend.lambda$main$10(CliFrontend.java:968)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1754)
at org.apache.flink.runtime.security.HadoopSecurityContext.runSecured(HadoopSecurityContext.java:41)
at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:968)
Caused by: java.lang.ClassNotFoundException: com.dylan.wc.StreamWordCount
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at org.apache.flink.util.ChildFirstClassLoader.loadClass(ChildFirstClassLoader.java:69)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.flink.client.program.PackagedProgram.loadMainClass(PackagedProgram.java:420)
... 12 more
我的解答思路和尝试过的方法
我想要达到的结果
Session-cluster模式下提交任务